Giving a directory to output file in a launcher. for (rosbag record and rostopic echo)
Hi,
I have been working by now in ROS by the command line and I have just started to work with launch files.
Some nodes I want to run are rosbag (record) and rostopic (echo). I have been finding templates of launchers for these nodes, that i have found useful. But the problem is that in both nodes (rosbag record and rostopic echo) we create output files, and i havent found a way to specify the output file directory.
Examples:
1)rosbag record launch:
<launch> <node pkg="rosbag" type="record" name="record" output="screen" args="-a"/> </launch>
2)rostopic echo launch
<launch> <node name="rostopic_echo_gps" pkg="rostopic" type="rostopic" output="screen" args="echo /extended_gps"> </node> </launch>
Question: Is there any way for any of them (rosbag record or rostopic echo) that you know for specify the output file directory??
For example in rosbag play we can specify the input file directory with:
<launch> <node pkg="rosbag" type="play" name="rosbag_play" output="screen" args="/home/user/Escritorio/main_bags/2013-04-13-02-36-11.bag"/> </launch>
in this example the input file directory is specified by "/home/user/Escritorio/main_bags/" and the filename by "2013-04-13-02-36-11.bag", I want to specify the directory too when I use output files not only when I use input. Could you please help me in any case rosbag record or rostopic echo (to a output file) if you know how to?
Thank you very much,
Pablo Payno
Error when introducing tags: #launch #roslaunch #rosbag #rostopic #rosbag_record #rostopic_echo #output #directory #output_directory #specify_directory #rosbag_output #rostopic_output
I have found a solution, dont think it might be the best but at least it works for rosbag record in a specified directory: <launch> <node pkg="rosbag" type="record" name="record" output="screen" args="-o /directory/Prefix_name -a"/> </launch> It makes with -o /directory/Prefix_name the record rosbag to be written inside the specified directory, with the name: "Prefix_name+date.bag" and with -a it makes the rosbag to record all topics, if any find a prettier solution please share, about the rostopic echo still couldnt find a solution to specify the output file directory, so please explain if any knows, thanks