From e3ee2da2d5a274b52d32fcdf7e270567ca1093d0 Mon Sep 17 00:00:00 2001 From: stevemacenski Date: Fri, 13 Dec 2019 15:00:46 -0800 Subject: [PATCH] adding more fully described parameters and setup --- .../launch/nav2_tb3_simulation_launch.py | 5 +- nav2_bringup/bringup/params/nav2_params.yaml | 20 +- .../bringup/worlds/turtlebot3_waffle.urdf | 293 ++++++++++++++++++ nav2_bringup/bringup/worlds/waffle.model | 64 ++-- nav2_costmap_2d/src/costmap_2d_ros.cpp | 4 +- 5 files changed, 338 insertions(+), 48 deletions(-) create mode 100644 nav2_bringup/bringup/worlds/turtlebot3_waffle.urdf diff --git a/nav2_bringup/bringup/launch/nav2_tb3_simulation_launch.py b/nav2_bringup/bringup/launch/nav2_tb3_simulation_launch.py index 97bdfbb987..731c85f4e4 100644 --- a/nav2_bringup/bringup/launch/nav2_tb3_simulation_launch.py +++ b/nav2_bringup/bringup/launch/nav2_tb3_simulation_launch.py @@ -117,7 +117,7 @@ def generate_launch_description(): declare_simulator_cmd = DeclareLaunchArgument( 'headless', - default_value='False', + default_value='True', description='Whether to execute gzclient)') declare_world_cmd = DeclareLaunchArgument( @@ -140,8 +140,7 @@ def generate_launch_description(): cmd=['gzclient'], cwd=[launch_dir], output='screen') - urdf = os.path.join( - get_package_share_directory('turtlebot3_description'), 'urdf', 'turtlebot3_waffle.urdf') + urdf = os.path.join(bringup_dir, 'worlds', 'turtlebot3_waffle.urdf') start_robot_state_publisher_cmd = Node( condition=IfCondition(use_robot_state_pub), diff --git a/nav2_bringup/bringup/params/nav2_params.yaml b/nav2_bringup/bringup/params/nav2_params.yaml index d1dc8948a9..2db4d36c56 100644 --- a/nav2_bringup/bringup/params/nav2_params.yaml +++ b/nav2_bringup/bringup/params/nav2_params.yaml @@ -115,14 +115,17 @@ controller_server_rclcpp_node: local_costmap: local_costmap: ros__parameters: + update_frequency: 5 + publish_frequency: 2 + robot_base_frame: base_link use_sim_time: True global_frame: odom - plugin_names: ["obstacle_layer", "voxel_layer", "inflation_layer"] - plugin_types: ["nav2_costmap_2d::ObstacleLayer", "nav2_costmap_2d::VoxelLayer", "nav2_costmap_2d::InflationLayer"] rolling_window: true width: 3 height: 3 resolution: 0.05 + plugin_names: ["obstacle_layer", "voxel_layer", "inflation_layer"] + plugin_types: ["nav2_costmap_2d::ObstacleLayer", "nav2_costmap_2d::VoxelLayer", "nav2_costmap_2d::InflationLayer"] robot_radius: 0.22 inflation_layer: cost_scaling_factor: 3.0 @@ -139,8 +142,8 @@ local_costmap: enabled: True publish_voxel_map: True origin_z: 0.0 - z_resolution: 0.2 - z_voxels: 10 + z_resolution: 0.05 + z_voxels: 16 max_obstacle_height: 2.0 mark_threshold: 0 observation_sources: pointcloud @@ -163,10 +166,15 @@ local_costmap: global_costmap: global_costmap: ros__parameters: + update_frequency: 1 + publish_frequency: 1 + robot_base_frame: base_link + global_frame: map use_sim_time: True plugin_names: ["static_layer", "obstacle_layer", "voxel_layer", "inflation_layer"] plugin_types: ["nav2_costmap_2d::StaticLayer", "nav2_costmap_2d::ObstacleLayer", "nav2_costmap_2d::VoxelLayer", "nav2_costmap_2d::InflationLayer"] robot_radius: 0.22 + resolution: 0.05 obstacle_layer: enabled: True observation_sources: scan @@ -180,8 +188,8 @@ global_costmap: enabled: True publish_voxel_map: True origin_z: 0.0 - z_resolution: 0.2 - z_voxels: 10 + z_resolution: 0.05 + z_voxels: 16 max_obstacle_height: 2.0 mark_threshold: 0 observation_sources: pointcloud diff --git a/nav2_bringup/bringup/worlds/turtlebot3_waffle.urdf b/nav2_bringup/bringup/worlds/turtlebot3_waffle.urdf new file mode 100644 index 0000000000..c92483449e --- /dev/null +++ b/nav2_bringup/bringup/worlds/turtlebot3_waffle.urdf @@ -0,0 +1,293 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nav2_bringup/bringup/worlds/waffle.model b/nav2_bringup/bringup/worlds/waffle.model index d065ae1cd8..88fa5e58c3 100644 --- a/nav2_bringup/bringup/worlds/waffle.model +++ b/nav2_bringup/bringup/worlds/waffle.model @@ -403,9 +403,7 @@ - - - + 0.069 -0.047 0.107 0 0 0 @@ -418,7 +416,6 @@ 0.035 - 0 0.047 0 0 0 0 @@ -427,42 +424,35 @@ + 0.069 -0.047 0.107 0 0 0 - - true - true - 30 - - 1.02974 - - 1920 - 1080 - R8G8B8 - - - 0.02 - 300 - - - gaussian - - 0.0 - 0.007 - + + + 1 + 5 + 0.064 -0.047 0.107 0 0 0 + - - - - - - - - - - + + + + intel_realsense_r200_depth + camera_depth_frame + 0.07 + 0.001 + 5.0 + + + + 0 0.047 0 0 0 0 + + + 0.008 0.130 0.022 + + + + 0.069 -0.047 0.107 0 0 0 diff --git a/nav2_costmap_2d/src/costmap_2d_ros.cpp b/nav2_costmap_2d/src/costmap_2d_ros.cpp index 29e8fa3000..f1afd9d3af 100644 --- a/nav2_costmap_2d/src/costmap_2d_ros.cpp +++ b/nav2_costmap_2d/src/costmap_2d_ros.cpp @@ -86,7 +86,8 @@ Costmap2DROS::Costmap2DROS( declare_parameter("footprint_padding", rclcpp::ParameterValue(0.01f)); declare_parameter("footprint", rclcpp::ParameterValue(std::string("[]"))); declare_parameter("global_frame", rclcpp::ParameterValue(std::string("map"))); - declare_parameter("height", rclcpp::ParameterValue(10)); + declare_parameter("height", rclcpp::ParameterValue(5)); + declare_parameter("width", rclcpp::ParameterValue(5)); declare_parameter("lethal_cost_threshold", rclcpp::ParameterValue(100)); declare_parameter("map_topic", rclcpp::ParameterValue( (parent_namespace_ == "/" ? "/" : parent_namespace_ + "/") + std::string("map"))); @@ -106,7 +107,6 @@ Costmap2DROS::Costmap2DROS( declare_parameter("unknown_cost_value", rclcpp::ParameterValue(static_cast(0xff))); declare_parameter("update_frequency", rclcpp::ParameterValue(5.0)); declare_parameter("use_maximum", rclcpp::ParameterValue(false)); - declare_parameter("width", rclcpp::ParameterValue(10)); declare_parameter("clearable_layers", rclcpp::ParameterValue(clearable_layers)); }