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

How to localize diff drive robot on static map using lidar?

asked 2020-05-21 15:27:58 -0600

updated 2020-05-22 10:57:18 -0600

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.

edit retag flag offensive close merge delete

Comments

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.

Dragonslayer gravatar image Dragonslayer  ( 2020-05-22 10:14:06 -0600 )edit

@ 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.

BuilderMike gravatar image BuilderMike  ( 2020-05-22 10:52:56 -0600 )edit

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?

Dragonslayer gravatar image Dragonslayer  ( 2020-05-22 11:08:27 -0600 )edit

@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!

BuilderMike gravatar image BuilderMike  ( 2020-05-22 11:26:45 -0600 )edit

You are welcome, glad i could help.

Dragonslayer gravatar image Dragonslayer  ( 2020-05-22 11:34:41 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-05-22 11:35:18 -0600

Dragonslayer gravatar image

updated 2020-05-22 11:36:43 -0600

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.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-05-21 15:27:58 -0600

Seen: 498 times

Last updated: May 22 '20