ros_comm
ros_comm copied to clipboard
Behaviour of `rosbag record` and `rosrun rosbag record` is inconsistent for regex
When running rosbag record
from the commandline, I can specify multiple -e
arguments to the command, and it will work.
rosbag record -o $HOME/test.bag -e /some/namespace/* -e /other/namespace/*
However, when trying to do the same thing with rosrun or in launch file, an error comes up instead
<launch>
<node name="rosbag" pkg="rosbag" type="record"
args="-o $(env HOME)/test.bag
-e /some/namespace/*
-e /other/namespace/*
"/>
</launch>
rosrun rosbag record -o $HOME/test.bag -e /some/namespace/* -e /other/namespace/*
The error:
terminate called after throwing an instance of 'boost::wrapexcept<boost::program_options::multiple_occurrences>'
what(): option '--regex' cannot be specified more than once
Aborted (core dumped)
Instead, I had to use a chain of |
to get the same behaviour
rosrun rosbag record -o $HOME/test.bag -e /some/namespace/*|/other/namespace/*
i think in a launch file you must only specify once the argument -e not 2x.
For example:
launch
node name="rosbag" pkg="rosbag" type="record" args="-o $(env HOME)/test.bag -e /some/namespace/* /other/namespace/* "/
/launch