Ask Your Question
0

Error viewing map in RVIZ

asked 2020-02-01 23:57:51 -0500

hrushi19 gravatar image

updated 2020-02-02 10:06:48 -0500

gvdhoorn gravatar image

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 flag offensive close merge delete

Comments

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.

gvdhoorn gravatar image gvdhoorn  ( 2020-02-02 10:08:05 -0500 )edit

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

hrushi19 gravatar image hrushi19  ( 2020-02-02 22:41:17 -0500 )edit

I would have no idea.

Let's see whether other forum members can help.

gvdhoorn gravatar image gvdhoorn  ( 2020-02-03 02:27:41 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-02-03 03:44:18 -0500

Reamees gravatar image

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.

edit flag offensive delete link more

Comments

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

hrushi19 gravatar image hrushi19  ( 2020-02-14 05:18:19 -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: 2020-02-01 23:57:51 -0500

Seen: 59 times

Last updated: Feb 03