ROS入门(七)

您所在的位置:网站首页 ros主从机的rviz找不到stl文件 ROS入门(七)

ROS入门(七)

2024-06-12 00:44| 来源: 网络整理| 查看: 265

move_base的启动文件:

主要是显示更改odom、map和base_link的框架名,然后更改odom和激光雷达的话题名。下面读入了move_base的配置文件。最后要主要将链接的控制话题进行重映射,连接到本机器人的控制。

move_base的配置文件:

costmap_common_params.yaml:主要是要更改所读入的传感器的数据类型和话题,其他参数进行适当调节。

max_obstacle_height: 2.40 # assume something like an arm is mounted on top of the robot # Obstacle Cost Shaping (http://wiki.ros.org/costmap_2d/hydro/inflation) robot_radius: 0.25 # distance a circular robot should be clear of the obstacle (kobuki: 0.18) # footprint: [[x0, y0], [x1, y1], ... [xn, yn]] # if the robot is not circular map_type: voxel voxel_layer: enabled: true max_obstacle_height: 2.2 origin_z: 0.0 z_resolution: 0.1 z_voxels: 22 unknown_threshold: 15 mark_threshold: 0 combination_method: 1 track_unknown_space: true #true needed for disabling global path planning through unknown space obstacle_range: 2.5 raytrace_range: 3.0 publish_voxel_map: true observation_sources: scan scan: data_type: LaserScan topic: /mycar/laser/scan marking: true clearing: true min_obstacle_height: 0.1 max_obstacle_height: 0.3 #cost_scaling_factor and inflation_radius were now moved to the inflation_layer ns inflation_layer: enabled: true cost_scaling_factor: 2.58 # exponential rate at which the obstacle cost drops off (default: 10) inflation_radius: 1.0 # max. distance from an obstacle at which costs are incurred for planning paths. static_layer: enabled: true

dwa_local_planner_params.yaml:对参数进行适当调节。

DWAPlannerROS: # Robot Configuration Parameters max_vel_x: 0.5 min_vel_x: 0.0 max_vel_y: 0.0 min_vel_y: 0.0 # The velocity when robot is moving in a straight line max_trans_vel: 0.55 min_trans_vel: 0.1 trans_stopped_vel: 0.1 max_rot_vel: 5.0 min_rot_vel: 0.8 rot_stopped_vel: 0.8 acc_lim_x: 1.0 acc_lim_theta: 2.0 acc_lim_y: 0.0 # Goal Tolerance Parametes yaw_goal_tolerance: 0.3 xy_goal_tolerance: 0.15 # latch_xy_goal_tolerance: false # Forward Simulation Parameters sim_time: 4.0 vx_samples: 20 vy_samples: 0 vtheta_samples: 40 # Trajectory Scoring Parameters path_distance_bias: 32.0 goal_distance_bias: 24.0 occdist_scale: 0.1 forward_point_distance: 0.325 stop_time_buffer: 0.2 scaling_speed: 0.25 max_scaling_factor: 0.2 # Oscillation Prevention Parameters oscillation_reset_dist: 0.05 # Debugging publish_traj_pc : true publish_cost_grid_pc: true global_frame_id: odom

global_costmap_params.yaml:更改全局和base_link的框架名称,其他参数进行适当调节。

global_costmap: global_frame: /map robot_base_frame: /footprint update_frequency: 2.0 publish_frequency: 0.5 static_map: true rolling_window: false transform_tolerance: 0.5 plugins: - {name: static_layer, type: "costmap_2d::StaticLayer"} - {name: voxel_layer, type: "costmap_2d::VoxelLayer"} - {name: inflation_layer, type: "costmap_2d::InflationLayer"}

global_planner_params.yaml:对参数进行适当调节。

GlobalPlanner: # Also see: http://wiki.ros.org/global_planner old_navfn_behavior: false # Exactly mirror behavior of navfn, use defaults for other boolean parameters, default false use_quadratic: true # Use the quadratic approximation of the potential. Otherwise, use a simpler calculation, default true use_dijkstra: false # Use dijkstra's algorithm. Otherwise, A*, default true use_grid_path: false # Create a path that follows the grid boundaries. Otherwise, use a gradient descent method, default false allow_unknown: true # Allow planner to plan through unknown space, default true #Needs to have track_unknown_space: true in the obstacle / voxel layer (in costmap_commons_param) to work planner_window_x: 0.0 # default 0.0 planner_window_y: 0.0 # default 0.0 default_tolerance: 0.0 # If goal in obstacle, plan to the closest point in radius default_tolerance, default 0.0 publish_scale: 100 # Scale by which the published potential gets multiplied, default 100 planner_costmap_publish_frequency: 0.0 # default 0.0 lethal_cost: 253 # default 253 neutral_cost: 50 # default 50 cost_factor: 3.0 # Factor to multiply each cost from costmap by, default 3.0 publish_potential: true # Publish Potential Costmap (this is not like the navfn pointcloud2 potential), default true

local_costmap_params.yaml:更改全局和base_link的框架名称,其他参数进行适当调节。

local_costmap: global_frame: /map robot_base_frame: /footprint update_frequency: 5.0 publish_frequency: 2.0 static_map: false rolling_window: true width: 4.0 height: 4.0 resolution: 0.05 origin_x: 5.0 origin_y: 0 transform_tolerance: 0.5 plugins: - {name: voxel_layer, type: "costmap_2d::VoxelLayer"} - {name: inflation_layer, type: "costmap_2d::InflationLayer"}

move_base_params.yaml:对参数进行适当调节。

# Move base node parameters. For full documentation of the parameters in this file, please see # # http://www.ros.org/wiki/move_base # shutdown_costmaps: false controller_frequency: 5.0 controller_patience: 3.0 planner_frequency: 1.0 planner_patience: 5.0 oscillation_timeout: 10.0 oscillation_distance: 0.2 # local planner - default is trajectory rollout base_local_planner: "dwa_local_planner/DWAPlannerROS" base_global_planner: "navfn/NavfnROS" #alternatives: global_planner/GlobalPlanner, carrot_planner/CarrotPlanner

navfn_global_planner_params.yaml:对参数进行适当调节。

NavfnROS: visualize_potential: false #Publish potential for rviz as pointcloud2, not really helpful, default false allow_unknown: true #Specifies whether or not to allow navfn to create plans that traverse unknown space, default true #Needs to have track_unknown_space: true in the obstacle / voxel layer (in costmap_commons_param) to work planner_window_x: 0.0 #Specifies the x size of an optional window to restrict the planner to, default 0.0 planner_window_y: 0.0 #Specifies the y size of an optional window to restrict the planner to, default 0.0 default_tolerance: 0.0 #If the goal is in an obstacle, the planer will plan to the nearest point in the radius of default_tolerance, default 0.0 #The area is always searched, so could be slow for big values

主要是在costmap_common_params.yaml中配置传感器发布的话题。以及在其他文件中配置map、base_link的框架名。

在gmapping中配置move_base的效果就是,可以进行路径规划,使用2D Nav goal指定所要到达的目标。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3