IntelRealSense / realsense-ros

ROS Wrapper for Intel(R) RealSense(TM) Cameras
http://wiki.ros.org/RealSense
Apache License 2.0
2.6k stars 1.76k forks source link

Using time from /clock in /camera messages #3260

Open dr3vv opened 1 day ago

dr3vv commented 1 day ago
Required Info
Camera Model { D435 }
Firmware Version (2.55.1)
Operating System & Version { Linux (Ubuntu 20 }
Kernel Version (Linux Only) (5.15.0-125-generic)
Platform PC
Librealsense SDK Version { 2.<?>.<?> }
Language {C++ }
Segment {}
ROS Distro {Noetic}
RealSense ROS Wrapper Version {ros1 legacy}

Issue Description

Hi, I've been working with the ros1-legacy wrapper for my D435 and trying to get the /camera messages to also use the time from my /clock server. The tfs already run on that time. I'm starting the camera nodes through realsense2_camera rs_camera.launch. I've seen issues where people include the argument use_sim_time:=true on launch but that didn't seem to work for me and all the /camera messages still had the wall-time in their header. I'm trying to do this to include the point cloud in a visualization together with a UR5, where the camera_link is attached to the flange of the arm with a static_transform.

I've looked through the documentation and I'm aware that this seems to be a common issue, so I'm sorry if there is something I read over.

MartyG-RealSense commented 22 hours ago

Hi @dr3vv The rosbag playback section of Intel's ROS1 SLAM guide for D435i at the link below suggests using --clock when launching the bag by its filename as well as the use_sim_time true command.

roscore >/dev/null 2>&1 &
rosparam set use_sim_time true
rosbag play my_bagfile_1.bag --clock
roslaunch realsense2_camera opensource_tracking.launch offline:=true

https://github.com/IntelRealSense/realsense-ros/wiki/SLAM-with-D435i