How to set graph-slam edge errors?

102 views
Skip to first unread message

工藤拓

unread,
Jun 16, 2015, 4:11:17 AM6/16/15
to mrpt-...@googlegroups.com
Hi

I'm using graphslam algorithm to optimize maps, and I use this code as reference. "https://github.com/jlblancoc/mrpt/blob/master/samples/graph_slam_demo/test.cpp"
In this code, there is discription like follow.

ed.getPoseMean().x( (1-ERROR_IN_INCOMPATIBLE_EDGE) * ed.getPoseMean().x() );

This function sets up mean of edge,so I think it denotes "amount of shrinking" edges like attached image1.
But as far as I know, edges have mean and covariance(?)  in graphslam(It might be wrong).
If there is no covariance, edges always shrink to mean value set by above function in advance.
But if there is some covariance, edges become something like rubber and it will have margin like image2.
(I am sorry that my explanations is not good.)

I want to know how to set covariance.
Are there some advices?




image1.png
image2.png

Jose Luis Blanco

unread,
Jun 16, 2015, 6:13:39 PM6/16/15
to mrpt-...@googlegroups.com
Sure: In graph-slam, each edge has its own covariance.

Now, in MRPT template-based implementation, you can choose among
different underlying classes for representing edges in a graph. For
example, in the very same example you linked:

https://github.com/jlblancoc/mrpt/blob/master/samples/graph_slam_demo/test.cpp#L306

"1. CNetworkOfPoses2D \n"
"2. CNetworkOfPoses2DInf \n"
"3. CNetworkOfPoses3D \n"
"4. CNetworkOfPoses3DInf

See this page for reference:
http://reference.mrpt.org/svn/classmrpt_1_1graphs_1_1_c_network_of_poses.html
and you will see that some edges have covariance, other do not. The
latter simply assume an identical, constant covariance in ALL edges.
Not very realistic, but much faster to compute.

The example may be cumbersome if you are not familiar with C++
templates, but the covariance is set around line 65:
https://github.com/jlblancoc/mrpt/blob/master/samples/graph_slam_demo/test.cpp#L65

Cheers,
JL
> --
> You received this message because you are subscribed to the Google Groups
> "mrpt-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mrpt-users+...@googlegroups.com.
> To post to this group, send email to mrpt-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/mrpt-users.
> For more options, visit https://groups.google.com/d/optout.



--
___________________________________________________________

Dr. Jose-Luis Blanco-Claraco
CITE-IV 1.05
Universidad de Almería, Departamento de Ingeniería
04120 Almería (Spain)
http://www.ual.es/~jlblanco/
___________________________________________________________

工藤拓

unread,
Jun 16, 2015, 8:16:00 PM6/16/15
to mrpt-...@googlegroups.com
Thanks for your replying.
Let me make a reference.
If I had used intellisense, I might have solve this question by myself. But I couldn't use it only in graphslam region.
I think it's my terrible coding's fault.
Anyway, I appreciate your swift response.

2015年6月17日水曜日 7時13分39秒 UTC+9 Jose Luis Blanco:

工藤拓

unread,
Jun 17, 2015, 11:41:30 AM6/17/15
to mrpt-...@googlegroups.com
I have an additional question.

typename edge_adder_t::cov_t   inf_matrix;

inf_matrix.unit(edge_adder_t::cov_t::RowsAtCompileTime, square(1.0/STD4EDGES_COV_MATRIX));


This code sets covariance matrix.

Is this matrix based on world coordinate system or relative coordinte system of each edges?

And are there any method to set each value of covariance matrix Independently?

I think this function can just set same value in a matrix.



2015年6月17日水曜日 7時13分39秒 UTC+9 Jose Luis Blanco:
Sure: In graph-slam, each edge has its own covariance.

Jose Luis Blanco

unread,
Jun 17, 2015, 5:11:23 PM6/17/15
to mrpt-...@googlegroups.com
> I have an additional question.
>
> typename edge_adder_t::cov_t inf_matrix;
>
> inf_matrix.unit(edge_adder_t::cov_t::RowsAtCompileTime,
> square(1.0/STD4EDGES_COV_MATRIX));
>
> This code sets covariance matrix.
> Is this matrix based on world coordinate system or relative coordinte system
> of each edges?

Relative to each constraint / edge.

> And are there any method to set each value of covariance matrix
> Independently?

inf_matrix in that code is an Information matrix (the INVERSE of the
covariance).
Yes, just use any of the methods provided by the Eigen C++ library, e.g.

inf_matrix.setZero();
inf_matrix(0,0)=1;
inf_matrix(1,1)=2;
inf_matrix(2,2)=3;


JL

工藤拓

unread,
Jun 18, 2015, 12:57:56 AM6/18/15
to mrpt-...@googlegroups.com
Thanks!

2015年6月18日木曜日 6時11分23秒 UTC+9 Jose Luis Blanco:
Reply all
Reply to author
Forward
0 new messages