-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ROS bag loop option #3214
Add ROS bag loop option #3214
Conversation
Signed-off-by: Cornaglia, Alessandro <alessandro.cornaglia@intel.com>
Can one of the admins verify this patch? |
do | ||
{ | ||
startDevice(); | ||
} while (rosbag_loop); // Terminate loop only after CTRL-C |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @acornaglia ,
Will changing this param to False on runtime stop this while true?
If not
Why not add a counter instead of bool to the parameter and loop by the counter?
while (true) is less preferred IMO..
You can add a special case of -1 for example for forever
,
@SamerKhshiboun thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Nir-Az , thanks for the comment. My expectation is that the bag file will loop only when the node is launched with a command similar to one of the following two options:
ros2 run realsense2_camera realsense2_camera_node --ros-args -p rosbag_filename:="depth_under_water.bag" -p rosbag_loop:="true"
or :
ros2 launch realsense2_camera rs_launch_from_rosbag.py rosbag_filename:="depth_under_water.bag" rosbag_loop:="true"
As such, I don't expect the rosbag_loop
parameter changing at runtime. It should be set initially based on the value provided in the command line. I am open to the idea of using a counter instead of a boolean, but could you please provide a more concrete example? Thank you.
Signed-off-by: Cornaglia, Alessandro <alessandro.cornaglia@intel.com>
Signed-off-by: Cornaglia, Alessandro <alessandro.cornaglia@intel.com>
Signed-off-by: Cornaglia, Alessandro <alessandro.cornaglia@intel.com>
Signed-off-by: Cornaglia, Alessandro <alessandro.cornaglia@intel.com>
Signed-off-by: Cornaglia, Alessandro <alessandro.cornaglia@intel.com>
…e-ros into rosbag_loop
Scope
The changes in this PR introduce the possibility of looping the playback of a given rosbag file. This can be done by using the added
rosbag_loop
cmd line argument:Testing
Environment
Docker container running:
Results
The collected output for the (3x) looping playback of an exemplary bag file is: