Closed ipa-nhg closed 7 years ago
originates from discussion in https://github.com/ipa320/cob_robots/pull/616
Define 2 separate URDF files for realsense, one for real robot and one for simulation.
We do not have a sim-toggle for urdf
Create a new libgazebo plugin for realsense
Maintenance overkill, as we only would add tf broadcasters within the plugin
The easiest solution is to add static_transform_publisher
within a sim
-toggle within https://github.com/ipa320/cob_robots/blob/indigo_dev/cob_bringup/components/cam3d_r200_rgbd.launch for every frame missing in simulation, like this:
<group if="$(arg sim)">
<node pkg="tf" type="static_transform_publisher" name="stp_rgb_optical_frame" args="0 0 0 0 1.57 0 /camera_link /rgb_optical_frame 100"/>
</group>
@ipa-nhg @ipa-bnm Can you give me a list of the frames broadcasted by the driver with its respective transformation and the parent frame. What's the broadcast frequency of the driver?
There is no broadcast freq because realsense is using the tf2_ros::StaticTransformBroadcaster.
Ok, then we should use tf2 as well :wink:
<group if="$(arg sim)">
<node pkg="tf2_ros" type="static_transform_publisher" name="stp_rgb_optical_frame" args="x y z qx qy qz qw /camera_link /rgb_optical_frame"/>
</group>
On the robot the realsense driver define the tf tree of the camera links (for example rgb_optical_frame) and the urdf file contains only the camera_link.
On the other hand, the simulation ( the libgazebo_ros_openni_kinect plugin) requires an urdf where all the links are defined.
From my point of view we have 2 options: