1. Setup
- Install teb_local_planner pkg from official ROS repos.
sudo apt-get install ros-melodic-teb-local-planner
2. Configure & Run
2-1. Set and Configure TEB local planner
Requirement: ROS Navigation Stack
local planner가 기본적으로 TrajectoryPlannerROS로 설정되어있는데, 이것을 TEB local planner로의 변경이 필요하다.
아래 move base node의 param 수정을 통해 TEB local planner로 변경한다.
- local planner 수정(to TEB local planner)
move_base.launch 내 move_base node의 param 추가
<launch> <master auto="start"/> <!-- Run the map server --> <node name="map_server" pkg="map_server" type="map_server" args="$(find my_map_package)/my_map.pgm my_map_resolution"/> <!--- Run AMCL --> <!--- We load ACML here with diff=true to support our differential drive robot --> <include file="$(find amcl)/examples/amcl_diff.launch" /> <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen"> <rosparam file="$(find my_robot_name_2dnav)/costmap_common_params.yaml" command="load" ns="global_costmap" /> <rosparam file="$(find my_robot_name_2dnav)/costmap_common_params.yaml" command="load" ns="local_costmap" /> <rosparam file="$(find my_robot_name_2dnav)/local_costmap_params.yaml" command="load" /> <rosparam file="$(find my_robot_name_2dnav)/global_costmap_params.yaml" command="load" /> <rosparam file="$(find my_robot_name_2dnav)/base_local_planner_params.yaml" command="load" /> <param name="base_local_planner" value="teb_local_planner/TebLocalPlannerROS" /> <param name="controller_frequency" value="10.0" /> </node> </launch>
- Update parameter of TEB
base local planner params.yaml 파일 수정을 통해 TEB local planner의 parameter들을 수정한다.
(rqt reconfigure 이용해서 손쉽게 가능)
rosrun rqt_reconfigure rqt_reconfigure
TebLocalPlannerROS: odom_topic: odom map_frame: /odom # Trajectory teb_autosize: True dt_ref: 0.3 dt_hysteresis: 0.1 global_plan_overwrite_orientation: True max_global_plan_lookahead_dist: 3.0 feasibility_check_no_poses: 5 # Robot max_vel_x: 0.4 max_vel_x_backwards: 0.2 max_vel_theta: 0.3 acc_lim_x: 0.5 acc_lim_theta: 0.5 min_turning_radius: 0.0 footprint_model: # types: "point", "circular", "two_circles", "line", "polygon" type: "point" radius: 0.2 # for type "circular" line_start: [-0.3, 0.0] # for type "line" line_end: [0.3, 0.0] # for type "line" front_offset: 0.2 # for type "two_circles" front_radius: 0.2 # for type "two_circles" rear_offset: 0.2 # for type "two_circles" rear_radius: 0.2 # for type "two_circles" vertices: [ [0.25, -0.05], [0.18, -0.05], [0.18, -0.18], [-0.19, -0.18], [-0.25, 0], [-0.19, 0.18], [0.18, 0.18], [0.18, 0.05], [0.25, 0.05] ] # for type "polygon" # GoalTolerance xy_goal_tolerance: 0.2 yaw_goal_tolerance: 0.1 free_goal_vel: False # Obstacles min_obstacle_dist: 0.4 include_costmap_obstacles: True costmap_obstacles_behind_robot_dist: 1.0 obstacle_poses_affected: 30 costmap_converter_plugin: "" costmap_converter_spin_thread: True costmap_converter_rate: 5 # Optimization no_inner_iterations: 5 no_outer_iterations: 4 optimization_activate: True optimization_verbose: False penalty_epsilon: 0.1 weight_max_vel_x: 2 weight_max_vel_theta: 1 weight_acc_lim_x: 1 weight_acc_lim_theta: 1 weight_kinematics_nh: 1000 weight_kinematics_forward_drive: 1 weight_kinematics_turning_radius: 1 weight_optimaltime: 1 weight_obstacle: 50 weight_dynamic_obstacle: 10 # not in use yet alternative_time_cost: False # not in use yet # Homotopy Class Planner enable_homotopy_class_planning: True enable_multithreading: True simple_exploration: False max_number_classes: 4 roadmap_graph_no_samples: 15 roadmap_graph_area_width: 5 h_signature_prescaler: 0.5 h_signature_threshold: 0.1 obstacle_keypoint_offset: 0.1 obstacle_heading_threshold: 0.45 visualize_hc_graph: False
'Developer > AD' 카테고리의 다른 글
robot_localization (0) | 2022.02.23 |
---|---|
TEB Local Planner Parameter tuning (0) | 2021.11.10 |
ROS Navigation #1 (0) | 2021.03.16 |
댓글