Transforming Camera Coordinate frame with respect to Base coordinate frame

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

Transforming Camera Coordinate frame with respect to Base coordinate frame

lmelvix
Transforming Camera Frame to Base Frame
We have mounted Kinect on top of Create2 and using RTABMap and MoveBase for SLAM and motion planning. RTABMAP uses transforms from both the Base odometry and Visual odometry from Kinect to and localize itself.
 
However, we notice that camera coordinate frame is not correctly transformed with respect to base coordinate frame. As a result the depth cloud input is translated to a location to the bottom left of the robot's position as a thereby not able to plan the path around the obstacle correctly.
 
Below are the Rviz and RTABMap screenshots the map generated with respect to robot position here. Notice that the map is tilted with respect to the position.
 
I understand that I have to do a static transform of the camera coordinate with respect to base coordinate. But not sure what should be the parent and child frames : I tried making base_link as the parent to camera_link but it doesn't seem to help. Other combinations only seem to throw errors.
 
Here are my transform graphs and rqt graphs of system :
rosgraph.png : rosgraph.png
frames.pdf : frames.pdf
 
Can you please clarify what should be the expected static transform to correct my camera coordinate frame?

I am getting the following warnings in RTABMap :
[ WARN] [1480877486.360197583]: rtabmapviz: Could not get transform from odom to camera_link after 0.200000 seconds (for stamp=1480877485.831546)!
[ WARN] [1480877486.360427640]: rtabmap: Could not get transform from odom to camera_link after 0.200000 seconds (for stamp=1480877485.831546)!
[ WARN] [1480877486.360561596]: Could not get odometry value for depth image 0 stamp (1480877485.831546s). Latest odometry stamp is 1480877485.789768s. The depth image pose will not be synchronized with odometry.

And the following in MoveBase:
[ WARN] [1480877727.426664212]: Map update loop missed its desired rate of 1.0000Hz... the loop actually took 1.0012 seconds






P.S : Sorry about the long post. Would really appreciate any quick fix help that you can provide us. This is for a coursework project deadline that is coming up shortly. And we are almost there. Just need a little nudge and pinch of luck ! :)
with regards
Lenord Melvix
lmelvix@ucsd.edu
Reply | Threaded
Open this post in threaded view
|

Re: Transforming Camera Coordinate frame with respect to Base coordinate frame

matlabbe
Administrator
Hi,

You cannot use both wheel odometry and visual odometry at the same time. Use only one or merge them using robot_localization package to create a single odometry output.

Well, as /ca_driver is publishing already odometry, you don't need rgbd_odometry node. Connect /odom to rtabmap directly and set frame_id to base_footprint. You should indeed connect /camera_link to /base_link so that rtabmap knows how to transform images into base_footprint frame. Example:
$ rosrun tf static_transform_publisher 0 0 0.1 0 0 0 base_link camera_link 100
if the camera is directly 10 cm over the base_link. You can change also the rotation if the camera is not facing perfectly forward. Your rosgraph should look something like this: /map -> /odom -> /base_footprint -> /base_link -> /camera_link

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

Re: Transforming Camera Coordinate frame with respect to Base coordinate frame

lmelvix
Thanks Mathieu. That fixed my issue.

with regards
Lenord Melvix
lmelvix@ucsd.edu
with regards
Lenord Melvix
lmelvix@ucsd.edu