0
$\begingroup$

Rosanswers logo

Hello,

It seems to me that the amcl node in my project is not publishing to the amcl_pose topic. I may be wrong, but when I run the command rqt I see this (the amcl_pose is missing):

image description

I looked at the amcl wiki page (https://wiki.ros.org/amcl), and indeed the node is getting all the needed info (laser scan, map, tf, initialpose), but I don't see any parameters to force publishing to amcl_pose. Any advice?

System is Ubuntu 18.04, Melodic, running on an intel PC.

The reason I am asking is that I believe this is why RViz is giving me feedback that the view of the world by the robot is wrong. By wrong I mean that the view of the global map and the global costmap (seen here):

image description

and the the RobotModel, LaserScan, footprint, PoseArray and local cost map seen here:

image description

are out of alignment (and I suspect the amcl_pose is the issue):

image description

is fixing the amcl_pose going to align the robot and the staticmap? I can imagine editing the .pgm map, or even the origin in the map's yaml file, but doing this for every map seems not right. I am running out of tutorials, and welcome with open arms package suggestions to automate a means for the robot to find itself on the map. Nodes running are:

amcl (amcl/amcl)
map_odom_broadcaster (tf/static_transform_publisher)
map_server (map_server/map_server)
move_base (move_base/move_base)
(turtlebot3_teleop_modified/turtlebot3_teleop_key)
(controller_manager/spawner)
(jimmy_base/jimmy_base_node)
(jimmy_hokuyo_lidar_control/lidar_system_control)
robot_state_publisher (robot_state_publisher/robot_state_publisher)
rviz (rviz/rviz)
urg_node (urg_node/urg_node)

Thanks for your time.

TF Tree: image description

common costmap:

footprint: [[-0.37, -0.3], [-0.37, 0.3], [0.37, 0.3], [0.37, -0.3]] #MO tuned
footprint_padding: 0.01
obstacle_range: 4
raytrace_range: 3.0
inflation:
    inflation_radius: 1.75 
     cost_scaling_factor: 2.58 
     enabled: true           
robot_base_frame: base_link
resolution: 0.02 
static:
    map_topic: map
    subscribe_to_updates: true
obstacles_laser:
    observation_sources: laser_scan_sensor
    laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: jimmy/laser/scan, marking: true, clearing: true, inf_is_valid: true} 

Global Static costmap:

global_frame: map
rolling_window: false
track_unknown_space: true
update_frequency: 4.0
publish_frequency: 3.0
transform_tolerance: 0.5
plugins:
  - {name: static,                  type: "costmap_2d::StaticLayer"}
  - {name: inflation,               type: "costmap_2d::InflationLayer"}

Local costmap:

global_frame: odom
rolling_window: true
update_frequency: 2.0
publish_frequency: 1.0
transform_tolerance: 0.5
plugins:
  - {name: obstacles_laser,           type: "costmap_2d::ObstacleLayer"}
  - {name: inflation,                 type: "costmap_2d::InflationLayer"}

initial pose is provided by RViz. I don't feed publish anything to that topic explicitly. Is that an issue?

I built the static map by teleoping, but I haven't tried teleoping in the state of this quetion. I will try and report back.


Originally posted by BuilderMike on ROS Answers with karma: 247 on 2020-05-21

Post score: 0


Original comments

Comment by Dragonslayer on 2020-05-22:
What does your tf tree look like? (rosrun tf view_frames) Posting your costmap .yaml files would be helpful. How do you feed amcl an initial_pose? What happens if you teleop arround? Iam not sure off the top of my head, how it works for me, but i believe in my system its the tf published by amcl thats actually "doing the work", not the pose topic, which might be usefull for other stuff.

Comment by BuilderMike on 2020-05-22:
@ dragonslayer Thanks for your comment. I edited the question to contain the items you mentioned. Do you see anything that I need to focus on? Thank you very much.

Comment by Dragonslayer on 2020-05-22:
Hi Mike, the localization node usually publishes the map -> odom transform, what is "map_odom_broadcaster", here should be amcl. What happens if you dont launch this node?

Comment by BuilderMike on 2020-05-22:
@Dragonslayer I don't know how to thank you enough! That was the issue.... Thank you...Thank you, and again thank you! I am so grateful! Please post your comment as an answer, and I'll accept it. Thanks!

Comment by Dragonslayer on 2020-05-22:
You are welcome, glad i could help.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

COPY FROM COMMENT: Hi Mike, the localization node usually publishes the map -> odom transform. In your tf tree there is a "map_odom_broadcaster" this seems to hinder amcl from doing this, here should be amcl.


Originally posted by Dragonslayer with karma: 574 on 2020-05-22

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.