move_base/teb_local_planner requires a map during startup
Hi all,
I'm using the navigation stack with rplidar A2, hector slam and teb_local_planner in kinetic. The robot is self made and needs to stand up before starting the navigation. Afterwards, I turn on the lidar. Then, hector SLAM recognizes that there is a scan topic, kicks in and generates the map. Now I would expect the navigation stack to do the same, but unfortunately it does not recognize the new map but seems to be stuck when no map was present during startup, i.e. the global costmap is not being published.
If I start the lidar along with the navigation stack everything works fine.
My current solution is to start the lidar and kill the move_base node (with respawn=true in the launch file). Ugly, but works: after a few seconds the global costmap is generated and the navigation stack is working fine.
In the log file of move_base there is no error message, and I have no idea anymore where to look.
my parameters are:
- /hector_height_mapping/advertise_map_service: True
- /hector_height_mapping/base_frame: base_link
- /hector_height_mapping/laser_max_dist: 8.0
- /hector_height_mapping/laser_min_dist: 0.45
- /hector_height_mapping/map_pub_period: 0.5
- /hector_height_mapping/map_resolution: 0.05
- /hector_height_mapping/map_size: 512
- /hector_height_mapping/map_start_x: 0.5
- /hector_height_mapping/map_start_y: 0.5
- /hector_height_mapping/map_update_angle_thresh: 0.1
- /hector_height_mapping/map_update_distance_thresh: 0.05
- /hector_height_mapping/map_with_known_poses: False
- /hector_height_mapping/odom_frame: base_link
- /hector_height_mapping/output_timing: False
- /hector_height_mapping/pub_map_odom_transform: False
- /hector_height_mapping/scan_topic: scan
- /hector_height_mapping/update_factor_free: 0.45
- /hector_height_mapping/use_tf_pose_start_estimate: False
- /hector_height_mapping/use_tf_scan_transformation: True
- /move_base/TebLocalPlannerROS/acc_lim_theta: 0.06
- /move_base/TebLocalPlannerROS/acc_lim_x: 0.06
- /move_base/TebLocalPlannerROS/acc_lim_y: 0.06
- /move_base/TebLocalPlannerROS/allow_init_backward_motion: True
- /move_base/TebLocalPlannerROS/costmap_converter_plugin:
- /move_base/TebLocalPlannerROS/costmap_converter_rate: 5
- /move_base/TebLocalPlannerROS/costmap_converter_spin_thread: True
- /move_base/TebLocalPlannerROS/costmap_obstacles_behind_robot_dist: 0.5
- /move_base/TebLocalPlannerROS/enable_homotopy_class_planning: False
- /move_base/TebLocalPlannerROS/footprint_model/type: point
- /move_base/TebLocalPlannerROS/include_costmap_obstacles: True
- /move_base/TebLocalPlannerROS/inflation_dist: 0.8
- /move_base/TebLocalPlannerROS/map_frame: /map
- /move_base/TebLocalPlannerROS/max_global_plan_lookahead_dist: 1.5
- /move_base/TebLocalPlannerROS/max_vel_theta: 0.2
- /move_base/TebLocalPlannerROS/max_vel_x: 0.1
- /move_base/TebLocalPlannerROS/max_vel_x_backwards: 0.1
- /move_base/TebLocalPlannerROS/max_vel_y: 0.1
- /move_base/TebLocalPlannerROS/max_vel_y_backwards: 0.1
- /move_base/TebLocalPlannerROS/min_in_place_vel_theta: 0.0
- /move_base/TebLocalPlannerROS/min_obstacle_dist: 0.36
- /move_base/TebLocalPlannerROS/min_vel_theta: -0.2
- /move_base/TebLocalPlannerROS/obstacle_poses_affected: 30
- /move_base/TebLocalPlannerROS/odom_topic: /odom
- /move_base/TebLocalPlannerROS/optimization_activate: True
- /move_base/TebLocalPlannerROS/optimization_verbose: False
- /move_base/TebLocalPlannerROS/penalty_epsilon: 0.05
- /move_base/TebLocalPlannerROS/weight_kinematics_forward_drive: 0
- /move_base/TebLocalPlannerROS/weight_kinematics_nh: 0
- /move_base/TebLocalPlannerROS/weight_kinematics_turning_radius: 0
- /move_base/TebLocalPlannerROS/xy_goal_tolerance: 0.05
- /move_base/TebLocalPlannerROS/yaw_goal_tolerance: 0.05
- /move_base/TrajectoryPlannerROS/acc_lim_theta: 0.06
- /move_base/TrajectoryPlannerROS/acc_lim_x: 0.06
- /move_base/TrajectoryPlannerROS/acc_lim_y: 0.06
- /move_base/TrajectoryPlannerROS/escape_vel: -0.1
- /move_base/TrajectoryPlannerROS/holonomic_robot: True
- /move_base/TrajectoryPlannerROS/max_vel_theta: 0.2
- /move_base/TrajectoryPlannerROS/max_vel_x: 0.1
- /move_base/TrajectoryPlannerROS/max_vel_y: 0.1
- /move_base/TrajectoryPlannerROS/min_in_place_vel_theta: 0.0
- /move_base/TrajectoryPlannerROS/min_vel_theta: -0.2
- /move_base/TrajectoryPlannerROS/min_vel_x: -0.1
- /move_base/TrajectoryPlannerROS/min_vel_y: -0.1
- /move_base/TrajectoryPlannerROS/y_vels: -0.1, -0.08,-0.06...
- /move_base/base_local_planner: teb_local_planner...
- /move_base/controller_frequency: 7
- /move_base/global_costmap/always_send_full_costmap: False
- /move_base/global_costmap/global_frame: /map
- /move_base/global_costmap/inflation_layer/cost_scaling_factor: 5.0
- /move_base/global_costmap/inflation_layer/enabled: True
- /move_base/global_costmap/inflation_layer/inflation_radius: 1.0
- /move_base/global_costmap/map_type: costmap
- /move_base/global_costmap/obstacle_layer/combination_method: 1
- /move_base/global_costmap/obstacle_layer/enabled: True
- /move_base/global_costmap/obstacle_layer/laser_scan_sensor/clearing: True
- /move_base ...
My guess is that costmap is trying to susbscribe to map topic before hector actually creates it, and in my experience topic subscription is pretty delicate in ROS. Is it not possible to just launch things sequentially? (i.e. make sure the lidar is running before launching move_base and hector)
you were right! I re-initialized all topic listeners after the lidar turned on, and everything went fine. Thanks for the tip!