ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Why is my AMCL node closing when I try to set the use_map_topic parameter?

asked 2020-11-26 02:33:55 -0500

BesterJester gravatar image

updated 2020-11-26 02:34:49 -0500

PROBLEM: I can't get my AMCL node to keep running when I subscribe it to my /map topic by setting the use_map_topic parameter to true.

I first start publishing my map.yaml information using the below command:

rosrun map_server map_server map.yaml`

I then use rostopic list to verify that the topics /map and /map_metadata are publishing, which they are. I next start my amcl node using the below command:

rosrun amcl amcl

The amcl node starts up, as expected, and prints the below information. I also verify that the amcl node is open and running using rosnode list and it shows that /amcl is running.

[ WARN] [1606378586.662116874]: ignoring NAN in initial pose Yaw
[ INFO] [1606378586.689947081]: Requesting the map...
[ INFO] [1606378586.692868130]: Received a 384 X 384 map @ 0.050 m/pix
[ WARN] [1606378586.701443890]: ignoring NAN in initial pose Yaw
[ INFO] [1606378586.711590685]: Initializing likelihood field model; this can take some time on large maps...
[ INFO] [1606378586.724505768]: Done initializing likelihood field model.
[ WARN] [1606378601.810399414]: No laser scan received (and thus no pose updates have been published) for 
1606378601.810285 seconds.  Verify that data is being published on the /scan topic.

However, the node isn't subscribing to my /maps topic. According to the amcl ros wiki, I need to set my use_map_topic to true, and it will start subscribing. So I close my amcl node and reopen it using the below command:

rosrun amcl amcl --ros-args -p use_map_topic:=true

This command gives me the below printout in the command window. With no explanation, the node just closes. I am new to using amcl, so is there something I am missing? Shouldn't the node stay open and just keep looking for the /scan topic like it did when I just used the rosrun amcl amcl command?

[ WARN] [1606378851.880883739]: ignoring NAN in initial pose Yaw
[ INFO] [1606378851.902627961]: Requesting the map...
[ INFO] [1606378851.905172130]: Received a 384 X 384 map @ 0.050 m/pix
[ WARN] [1606378851.914856931]: ignoring NAN in initial pose Yaw
[ INFO] [1606378851.925499145]: Initializing likelihood field model; this can take some time on large maps...
[ INFO] [1606378851.937561677]: Done initializing likelihood field model.
00:20~/wanderbot_ws$

Linux 5.3.0-62-generic #56 18.04.1-Ubuntu

edit retag flag offensive close merge delete

Comments

rosrun amcl amcl --ros-args -p use_map_topic:=true

this seems like you are confusing ROS 2 with ROS 1.

rosrun is from ROS 1. It does not accept --ros-args.

gvdhoorn gravatar image gvdhoorn  ( 2020-11-28 07:03:37 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-11-28 03:10:38 -0500

BesterJester gravatar image

I was able to find a viable solution. Instead of the rosrun amcl amcl command, I launched the amcl node with the below command:

roslaunch turtebot3_navigation amcl.launch

Also, in that launch file, I had to add the below line to the list of parameters:

<param name="use_map_topic"    value="true"/>
edit flag offensive delete link more

Comments

Thanks. This worked for me on ROS noetic.

amjack gravatar image amjack  ( 2021-12-14 04:16:19 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-11-26 02:33:55 -0500

Seen: 209 times

Last updated: Nov 28 '20