Ask Your Question
0

Unity Scene not updating nodes' transforms correctly from mapData

asked 2021-04-11 17:20:08 -0500

justastudent gravatar image

updated 2021-04-14 14:57:35 -0500

I am currently working on a project on mapping a remote environment using a robot and reconstructing it as a Unity scene. To generate the cloud_map, I am sending /rtabmap/mapData over ROS-Sharp and creating a mesh for each node in mapData.nodes. For every mapData message I receive, I update each node's position and rotation by setting the transform of nodes[i]'s mesh = mapData.graph.poses[id]. However, it seems like the nodes are not being positioned correctly in the Unity scene (whereas it seems mostly correct in RViz).

In MapCloudDisplay.cpp, updating the transform of each node's mesh seems more complicated then simply just setting the transform = mapData.graph.poses[id]. Might this be where things went wrong? Also, what is the difference between nodes[id].pose and graph.poses[id]?

I should also note that I did not use any node filtering in the Unity scene (I also disabled node filtering radius and angle in the RViz scene).

Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-05-03 20:02:25 -0500

matlabbe gravatar image

updated 2021-05-03 20:03:02 -0500

In MapCloudDisplay, every time we receive a new graph, we also update poses of all clouds created so far. This is because when a loop closure happen, the graph may be deformed to correct the odometry drift. If you only update the last cloud added to map, you won't have map corrections in your map.

  • nodes[id].pose: raw odometry pose
  • graph.poses[id]: optimized pose (including loop closure correction)
edit flag offensive delete link more

Comments

For each mapData message received, I update every node's pose using graph.poses. Could it be that MapCloudDisplay discards or filters out certain nodes?

justastudent gravatar image justastudent  ( 2021-05-07 08:29:52 -0500 )edit

If a pose is not in the graph poses anymore, the corresponding cloud is hidden.

matlabbe gravatar image matlabbe  ( 2021-05-07 16:30:23 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-04-11 17:20:08 -0500

Seen: 21 times

Last updated: May 03