UZ-SLAMLab / ORB_SLAM3

ORB-SLAM3: An Accurate Open-Source Library for Visual, Visual-Inertial and Multi-Map SLAM
GNU General Public License v3.0
6.45k stars 2.53k forks source link

ROS topics for output #287

Open stephenmcc opened 3 years ago

stephenmcc commented 3 years ago

There don't appear to be any ROS output topics for the estimated pose or map, at least for the default settings. It'd be helpful if those could be added in.

pinkfloydfan commented 3 years ago

Hi,

I've partially solved this myself. Kindly refer to my fork of ORB SLAM3 here. I've only done it for the inertial node, however I imagine it'll be similar for the other nodes.

The ImageGrabber class will have a method called to mpSLAM->TrackMonocular which will return a transformation matrix. By default the return variable is not stored, modify ImageGrabber to contain a ros::Publisher and use it to publish pose. It seems older versions of ORB SLAM2 also had the same issue, and I followed the gist of this article to make the appropriate modifications. One thing you have to do is change ORB_SLAM2::Converter::toQuaternion to ORB_SLAM3::Converter::toQuaternion.

Hope this helps.

stephenmcc commented 3 years ago

@pinkfloydfan Appreciate the info, I was able to publish a ROS transform from that TrackMonocular method. However I'm seeing that the axes are: +x when camera moves left, +y when camera moves up, and +z when camera moves backward. This seems odd since this appears to be a left handed coordinate frame, and that +z usually means forward motion.The pangolin window is showing that the SLAM is doing a good job though, so it isn't estimating incorrectly. Any thoughts?

pinkfloydfan commented 3 years ago

@stephenmcc In the pose estimate I'm getting, +z is forwards, -z is backwards, -y is up, +y is down, -x is left, +x is right. Are you using mono-inertial? It might be worth checking the Tbc matrix in the configuration yaml file, which is the transfrom from body coordinates to camera coordinates. Did you use Kalibr or a similar tool?

stephenmcc commented 3 years ago

I just needed to invert the transform that TrackMonocular returned, which I realized after checking your fork. Really appreciate the help!

sampath-ogmen commented 11 months ago

@stephenmcc , would you give us some clue how we can do that , I am using orbslam3 but my robot was moving on upward direction