Skip to content
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

Merged
merged 2 commits into from
Dec 17, 2016

Conversation

mdhorn
Copy link

@mdhorn mdhorn commented Dec 17, 2016

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

@mdhorn mdhorn self-assigned this Dec 17, 2016
@mdhorn mdhorn force-pushed the tf-back-to-dynamic branch from 3de83ad to ffacb7c Compare December 17, 2016 18:07
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
@mdhorn mdhorn force-pushed the tf-back-to-dynamic branch from ffacb7c to e2cf09c Compare December 17, 2016 18:15
Copy link

@mkhansenbot mkhansenbot left a 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)

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

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?

@mdhorn mdhorn requested a review from kevincwells December 17, 2016 21:12
Copy link

@kevincwells kevincwells left a 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.

@mdhorn mdhorn changed the title Switch to Dynamic Transforms for default Add Dynamic Transforms support -- multi-cam Dec 17, 2016
@mdhorn mdhorn merged commit 334d967 into IntelRealSense:indigo-devel Dec 17, 2016
@mdhorn mdhorn deleted the tf-back-to-dynamic branch December 17, 2016 23:31
severin-lemaignan added a commit to freeplay-sandbox/core that referenced this pull request Mar 21, 2017
// Publish transforms for the cameras
ROS_INFO_STREAM(nodelet_name_ << " - Publishing camera transforms (/tf)");

ros::Rate loop_rate(1);
Copy link

@severin-lemaignan severin-lemaignan Mar 24, 2017

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

Copy link
Author

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

@doronhi
Copy link
Contributor

doronhi commented Jun 30, 2019

@pavloblindnology , Somehow, until very recently I remained unaware of your work.
Would you like to open a new PR so it can be merged?
I would also like to add the publish_tf flag again, as was implemented here
The issue was referenced again at #9.
What do you think?

@pavloblindnology
Copy link
Contributor

@doronhi Ok, I'll open PR.
AFAIU, enable_tf is intended to turn off TF generation at all (either static or dynamic), while tf_dynamic is used to switch between static and dynamic. Correct?
May I suggest to introduce a single variable, like tf_generation which can have 3 values: off, static, dynamic. This would get rid of all the mess with having 2 variables with unclear meaning (enable_tf, publish_tf).

@doronhi
Copy link
Contributor

doronhi commented Jul 1, 2019

Thanks!
I think enable_tf was already deleted. The last state was to have publish_tf which meant, well, to publish tf, and tf_dynamic which, if set to true, would cause the sending the dynamic_tf instead of the static_tf.

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.

sumandeepb pushed a commit to rapyuta-robotics/realsense that referenced this pull request Dec 12, 2019
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants