4am-robotics / cob_common

The cob_common stack hosts common packages that are used within the Care-O-bot repository. E.g. utility packages or common message and service definitions etc. Also the urdf desciption of the robot is located in this stack.
https://mojin-robotics.de/
Apache License 2.0
66 stars 136 forks source link

Realsense is not working on simulation #212

Closed ipa-nhg closed 7 years ago

ipa-nhg commented 7 years ago

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:

fmessmer commented 7 years ago

originates from discussion in https://github.com/ipa320/cob_robots/pull/616

fmessmer commented 7 years ago

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?

benmaidel commented 7 years ago

There is no broadcast freq because realsense is using the tf2_ros::StaticTransformBroadcaster.

fmessmer commented 7 years ago

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>