ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Custom rosbag record in launch file (several args)

asked 2022-03-23 02:17:02 -0500

Petros ADLATUS gravatar image

updated 2022-03-23 02:18:48 -0500

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!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-03-23 03:44:46 -0500

Petros ADLATUS gravatar image

news

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

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

<--How to use -->

<--add a launch file --> <--<include file="$(find package_name)/launchfile.launch"/>-->

<--add a node package --> <--<node pkg="package" type="node_type" name="node_name"/>-->

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

<--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"

</launch>

edit flag offensive delete link more

Comments

1

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.

gvdhoorn gravatar image gvdhoorn  ( 2022-03-23 03:51:51 -0500 )edit

thank you for the advice. In the future I will take care of that

Petros ADLATUS gravatar image Petros ADLATUS  ( 2022-03-23 03:54:17 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2022-03-23 02:17:02 -0500

Seen: 420 times

Last updated: Mar 23 '22