New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pose covariance from mapping missing #98
Comments
any news about this? |
Echo topic $ rostopic echo /rtabmap/localization_pose This topic is published only when a graph optimization is done (e.g., on loop closures). See: rtabmap/corelib/src/Rtabmap.cpp Line 2857 in 356094f
g2oIf rtabmap is using g2o for graph optimization ( rtabmap/corelib/src/optimizer/OptimizerG2O.cpp Line 1043 in 356094f
for 3D rtabmap/corelib/src/optimizer/OptimizerG2O.cpp Line 1127 in 356094f
GTSAMIf rtabmap is using GTSAM for graph optimization ( rtabmap/corelib/src/optimizer/OptimizerGTSAM.cpp Lines 662 to 663 in 356094f
NoteThis is experimental, we don't have projects using this info, so it is not tested. In practice, sometimes marginals cannot be computed, a warning is then shown on terminal. Depending on what you need, the odometry should already provide a covariance (though it would increase out of bound). cheers, |
ok, yeah I've seen that. Is that the covariance of the last position/node of the graph? what if I want that for each one of the nodes? is it possible? |
It is the marginal of the last node. GTSAM seems computing by default the marginals of all nodes. For g2o, it is computed only for last node, not sure if it would be efficient to do it for all nodes with how it is currently done in rtabmap (see links of my previous post). To expose this info, we would need to check if there is an overhead to do this (not seem the case for GTSAM as they are all computed already) and if this is a really useful information for you. You may hard-code an export of the marginals when it happens and see if this is the kind of covariance you need. If it can be useful, we could check how to propagate this information up with the poses, so that we can publish on ROS a graph of poses with those covariances. Another way to see if it could work is to export the graph in g2o format (File->Export poses...) in rtabmap, then import to g2o tools to play with it. cheers, |
Ok, perfect. I'll peek into this probably next week. I'll keep you posted, maybe will do that with GTSAM (currently I'm working with g2o). I've also the odom topic but the covariance is crazily high and fixed. We have a RS200 and a laser scanner, doing visual odometry and would like to have the covariance of the current robot position... Working on gazebo simulation I have also some other issues right now. Another one is the clearing of obstacles in 2D/3D that is not really working for me. In 2D is just fine(even if slow) unless I save the map. In this latter case every time I relocalize myself the objects re-appears.. As for the 3D map I don't think there are already filtering/cleaning methods for previously constructed clouds right? [Solved using RGBD/LocalRadius] There are "local closures" (yellows matches on rtabviz) that go very far with respect to where the robot is localized (even a couple of meter). The localization pose covariance is good, the map is not being distorted by that but still it happens. I've attached my launch file In the pic there's everything I am saying. |
Hi, With a lidar, use The yellow lines are proximity detections using the lidar. cheers, |
Reg/Strategy=2 shouldn't use both Visual+ICP registration? we're doing visual odometry so I don't get why you say that I should set 1... I've checked the source code of gtsam(here an example) and g2o and both should compute the marginals for all the nodes so for that I should be good. I'll peek more next week.. Yup RGBD/LocalRadius solved my problem. I'll try your other suggestion thanks a lot. Regarding walls/odometry/cleaning obstacles problems do you have any suggestion? Best, |
For info about
Not sure to see the fake walls problem. Normally in gazebo the position between the sensors should be accurate. Is this happening only when rotating fast? Your
re-appears on the occupancy grid For g2o marginals, the computeMarginals() function returns a boolean, we would need then to find the function to get the computed marginal for a specified node. The marginals are computed by the solver here, I think the To propagate the covariances, I think the best would be to modify the API: rtabmap/corelib/include/rtabmap/core/Optimizer.h Lines 124 to 131 in f9e818c
or add this new implementation: virtual std::map<int, Transform> optimize(
int rootId,
const std::map<int, Transform> & poses,
const std::multimap<int, Link> & constraints,
const std::map<cv::Mat> & outputCovariances,
std::list<std::map<int, Transform> > * intermediateGraphes = 0,
double * finalError = 0,
int * iterationsDone = 0); where cheers, |
Maybe a synchronization issue between odometry and the sensors. Do you have the database to share? We can do ray tracing in 3D too. This is done by enabling |
Here the database https://we.tl/t-Nv3DVyEomh In rviz odom frame is fixed (where map frame is) while everything else moves. The parameters you are suggesting are already set as you say but these three problems(walls [that I suppose it's related to the simulation], odom, and obstacles [sorry couldn't find time to do a video for you today]) remains.. Thanks a lot for your patience :) |
Ok. Yes I have a gpu I can enable it I think.. |
For the covariance in odometry topic, it is related to gazebo's odometry plugin you are using, which may just set it to a fixed value. |
Isn't that the odometry of the visual odometry system? |
In your TF tree, |
Nope I want visual odometry 😅😅 Ok, solved I simply missed the node. Added that and the reset odom after 10 tries everything works. |
The problem for the camera I think that's related to the gazebo_realsense_plugin that publish every 5/6 Hz (not/compressed data) while the laser is publishing at 20. |
I checked and it's a simulation problem. When the gazebo_realsense is alone it's publishing at 60 Hz when I place the env in gazebo drops down to 5/6 |
So I've peeked into this:
And I've tried to edit both the source code of g2o (block_solver.hpp lines 489-498 that is different from the one you've linked) and rtabmap (OptimizerG2O.cpp).
being blockIndices 1 you have only the last 6x6 matrix. Moreover, sometime computeMarginals is called twice.
And next loop closure
I haven't looked at that yet but to associate these matrices to the right node is there an easy way? |
When a new node is added to the graph do you set an uncertainty for it? Or are there any other point where the previous nodes uncertainty is updated? |
Moreover I think that with gazebo there is some delay between the action and the transmission of the tf transformation and this effects especially the rotational movements. |
RTAB-Map doesn't keep track of the accumulated pose covariance over time, neither output a covariance for the latest pose (with graph optimization). Well, I think this covariance could be computed as old node accumulated covariance x the loop closure covariance.
Note that if the map is optimized from the end (current pose), the current node covariance would be ~null, while farther nodes would have higher covariance. In a multi-session setup and where some parts of the map are not available during graph optimization, would we need to send new covariances from the graph optimization along the raw covariances in the published graph? That way we could recompute current covariance for each node while the graph is modified.
At the same time, pose covariance (not twist) of the odometry should increase over time the same way.
From this post: http://official-rtab-map-forum.206.s1.nabble.com/Camera-Pose-with-Covariance-td1555.html
The text was updated successfully, but these errors were encountered: