rtabmap_ros
rtabmap_ros copied to clipboard
pointcloud orientation issue
Hi,
I'm trying to simulate a diff drive robot with a realsense D435i in gazebo. The mapping works, but the pointcloud is displayed pointing upwards.
There is no point in moving the camera link, because all the cameras are pointing forward already. The imu doesn't affect the pointcloud, because if I remove the imu sensor the pointcloud is the same.
Rtabmap doesn't show any relevant error messages.
I don't know what files to include that might help resolve the problem, if someone asks me to I will upload the given file.
Hi,
What is strange to me is that base_link
is not the parent frame of the camera. Normally, you would have /map -> odom -> base_link -> camera_base ....
The frame_id
you set for rgbd_odometry
and rtabmap
should be base_link
, assuming you fix the urdf to have base_link
the parent of all frames on the robot.
Try fixing your TF tree to see if it helps, otherwise it would be that the frame set in image topics is wrong, or an optical rotation is needed between camera_base
and camera_link
. What is the frame set in camera topics?
Hi i also have the same issue. I just curious what may cause the point cloud transformation to change? Does it is transformed according to the published tf
topic? or robot_description
? or else?
Edit
It seems the rtabmap_ros is using the tf
topic for the camera transformation. And for some reasons (either i set the tf
wrongly or the conversion is invalid), the transformation does not rotate, that's why it's pointed upward. I fix this issue by trickily modify the following code in the convertRGBDMsgs
function:
+rtabmap::Transform newTransform(
+ localTransform.z(), localTransform.x(), localTransform.y(),
+ -1.5708, 0.0, -1.5708);
+
-cameraModels.push_back(rtabmap_ros::cameraModelFromROS(cameraInfoMsgs[i], localTransform));
+cameraModels.push_back(rtabmap_ros::cameraModelFromROS(cameraInfoMsgs[i], newTransform));
The wrong frame_id may be set in the topic.
I also had this problem. It solved by adding dummy frame with this transformation:
<joint name="camera_optical_joint" type="fixed">
<origin xyz="0 0 0" rpy="-1.5707 0 -1.5707"/>
<parent link="camera_frame"/>
<child link="camera_optical_frame"/>
</joint>
<link name="camera_optical_frame"/>