BlazingForests / realsense_camera

use realsense camera in ROS
Other
36 stars 26 forks source link

RVIZ Transform Issue Base_link and Camera_link #26

Open TonderaiZR opened 7 years ago

TonderaiZR commented 7 years ago

I am working on a differential drive robot with two motor wheels with encoders and caster wheels. The robot also has a intel realsense depth camera.

When I launch RVIZ : Thee Global option > Fixed frame is set to Base_link and shows all the transforms for the differential driver nodes. But an error appears for the realsense Depth camera nodes with message saying :

No transform from Camera_depth_frame to baselink

No transform from Camera_depth_optical_frame to baselink

No transform from Camera_link to baselink

No transform from Camera_rgb_frame to baselink

If I change the Global option > fixed frame to Camera_link I can see all the transforms for the real sense depth camera but now the differential drive transforms are now not available

sthoduka commented 7 years ago

you need to specify the location of the camera w.r.t base link somewhere. Either as a static transform (see realsense_frames.launch for examples) or in your urdf file.

TonderaiZR commented 7 years ago

Ok. When I launch realsense realsense_frames.launch is launched. Could this be affecting the urdf link from my model? Would this be in realsense cpp code or urdf, If in urdf can you supply me with some pseudo code. Realsense does not have a urdf to edit right ?

sthoduka commented 7 years ago

Currently the realsense_frame.launch file only specifies transforms of the rgb/depth frames and the corresponding optical frames with respect to the camera_link.

If you want to also add the transform between camera_link and base_link, you can add another node to the launch file that's something like this:

<node pkg="tf" type="static_transform_publisher" name="$(arg camera)_base_link0" args="0 0 0 0 0 0 base_link $(arg tf_prefix)/$(arg camera)_link 100" />

and replace the 0's in the argument with x, y, z, yaw, pitch, roll.

TonderaiZR commented 7 years ago

Hello

So the zeros would be the position of the camera. In relation to the baselink right?