-
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 Dynamic Transforms support -- multi-cam #169
Add Dynamic Transforms support -- multi-cam #169
Conversation
3de83ad
to
ffacb7c
Compare
Due to a ROS bug which prevents publishing more than one static transform in separate processes, enable the use of dynamic camera transforms when needed for multiple camera support. Static transforms are still the default. See: ros/ros_comm#146 ros/geometry2#181
ffacb7c
to
e2cf09c
Compare
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.
One minor functional change, and one cosmetic change requested, see comments inline. I tested on R200 and ZR300, seems to work. Tested both together with separate launch files and that worked too when setting the enable_tf_dynamic=true.
Also, can we update the PR title and the description comments to reflect that static is still the default, we're just adding dynamic as an option.
@@ -41,6 +41,11 @@ namespace realsense_camera | |||
*/ | |||
BaseNodelet::~BaseNodelet() | |||
{ | |||
if (enable_tf_ == true && enable_tf_dynamic_ == false) |
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.
I think this should be enable_tf_dynamic_ == true
Shouldn't it?
@@ -91,10 +96,20 @@ namespace realsense_camera | |||
setStreams(); | |||
startCamera(); | |||
|
|||
// Start publishing tranforms | |||
// Start tranforms thread |
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.
Can we fix the spelling of transforms?
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.
LGTM from code perspective. Only thing that stood out was the true/false change Matt saw and you already fixed.
Agreed that the PR title and subject needs to be changed if static is still the actual default as it is here.
// Publish transforms for the cameras | ||
ROS_INFO_STREAM(nodelet_name_ << " - Publishing camera transforms (/tf)"); | ||
|
||
ros::Rate loop_rate(1); |
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.
Any reason for such a slow loop? tf transforms are traditionally published at ~50Hz.
Additional parameter proposed in #221
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.
The data is not changing, hence the slow loop rate.
The default for transforms is to publish them with a static transform, but due to a ROS bug (and a camera driver bug for F200/SR300) the dynamic transform option was added.
See http://wiki.ros.org/realsense_camera#Transform_Restrictions
@pavloblindnology , Somehow, until very recently I remained unaware of your work. |
@doronhi Ok, I'll open PR. |
Thanks! Maybe you are right and a 3 values variable is clearer. Since I don't know how to conduct a survey, and we need to update the README.md anyway, it's totally fine by me :) And if you discover along the way that that solution has some unforeseen complications, the other solution is fine too. |
* moved description files into realsense2_description package * updated references to realsense2_description * changed install to single block * Add option to use external nodelet manager Right now a nodelet manager is always created when running the realsense node. This is not always a wanted behaviour as a nodelet manager might already be running somewhere else in the ROS system. This patch adds a parameter to disable launching a new nodelet manager. In this case the nodelet manager must be provided using the manager arg. The new parameter is set to false by default, so existing behaviour is not changed. * Register dynamic options in parent node handle If running in an external nodelet manager this makes sure dynamic options are in the right namespace. This does not change existing behaviour. * Remove copied version of ddynamic_reconfigure * Migrate to https://github.com/pal-robotics/ddynamic_reconfigure * Add rule to install ddynamic_reconfigure * Update README.md * fixed bug: wrong frame_id for imu frames. (IntelRealSense#784) * Remove copied version of ddynamic_reconfigure * Migrate to https://github.com/pal-robotics/ddynamic_reconfigure * update README.md to include realsense2_description * exit node if failed to initialize. * update version to 2.2.5 * Add accel test * add rs_rtabmap.launch * Add test for accel in d435i. Needs recorded file: 20190527_D435i.bag * add d435i accel unit-test * Added ddynamic_reconfigure installation note (IntelRealSense#795) * fix remarks to imu test * fixed README.md file. * add librealsense2.rdmanifest file * update version to 2.2.6 * add librealsense2 dependency * disable static_tf_1 test - not working on Travis. Modified points_cloud_1 test - make more robust * rename librealsense2.rdmanifest to librealsense2_xenial.rdmanifest add file: librealsense2_bionic.rdmanifest * publish imu_info * Fix empty cmake variable and dependency on librealsense (IntelRealSense#747) * update apt-key for ROS repos. * update apt-key for ROS repos. * add external_manager option to rs_camera.launch * enable reaquire tag whan launching node * clarify installation process. * Add option to use external nodelet manager Right now a nodelet manager is always created when running the realsense node. This is not always a wanted behaviour as a nodelet manager might already be running somewhere else in the ROS system. This patch adds a parameter to disable launching a new nodelet manager. In this case the nodelet manager must be provided using the manager arg. The new parameter is set to false by default, so existing behaviour is not changed. * Register dynamic options in parent node handle If running in an external nodelet manager this makes sure dynamic options are in the right namespace. This does not change existing behaviour. * Fix empty cmake variable and dependency on librealsense (IntelRealSense#747) * add external_manager option to rs_camera.launch * clarify installation process. * publish gyro/imu_info and accel/imu_info only once. * Make T265 less noisy in the info log (IntelRealSense#823) * cleaning * Updated README to include notice of running multiple T265 cameras not being currently supported (IntelRealSense#834) * fixed bug: advertise unsupported streams. (IntelRealSense#811) * fixed bug: advertise unsupported streams. * constraints on accel_up test - loosen up a bit to compensate for different in frames arriving from file. * publish imu_info (IntelRealSense#809) * publish imu_info * update apt-key for ROS repos. * Add option to use external nodelet manager * Register dynamic options in parent node handle * Fix empty cmake variable and dependency on librealsense (IntelRealSense#747) * add external_manager option to rs_camera.launch * clarify installation process. * publish gyro/imu_info and accel/imu_info only once. * cleaning * move ddynamic_reconfigure settings to before start streaming. (IntelRealSense#843) * Add support for SR305 (IntelRealSense#844) fix bug in scaling depth. * update version to 2.2.7 * Dependency on xacro missing. * fix bug: filters do not show in rqt_reconfigure. (IntelRealSense#858) * add asic temperature and projector temperature to diagnostics topic. (IntelRealSense#878) * add asic temperature and projector temperature to diagnostics topic. * fix bug relating reading from file. * set auto_exposure ROI. (IntelRealSense#883) * Add the ability to set auto_exposure ROI. Available using dynamic reconfigure parameters or by setting the following to the launch file: <rosparam> /camera/rgb_camera/auto_exposure_roi/right: 250 /camera/stereo_module/auto_exposure_roi/top: 50 </rosparam> * Check temperature freqency (IntelRealSense#884) Add the ability to set auto_exposure ROI. Available using dynamic reconfigure parameters or by setting the following to the launch file: <rosparam> /camera/rgb_camera/auto_exposure_roi/right: 250 /camera/stereo_module/auto_exposure_roi/top: 50 </rosparam> * update temperature checks to once every 10 seconds. * upgrade version: 2.2.8 * fix issue: node crash when device disconnects. * Add option to disable odom tf to be published This is useful if you want to link your camera to your existing robot tf tree. tf can not handle two parents for the camera_pose_frame * Add option to disable odom tf * Add dynamic transform support again. IntelRealSense#169 IntelRealSense#660 * force infrared stream to choose stable Y8 format. * add publish_tf and tf_publish_rate to README.md fixed print. * added support for multiple cameras * Allow to use usb port number to connect to devices * use regex to parse usb description string. handle cases where failed to extract usb bus and port. * Add device_type option to choose the device type using regular expression. * update README.md regarding port_no and device_type options. * renamed porn_no to usb_port_id * update README.md regarding usb_port_id * Update opensource_tracking.launch Fixed a wrong parameter in imufiltermadgwick * set serial number in diagnostics when running from bag file * upgrade version: 2.2.9
Fixes Issue: #120
Due to a ROS bug which prevents publishing more than one static
transform in separate processes, enable the use of dynamic
camera transforms when needed for multiple camera support.
Static transforms are still the default.
See:
ros/ros_comm#146
ros/geometry2#181