-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
costmap setup #261
costmap setup #261
Changes from 2 commits
417208b
76a32c5
dd80385
d35b1e0
9461aa8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
controller_server: | ||
ros__parameters: | ||
use_sim_time: True | ||
controller_frequency: 20.0 | ||
min_x_velocity_threshold: 0.001 | ||
min_y_velocity_threshold: 0.5 | ||
min_theta_velocity_threshold: 0.001 | ||
failure_tolerance: 0.3 | ||
progress_checker_plugin: "progress_checker" | ||
goal_checker_plugins: ["general_goal_checker"] # "precise_goal_checker" | ||
controller_plugins: ["FollowPath"] | ||
|
||
# Progress checker parameters | ||
progress_checker: | ||
plugin: "nav2_controller::SimpleProgressChecker" | ||
required_movement_radius: 0.5 | ||
movement_time_allowance: 10.0 | ||
# Goal checker parameters | ||
#precise_goal_checker: | ||
# plugin: "nav2_controller::SimpleGoalChecker" | ||
# xy_goal_tolerance: 0.25 | ||
# yaw_goal_tolerance: 0.25 | ||
# stateful: True | ||
general_goal_checker: | ||
stateful: True | ||
plugin: "nav2_controller::SimpleGoalChecker" | ||
xy_goal_tolerance: 0.25 | ||
yaw_goal_tolerance: 0.25 | ||
# DWB parameters | ||
FollowPath: | ||
plugin: "dwb_core::DWBLocalPlanner" | ||
debug_trajectory_details: True | ||
min_vel_x: 0.0 | ||
min_vel_y: 0.0 | ||
max_vel_x: 0.26 | ||
max_vel_y: 0.0 | ||
max_vel_theta: 1.0 | ||
min_speed_xy: 0.0 | ||
max_speed_xy: 0.26 | ||
min_speed_theta: 0.0 | ||
# Add high threshold velocity for turtlebot 3 issue. | ||
# https://github.com/ROBOTIS-GIT/turtlebot3_simulations/issues/75 | ||
acc_lim_x: 2.5 | ||
acc_lim_y: 0.0 | ||
acc_lim_theta: 3.2 | ||
decel_lim_x: -2.5 | ||
decel_lim_y: 0.0 | ||
decel_lim_theta: -3.2 | ||
vx_samples: 20 | ||
vy_samples: 5 | ||
vtheta_samples: 20 | ||
sim_time: 1.7 | ||
linear_granularity: 0.05 | ||
angular_granularity: 0.025 | ||
transform_tolerance: 0.2 | ||
xy_goal_tolerance: 0.25 | ||
trans_stopped_velocity: 0.25 | ||
short_circuit_trajectory_evaluation: True | ||
stateful: True | ||
critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"] | ||
BaseObstacle.scale: 0.02 | ||
PathAlign.scale: 32.0 | ||
PathAlign.forward_point_distance: 0.1 | ||
GoalAlign.scale: 24.0 | ||
GoalAlign.forward_point_distance: 0.1 | ||
PathDist.scale: 32.0 | ||
GoalDist.scale: 24.0 | ||
RotateToGoal.scale: 32.0 | ||
RotateToGoal.slowing_factor: 5.0 | ||
RotateToGoal.lookahead_time: -1.0 | ||
|
||
planner_server: | ||
ros__parameters: | ||
expected_planner_frequency: 20.0 | ||
planner_plugins: ["GridBased"] | ||
GridBased: | ||
plugin: "nav2_navfn_planner/NavfnPlanner" | ||
tolerance: 0.5 | ||
use_astar: false | ||
allow_unknown: true | ||
|
||
global_costmap: | ||
global_costmap: | ||
ros__parameters: | ||
footprint_padding: 0.03 | ||
update_frequency: 1.0 | ||
publish_frequency: 1.0 | ||
global_frame: map | ||
robot_base_frame: base_link | ||
use_sim_time: True | ||
robot_radius: 0.22 # should modify | ||
resolution: 0.05 | ||
plugins: ["static_layer", "inflation_layer", "obstacle_layer"] | ||
obstacle_layer: | ||
plugin: "nav2_costmap_2d::ObstacleLayer" | ||
enabled: True | ||
observation_sources: scan pointcloud1 pointcloud2 | ||
meshvaD marked this conversation as resolved.
Show resolved
Hide resolved
|
||
footprint_clearing_enabled: true | ||
max_obstacle_height: 2.0 | ||
combination_method: 1 | ||
scan: | ||
topic: /lidar_controller/out | ||
obstacle_max_range: 2.5 | ||
obstacle_min_range: 0.0 | ||
raytrace_max_range: 3.0 | ||
raytrace_min_range: 0.0 | ||
max_obstacle_height: 2.0 | ||
min_obstacle_height: 0.0 | ||
clearing: True | ||
marking: True | ||
data_type: "LaserScan" | ||
inf_is_valid: false | ||
pointcloud1: | ||
topic: /camera1_sensor/points | ||
clearing: True | ||
marking: True | ||
data_type: "PointCloud2" | ||
pointcloud2: | ||
topic: /camera2_sensor/points | ||
clearing: True | ||
marking: True | ||
data_type: "PointCloud2" | ||
static_layer: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can keep it in but may not be as important right now since we are not using SLAM nor do we have a map being served to our rover from anywhere. Just keep this in mind. |
||
plugin: "nav2_costmap_2d::StaticLayer" | ||
map_subscribe_transient_local: True | ||
enabled: true | ||
subscribe_to_updates: true | ||
transform_tolerance: 0.1 | ||
inflation_layer: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good, plans for us to avoid obstacles |
||
plugin: "nav2_costmap_2d::InflationLayer" | ||
enabled: true | ||
inflation_radius: 0.55 | ||
cost_scaling_factor: 1.0 | ||
inflate_unknown: false | ||
inflate_around_unknown: true | ||
always_send_full_costmap: True | ||
|
||
|
||
local_costmap: | ||
local_costmap: | ||
ros__parameters: | ||
update_frequency: 5.0 | ||
publish_frequency: 100.0 | ||
global_frame: base_link | ||
robot_base_frame: base_link | ||
use_sim_time: True | ||
rolling_window: true | ||
width: 3 | ||
height: 3 | ||
resolution: 0.05 | ||
|
||
plugins: ["static_layer", "inflation_layer", "obstacle_layer"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just took a peek at the setup guide any they are using voxel_layer and inflation_layer. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think for now it might be best to get a 2D costmap, so with a obstacle layer. Even if we have a voxel layer, since we are only planning for the drivetrain to move in 2D, it might be unnecessary. If we do end up needed it in the future, we can always just add the plugin! Also just a note: we might need to make some custom costmap layers as well. If our camera has any noise in it, we'll probably need to filter it out (there is a DenoiseLayer, but it doesn't seem to be available for galactic, I'd have to look at it more later). And if there are hills in the scene, how would we differentiate between a climbable hill vs an obstacle. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And we should have a static_layer, even if it is empty. The obstacle_layer doesn't work without a static_layer, it seems like a problem some other people have too: https://answers.ros.org/question/405789/local-costmaps-obstacle-layer-not-detecting-obstacles/ |
||
obstacle_layer: | ||
plugin: "nav2_costmap_2d::ObstacleLayer" | ||
enabled: True | ||
observation_sources: scan pointcloud1 pointcloud2 | ||
footprint_clearing_enabled: true | ||
max_obstacle_height: 2.0 | ||
combination_method: 1 | ||
scan: | ||
topic: /lidar_controller/out | ||
data_type: "LaserScan" | ||
sensor_frame: lidar1 | ||
marking: true | ||
clearing: true | ||
observation_persistence: 100.0 | ||
pointcloud1: | ||
topic: /camera1_sensor/points | ||
clearing: True | ||
marking: True | ||
data_type: "PointCloud2" | ||
sensor_frame: camera1_virtual_link | ||
marking: true | ||
clearing: true | ||
observation_persistence: 100.0 | ||
pointcloud2: | ||
topic: /camera2_sensor/points | ||
clearing: True | ||
marking: True | ||
data_type: "PointCloud2" | ||
sensor_frame: camera2_virtual_link | ||
marking: true | ||
clearing: true | ||
observation_persistence: 100.0 | ||
static_layer: | ||
plugin: "nav2_costmap_2d::StaticLayer" | ||
map_subscribe_transient_local: True | ||
enabled: true | ||
subscribe_to_updates: true | ||
transform_tolerance: 0.1 | ||
inflation_layer: | ||
plugin: "nav2_costmap_2d::InflationLayer" | ||
enabled: true | ||
inflation_radius: 0.55 | ||
cost_scaling_factor: 1.0 | ||
inflate_unknown: false | ||
inflate_around_unknown: true | ||
|
||
map_saver: | ||
ros__parameters: | ||
save_map_timeout: 5.0 | ||
free_thresh_default: 0.25 | ||
occupied_thresh_default: 0.65 | ||
|
||
map_server: | ||
ros__parameters: | ||
yaml_filename: "map.yaml" | ||
topic_name: "map" | ||
frame_id: "map" | ||
|
||
costmap_filter_info_server: | ||
ros__parameters: | ||
type: 1 | ||
filter_info_topic: "costmap_filter_info" | ||
mask_topic: "filter_mask" | ||
base: 0.0 | ||
multiplier: 0.25 |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
image: ./map.pgm | ||
resolution: 0.050000 | ||
origin: [-10.000000, -10.000000, 0.000000] | ||
negate: 0 | ||
occupied_thresh: 0.65 | ||
free_thresh: 0.196 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
from ament_index_python.packages import get_package_share_directory | ||
|
||
from launch import LaunchDescription | ||
from launch_ros.actions import Node | ||
from launch.actions import DeclareLaunchArgument | ||
from launch.substitutions import LaunchConfiguration | ||
from launch_ros.descriptions import ParameterFile | ||
|
||
import os | ||
|
||
def generate_launch_description(): | ||
|
||
declared_arguments = [] | ||
nodes = [] | ||
|
||
controller_yaml = os.path.join(get_package_share_directory('uwrt_mars_rover_drivetrain_description'), 'config', 'costmap_parameters.yaml') | ||
|
||
lifecycle_nodes = ['controller_server', | ||
'planner_server', | ||
'map_server'] | ||
|
||
nodes += [Node( | ||
package='nav2_map_server', | ||
executable='map_server', | ||
output='screen', | ||
parameters=[controller_yaml])] | ||
|
||
nodes += [Node( | ||
package='nav2_controller', | ||
executable='controller_server', | ||
output='screen', | ||
respawn=True, | ||
respawn_delay=2.0, | ||
parameters=[controller_yaml])] | ||
|
||
nodes += [Node( | ||
package='nav2_planner', | ||
executable='planner_server', | ||
name='planner_server', | ||
output='screen', | ||
respawn=True, | ||
respawn_delay=2.0, | ||
parameters=[controller_yaml])] | ||
|
||
nodes += [Node( | ||
package='nav2_lifecycle_manager', | ||
executable='lifecycle_manager', | ||
name='lifecycle_manager_navigation', | ||
output='screen', | ||
parameters=[{'autostart': True}, | ||
{'node_names': lifecycle_nodes}])] | ||
|
||
return LaunchDescription(declared_arguments + nodes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this is just the default file given from the nav2 guide, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, how did you tweak the params? It's fine if these are just "arbitrary" for now... but we just need to know if we need to come back to them if something isnt working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the controller_server params are just from the guide, and the params are not tweaked