Skip to content

Created Gazebo Simulation for Scout Mini (with Nav2 capabilities)#3

Open
InfinityJuice wants to merge 10 commits into
mainfrom
sim-dev
Open

Created Gazebo Simulation for Scout Mini (with Nav2 capabilities)#3
InfinityJuice wants to merge 10 commits into
mainfrom
sim-dev

Conversation

@InfinityJuice

@InfinityJuice InfinityJuice commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

PR Summary

This PR adds a full Scout Mini Gazebo + Nav2 simulation workflow and updates the robot model, navigation configs, maps, and task runners needed to exercise autonomous navigation in simulation.

Major Changes

  • Adds a Gazebo launch path for Scout Mini with scoutmini_description/launch/gazebo_mini.launch.py.
  • Adds selectable simulation worlds: default_warehouse, warehouse, empty, and tb3_sandbox.
  • Vendors new world/map assets, including warehouse and TurtleBot-style sandbox maps.
  • Updates the Scout Mini URDF/Xacro with local mesh assets, corrected base_footprint relationship, wheel orientation/axis updates, Gazebo ros2_control integration, and simulated IMU, lidar, ZED-style RGB camera, and Insta360-style RGB camera outputs.
  • Adds Gazebo bridge, diff drive, and SLAM config files.
  • Adds nav2_sim.yaml for simulation-specific Nav2 behavior using /scan, /ground_truth/odom, AMCL, Navfn, DWB, costmaps, velocity smoothing, and waypoint following.
  • Expands simulation_2d.launch.py into a full bringup that launches Gazebo, spawns the robot, starts Nav2, and optionally sends route or single-pose goals.
  • Updates navigation.launch.py to support simulation use cases, optional hardware odometry launch, map YAML rewriting, RViz launch, and optional route loop execution.
  • Adds nav_to_pose_runner.py for sending a single NavigateToPose goal from launch parameters.
  • Improves route_loop_runner.py with initial map_name parameter support, retry/timeout handling for waypoint resolution, waypoint JSON fallback when the waypoint service is unavailable, and cleaner shutdown behavior.
  • Adds scoutmini_nav2/README.md with build, launch, RViz, and Nav2 health-check instructions.

How To Run

cd /ros2_ws
colcon build --packages-select scoutmini_description scoutmini_nav2 scoutmini_tasks map_tools
source install/setup.bash
ros2 launch scoutmini_nav2 simulation_2d.launch.py

Optional single goal:

ros2 launch scoutmini_nav2 simulation_2d.launch.py use_goal:=true goal_x:=2.0 goal_y:=0.0 goal_yaw:=0.0

Notes

  • The default simulation uses the vendored warehouse world and map_tools/maps/warehouse/warehouse.yaml.
  • Gazebo may need internet access the first time it loads Fuel-hosted warehouse assets.
  • All commits on this PR branch are signed.

@InfinityJuice InfinityJuice requested a review from nhat-m-le as a code owner July 8, 2026 18:32
@InfinityJuice InfinityJuice self-assigned this Jul 8, 2026
@InfinityJuice

Copy link
Copy Markdown
Collaborator Author

Had to sign all my commits because merging rule. That's why all the commits date to today at the same time and force pushed.

@nhat-m-le nhat-m-le left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First round of review with some questions/comments/suggestions. Take a look at all of them first before deciding what to do next and address the questions.

Comment on lines +47 to +77
<!-- <gazebo>
<plugin name="skid_steer_drive_controller" filename="libgazebo_ros_skid_steer_drive.so">
<updateRate>100.0</updateRate>
<robotNamespace></robotNamespace>
<leftFrontJoint>front_left_wheel</leftFrontJoint>
<rightFrontJoint>front_right_wheel</rightFrontJoint>
<leftRearJoint>rear_left_wheel</leftRearJoint>
<rightRearJoint>rear_right_wheel</rightRearJoint>
<wheelSeparation>4</wheelSeparation>
<wheelDiameter>0.32918</wheelDiameter>
<robotBaseFrame>base_link</robotBaseFrame>
<torque>1000</torque>
<commandTopic>cmd_vel</commandTopic>
<broadcastTF>true</broadcastTF>
<odometryTopic>odom</odometryTopic>
<odometryFrame>odom</odometryFrame>
<covariance_x>0.000100</covariance_x>
<covariance_y>0.000100</covariance_y>
<covariance_yaw>0.010000</covariance_yaw>
</plugin>
</gazebo> -->

<!-- <gazebo>
<plugin name="object_controller" filename="libgazebo_ros_planar_move.so">
<commandTopic>cmd_vel</commandTopic>
<odometryTopic>odom</odometryTopic>
<odometryFrame>odom</odometryFrame>
<odometryRate>20.0</odometryRate>
<robotBaseFrame>base_footprint</robotBaseFrame>
</plugin>
</gazebo> -->

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Briefly explain why we are not using these 2 plugins.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These plugins are for gazebo classic not for modern. There are updated versions made for modern gazebo, but I decided to go for ros2_control's diff_drive_controller because it's more standard.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A SLAM config file should not be in a description package. This seems like a duplicate of this file. If there is a good reason to keep this a separate file, move it to scoutmini_nav2/config and put some comment at the top of the file

@@ -0,0 +1,69 @@
<?xml version="1.0" ?>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a brief summary about the purpose of this file at the top

Comment on lines -194 to +187
plugin: "nav2_smac_planner/SmacPlanner2D"
plugin: "nav2_smac_planner::SmacPlanner2D"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this change as ROS Humble has not fully switched to :: syntax

Comment on lines -183 to -185
path_handler_plugins: ["PathHandler"]
path_handler:
plugin: "nav2_controller::FeasiblePathHandler"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in nav2.yaml were done by codex, and I overlooked them. nav2.yaml shouldn't change, and I'll revert it back to what it was. Sorry

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refer to comment in scout_mini.xacro about this file

Comment on lines -6 to -12
<xacro:arg name="camera_model" default="zed2" />

<!-- ZED -->
<xacro:include filename="$(find zed_wrapper)/urdf/zed_macro.urdf.xacro" />
<xacro:zed_camera name="$(arg camera_name)" model="$(arg camera_model)" custom_baseline="0.0" enable_gnss="false">
<origin xyz="0 0 0" rpy="0 0 0"/>
</xacro:zed_camera>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break the tf tree on the robot. For real usage we still want to know the transform (even static) from robot to the ZED camera, which has multiple frames for optical and depth.

Comment on lines -26 to +20
<mesh filename="file://$(find scoutmini_description)/meshes/sensors.dae" scale="1 1 1"/>
<box size="0.32 0.18 0.12"/>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can revert it. It was just for slight performance boost at first

Comment on lines -105 to +160
<!-- Add a joint to connect the ZED Camera to the robot -->
<!-- Simulated ZED replacement: a normal forward-facing RGB camera. -->
<link name="$(arg camera_name)_camera_link">
<visual>
<geometry>
<box size="0.09 0.16 0.05"/>
</geometry>
<material name="sim_zed_camera_material">
<color rgba="0.05 0.05 0.05 1.0"/>
</material>
</visual>
<collision>
<geometry>
<box size="0.09 0.16 0.05"/>
</geometry>
</collision>
<inertial>
<mass value="0.15"/>
<origin xyz="0 0 0" rpy="0 0 0"/>
<inertia ixx="0.0001" ixy="0" ixz="0" iyy="0.0001" iyz="0" izz="0.0001"/>
</inertial>
</link>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't remember exactly how xacro and urdf stuff work but could you pass a sim arg to this file and scout_mini.xacro to handle sim stuff separately from robot stuff

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that I initially put this file here but it might be better in a scoutmini_sim package together with the worlds folders from scoutmini_description.

@nhat-m-le nhat-m-le self-assigned this Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants