Skip to content
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

Index out of bounds #8

Open
glhwork opened this issue Nov 28, 2023 · 5 comments
Open

Index out of bounds #8

glhwork opened this issue Nov 28, 2023 · 5 comments

Comments

@glhwork
Copy link

glhwork commented Nov 28, 2023

Thank you for sharing your algorithm!
Now I am trying to run the code in simulation and there are some problems I met,

  1. No graph.g2o file under my $HOME directory originally, but after I launch the graph_dopt.launch for the first time and then STOP (Ctrl+C), a graph.g2o file is generated under my $HOME directory and I have no idea where the graph data is from.
  2. An error occurs at line 239 in scripts/functions.py (i.e., 'FIM = np.float_(x.split(' ')[7:12])') saying 'cannot convert from string to float'. I discover that the last member of the list x.split(' ')[7:12] is a newline character('\n'), then I modify it to [7:11] to bypass this problem.
  3. After problem 2, another error occurs at line 45 in scripts/weighted_pose_graph_class.py saying 'index out of bounds' while assigning values to matrix A. Then I verify that the length of list I is 5, not 6.

I'm blocked by these problems for a while. I'm not sure whether the data generated (graph.g2o) is correct according to my steps. Or perhaps, I made a wrong modification of the code?
Many thanks if any suggestions!!

@bairuofei
Copy link

The graph.g2o comes from slam_karto_g2o node, and then the .g2o file is read by the node assigner for graph Laplacian computation. Everytime you run the slam_karto_g2o node, graph.g2o will be updated. You can reset the path where the .g2o file should be saved by following README. Hope this helps.

@Crystal-Biru
Copy link

Hello @glhwork ! I also encountered problem 2 and problem 3 you mentioned. For problem 3, since the length of list I is 5, how did you modify the code to change the way list I is assigned to matrix A?

@glhwork
Copy link
Author

glhwork commented Apr 9, 2024

Hello @glhwork ! I also encountered problem 2 and problem 3 you mentioned. For problem 3, since the length of list I is 5, how did you modify the code to change the way list I is assigned to matrix A?

@Crystal-Biru Sorry, this problem still remains unsolved for me. I'm now working on other projects and will get back to this after a few months.

@JulioPlaced
Copy link
Owner

JulioPlaced commented Apr 11, 2024

Hello! As @bairuofei explained, the .g2o file comes from the SLAM algorithm (open_karto). It saves this file in the desired path.

Then, the .g2o (which contains information about the pose-graph) is parsed to recover the poses and uncertainties associated using this wrapper.

To debug error number 2, the first step is to look at the .g2o file, as the error says it cannot recover the Fisher information matrix (see here). Lines of type "EDGE_SE2" in this file should have the following items:

EDGE_SE2 id1, id2, edge_type, x, y, z, cov_xx, cov_xy, cov_xz, cov_yy, cov_yz, cov_zz

This is written by g2o (see here and here). The covariance is encoded by the upper triangular part.

Please, paste the .g2o content to further debug this problem.

@glhwork, error number 3 is related to the workaround you made to bypass error number 2 -- you shrinked the Information matrix upper triangular part from 6 to 5 elements.

@glhwork
Copy link
Author

glhwork commented Apr 11, 2024

@JulioPlaced I understand! You're right, problem-3 is caused by my modifications of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants