# Error viewing map in RVIZ

I have a map in one of my directories.

I used the map server node to provide the map. But in rviz, when I set my fixed frame to: summit_xl_a_odom (which is the odom frame of my robot) and map frame to /map (the frame which I used to create the map), I get the error in the map display as no transform (and thus cannot see my map in rviz).

I realize that there is no connection between the 2 in tf tree.

I have actually created the map using gmapping from the same fixed frame: summit_xl_a_odom. How can I get the map to be displayed in rviz?

(I guess connecting the two frames in tf would be sufficient but for using static_transform_publisher I don't know the values to provide)

The error that I get is:

No transform from [map] to [summit_xl_a_odom]

edit retag close merge delete

Could I ask you to please use some whitespace, punctuation and proper markup? Your question was a wall of text which made it very difficult to read.

I've done it for you this time, but please keep it in mind for your next question.

( 2020-02-02 10:08:05 -0500 )edit

Sorry, I will be careful from next time, any help with the question?

( 2020-02-02 22:41:17 -0500 )edit

I would have no idea.

Let's see whether other forum members can help.

( 2020-02-03 02:27:41 -0500 )edit

Sort by » oldest newest most voted

The actual transform would depend on where the origin of the map frame is relative to the robot. That is something that would not really be doable in the end with a static transform, unless you always start your robot in the same place and in the same orientation.

To verify that the map is being published you could try setting the fixed frame in rviz to map, if the option does not appear in the dropdown list just type it in there, if the map is being published and you have it visualized in the rviz config it should show up.

Next you could try giving a static transform between the map frame and your odom frame. Without knowing anything about the map and odom frames I would just start with a transform that would set the odom frame to be in the origin of the map frame and see how it looks. You can read more about the static transform publisher from the ros wiki. With the frames you have given the command would be something like this:

rosrun tf static_transform_publisher 0.0 0.0 0.0 0.0 0.0 0.0 map summit_xl_a_odom 100

To verify that this transform is published you could run roscore and the previous command and run rosrun rqt_tf_tree rqt_tf_tree from another terminal. There are various other tools to debug tfs like rosrun tf tf_echo /frame_id /other_frame_id

For debugging you could figure out the correct transform based on some fixed heading and location in your testing area to your map and always start your robot there.

In the end the transform between map and odom would be published by some node that would calculate the transform based on some logic. One option for such a node is https://github.com/cra-ros-pkg/robot_... . Getting the robot localization node running properly requires quite a bit of work and trial and error. The documentation for the mentioned node is here.

more

Thanks a lot, I now could figure out what exactly happens during localization

( 2020-02-14 05:18:19 -0500 )edit