openvslam icon indicating copy to clipboard operation
openvslam copied to clipboard

acess key points value

Open roboticsai opened this issue 5 years ago • 4 comments

I am trying to modify the slam and localization code so that i can remove the pangolin and socket viewer and instead use ros pointcloud2 data type to integrate openvslam properly in ros1. But neither i saw the api documentation of openvslam nor any proper method how to do it i.e retrieve the x,y,z value of every key points calculated in the process of slam and localization. So can anyone tell me what is the class or function which can be used to retrieve the x,y,z value of every key points extracted during slam and localization process?

roboticsai avatar Sep 23 '20 05:09 roboticsai

It looks like this function needs a static map already created by openv slam process. What is the method which can access the landmark in real time i.e while running the slam process itself. Because my goal is to access those landmarks in real time while openvslam slam process runs and publish them as sensor_msgs/PointCloud2 ros data type. And also it looks their is no API documentation for openvslam. How are developers going to use openvslam functions in this way?

roboticsai avatar Sep 23 '20 06:09 roboticsai

I believe the function you're looking for is this one:

https://github.com/xdspacelab/openvslam/blob/29435e14513a437719952ba916e5994e71ea6e55/src/openvslam/data/landmark.cc#L30

(Sorry, I deleted by mistake). So, this function can be called even during the process. It will return whatever map points are created by that time.

mirellameelo avatar Sep 23 '20 06:09 mirellameelo

Thanks. I'll try it.

roboticsai avatar Sep 23 '20 06:09 roboticsai

@roboticsai In this file, and in this specific commit, you can find an example of publishing odometry and point cloud during the slam process. EDIT: In this case, I'm using get_local_landmarks(), not get_all_landmarks() as you can see here, but the data type is the same.

(It works for ros2, but I believe it can help you...)

mirellameelo avatar Sep 23 '20 06:09 mirellameelo