0
$\begingroup$

Rosanswers logo

Hey guys,

i'm trying to use rosbag record to pass multiple arguments in a launch file, but unfortunately the folder is not created and recordings aren't started.

I used the following arguments:

node pkg ="rosbag" type="record" name="record_run" args="record -o ./rosbags record --split --duration=15m -a" />

record -o ./rosbags --split --duration=15m -a

-o : timestamp for bag file

--split --duration=15m : split the bag when duration is reached

-a : record all topics

Does anyone know what i did wrong, i have tried different variations, but it's still not working

Thanks a lot!


Originally posted by Petros ADLATUS on ROS Answers with karma: 28 on 2022-03-23

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

news

i have solved the bug. To all those who want to use the launch file:

<--How to use

<--add a launch file

<---->

<--add a node package

<---->

<--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->

<--1. start Yujin LiDAR node-->

node pkg ="yujin_yrl_v2_package" type="yrl_pub" name="lidar_run"

<--start rviz node-->

node pkg ="rviz" type="rviz" name="rviz_run" args="-d /home/pkatsoulakos/catkin_ws/src/launch/settings.rviz"

<--start rosbag node-->

node pkg ="rosbag" type="record" name="record_run" args="record -o /home/pkatsoulakos/catkin_ws/src/launch/rosbags/Besprechungsraum/ --split --duration=15m -a"


Originally posted by Petros ADLATUS with karma: 28 on 2022-03-23

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by gvdhoorn on 2022-03-23:
Just a note: this is not a bug, but likely expected behaviour.

Every executable you start using roslaunch has the CWD (ie: current working directory) changed to $HOME/.ros (at least, on Linux, and if you haven't changed the default).

In your original post, you specified this as the directory for rosbag to record to: ./rosbags. That's a relative path, and would resolve to $HOME/.ros/rosbags.

You might want to check whether there are .bags stored in that directory on your system.

Changing the path to an absolute path solves this, as now the CWD does not influence where the files will end up.

Comment by Petros ADLATUS on 2022-03-23:
thank you for the advice. In the future I will take care of that

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.