Wrong depthcloud orientation

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Wrong depthcloud orientation

TamirEll
HI Matlabbe,
I integrated my sensor and now getting pretty nice results! thanks for your support so far.
There's one more issue I couldn't solve yet - my depth cloud default orientation is wrong for some reason.
I am running RTAB with Realsense with the same parameters.
Real sense depth cloud orientation looks ok:


While, when using my sensor, it seems like the depth data is appears to be on the 'Y' axis:



How can I change the orientation of the point cloud? shouldn't it always be presented on the 'Z' axis?
Any help is greatly appreciated.

Thanks,
Tamir.
Reply | Threaded
Open this post in threaded view
|

Re: Wrong depthcloud orientation

matlabbe
Administrator
Hi Tamir,

Are RGB and depth topics on the same frame_id? Normally if depth image is registered to rgb camera, it shoul have the same frame_id than the rgb camera.

Afterwards, when the camera is looking upward (along z-axis), it means that a static transform is missing between the based of the robot/camera (e.g., base_link) and the optical lens (the frame set in image topics).  

Which realsense are you using? You may look at this tutorial to set the right frame_id: http://wiki.ros.org/rtabmap_ros/Tutorials/HandHeldMapping

Otherwise, an optical rotation transform would look like this:
<arg name="pi/2" value="1.5707963267948966" />
<node pkg="tf" type="static_transform_publisher" name="camera_base_link"
     args="0 0 0 -$(arg pi/2) 0 -$(arg pi/2) base_link camera_link 100" /> 
then use base_link as frame_id in rtabmap.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Wrong depthcloud orientation

TamirEll
Hi Mathieu,
I tried adding:
<arg name="pi/2" value="1.5707963267948966" />
<node pkg="tf" type="static_transform_publisher" name="camera_base_link"
     args="0 0 0 -$(arg pi/2) 0 -$(arg pi/2) base_link camera_link 100" /> 

to the launch file - I didn't see any changes.
Also, I tried running on a separate terminal:
rosrun tf static_transform_publisher 0 0.00 0 -1.571 0 -1.571 base_link camera_link 100

My topics(registered depth, RGB and camera info) are all publishing on the same frame id: camera_link
I tried changing the frame id to base_link which also didn't help.

here is my graph:

what am I missing here?

Best regards,
Tamir.
Reply | Threaded
Open this post in threaded view
|

Re: Wrong depthcloud orientation

matlabbe
Administrator
Can you show the TF tree, with a screenshot in RVIZ too?
rosrun tf view_frames

EDIT: Can you also specify explicitly the topic names your were visualizing?
Reply | Threaded
Open this post in threaded view
|

Re: Wrong depthcloud orientation

TamirEll
HI Matthieu,
Sorry for the late response.
TF tree:


 I wasn't sure which topic names you are referring to, I'm displaying the 'Mapcloud' which listens to: rtabmap/mapData:


Thanks for your support!
Best,
Tamir.
Reply | Threaded
Open this post in threaded view
|

Re: Wrong depthcloud orientation

TACD
In reply to this post by TamirEll
Hi,

It looks like you're having the same issue as us; if not already resolved, I suggest adding a "_optical" suffix frame to your cameras to follow the convention described in REP 103.