ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org
Ask Your Question
2

RViz & amcl - fixed_frame mismatch for initialpose

asked 2017-08-09 16:48:17 -0500

jayess gravatar image

updated 2017-08-09 17:23:22 -0500

I have a multi-robot system (two robots, for now) in which each is pushed into a namespace (/robot1 and /robot2) using Jakub's answer on how to setup a mulit-robot system (which I updated for Indigo and use the Pioneer 3dx instead of the turtlebot).

Most everything is working fine except for when I try to set the inital pose manually for amcl using RViz. I set the fixed_frame to be /map which is what both robots (and amcl for both) are using. amcl is subscribed to /robot1/initialpose for one robot and /robot2/initialpose for the other so, using the Tool Properties in RViz I set the topic for the 2D Pose Estimate to be /robot1/initialpose.

When I attempt to set the pose from RViz I get the following warning from amcl:

Ignoring initial pose in frame "map"; initial poses must be in the global frame, "/map"

This warning comes up despite the fact that I set /map as the fixed_frame in RViz. When I echo the topic and set the pose, I get this:

header: 
  seq: 0
  stamp: 
    secs: 282
    nsecs: 751000000
  frame_id: map
pose: 
  pose: 
    position: 
      x: 25.1116027832
      y: 51.6672058105
      z: 0.0
    orientation: 
      x: 0.0
      y: 0.0
      z: -0.827484384125
      w: 0.561488730099
  covariance: [0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.06853891945200942]

which results in the above error (note the frame_id of map without a /). However, if I publish the same message myself but with a frame_id of /map instead of map I get the following output from amcl:

Setting pose (408.542000): 25.112 51.667 -1.949

How do I change thefixed_frame for the initialpose or am I missing sometheing here? Is it a bug?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2017-08-10 03:36:09 -0500

Sebastian Kasperski gravatar image

The problem seems to be, that RVIZ removes any leading '/' from the fixed_frame (you actually see it in the GUI), which doesn't look right to me. Can you set amcl to use the "map" frame without the leading '/'?

edit flag offensive delete link more

Comments

Your solution worked. I find some parts of the namespacing to be a little confusing and this is one area where that showed. I thought that I had to have the / prepended to the beginning of the frame_id. Looks like I was wrong.

jayess gravatar imagejayess ( 2017-08-10 13:20:53 -0500 )edit

Hi, I followed the tutorial too and got the same problem. I set amcl to use the "map" frame without the leading '/' as the suggestion of @Sebastian and there was no error or warning message in output. However, the robot's position in rviz remain unchanged. Could you help me deal with this? Thanks!

nightwish gravatar imagenightwish ( 2018-06-19 10:13:41 -0500 )edit

@nightwish please create a new question and reference this question.

jayess gravatar imagejayess ( 2018-06-19 11:10:59 -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: 2017-08-09 16:48:17 -0500

Seen: 172 times

Last updated: Aug 10 '17