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

Global and local costmaps

asked 2022-11-01 05:56:49 -0500

zaid gravatar image

Unable to understand the concept of localization parameters in Ros navigation stack

I am working on a bunker robot from Agilex. Below are my localization parameters. I have mapped the environment using Hector_slam package. I am working in outdoor environment and using Rplidar for scanning.

Base_local_planner_params.yaml

TrajectoryPlannerROS:
max_vel_x: 1.12
min_vel_x: 1.11
max_vel_theta: 0.05
min_vel_theta: -0.05
min_in_place_vel_theta: 0.05

acc_lim_theta: 0.07
acc_lim_x: 0.25
acc_lim_Y: 0.25

holonomic_robot: false

meter_scoring: true

xy_goal_tolerance: 0.15
yaw_goal_tolerance: 0.25

Costmap_common_params.yaml

obstacle_range: 3.0
raytrace_range: 3.5
publish frequency: 2.0

footprint: \[\[-0.105, -0.105\], \[-0.105, 0.105\], \[0.041, 0.105\], \[0.041, -0.105\]\]
robot_radius: 0.105

inflation_radius: 1.0
cost_scaling_factor: 3.0
transform_tolerance: 0.5

map_type: costmap
observation_sources: scan
scan: {sensor_frame: laser, data_type: LaserScan, topic: scan, marking: true, clearing: true}

Global_costmap_params.yaml

global_costmap:
global_frame: odom
robot_base_frame: base_link
update_frequency: 0.5
static_map: true

Local_costmap_params.yaml

local_costmap:
global_frame: odom
robot_base_frame: base_link
update_frequency: 2.0
publish_frequency: 2.0
rolling_window: true
width: 5.0
height: 5.0
resolution: 0.05

Move_base_params.yaml

shutdown_costmaps: false
controller_frequency: 10.0
planner_patience: 5.0
controller_patience: 15.0
conservative_reset_dist: 3.0
planner_frequency: 5.0
oscillation_timeout: 10.0
oscillation_distance: 0.2

Questions:

  1. Robot only moves in a circle and is unable to decide the path where to go, as the path to the goal also changes very frequently

Error:[ WARN] [1667220609.416243921]: Rotate recovery behavior started.

  1. Is it a good idea to set the global frame to Odom instead of the map as I receive the following error too

  2. As soon as the robot starts spinning(after I send the 2d nav goal), the map doesn't remain stationary and it weirdly moves all around the rviz

I receive also the following errors after setting the goal

  • Control loop missed its desired rate of 10.0000Hz... the loop actually took 0.2142 seconds
  • Costmap2DROS transform timeout. Current time: 1667223453.9988, global_pose stamp: 1667223453.4815, tolerance: 0.5000
  • Clearing both costmaps outside a square (3.00m) large centered on the robot.

Kindly guide me on where I am coming short of achieving this autonomous driving of a robot using a navigation stack Below I am attaching the rviz window rviz window

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-11-02 07:24:51 -0500

Scotty gravatar image

Hi Zaid,

In terms of your question I have two solutions I can think of with the information you have provided:

1 ) For your global costmap your global frame should be the map frame. If it is the odometry frame the global costmap will move and rotate in relation to the odom frame, which will "look" as if the global map is following the movements of the robot. In terms of the local costmap, it is fine to use the odom frame, however if there is a problem with the transform between you input sources for obstacle detection and the baselink frame you will see a drag of obstacles being places on your costmaps.

2 ) If the the maps are working correctly, and your robot is still planning strange trajectories this could be an issue with the localisation, easily tested by manually moving the robot while watching the position on rviz to see if it moves correctly relative to the costmap.

Sidenote: If you have yet to see the robot plan at all, I would recommend commenting out your input sources for your costmap and driving "blind" in a secure spot to see if there is a problem with the global planner itself, which can help narrow down where this error is coming from.

Also your errors seem to indicate the cpu is struggling with the load of your navigation stack. You can try turning down the resolution from 0.05 to 0.1 and see if there is measurable difference in performance.

Hope this helps.

edit flag offensive delete link more

Comments

Thank you Scotty for the answer. I guess the problem is with localization. after launching the navigation file, I drove the robot using an RF transmitter and the robot wasn't able to localize itself on the map.

The global frame for global_costmap_param is set to map and it's now working fine. The problem is localization now. I have built the map using RPlidar with the help of the hector_slam package. Kindly let me know if mapping with hector is a good idea in regard to localization problems, if yes, do let me know how else can i build the map effectively. Your answer will be appreciated. thank you

zaid gravatar image zaid  ( 2022-11-02 08:26:55 -0500 )edit

Hi Zaid,

I've personally never used the hector slam package, however I did find an answer in terms of using it solely for localisation. If your robot is based indoors with a lazer scan I'd recommend looking into the AMCL package and maybe using hector slam for mapping and publishing local odometry.

Hope this helps.

Scotty gravatar image Scotty  ( 2022-11-03 09:30:15 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-11-01 05:56:49 -0500

Seen: 372 times

Last updated: Nov 02 '22