Created Gazebo Simulation for Scout Mini (with Nav2 capabilities)#3
Created Gazebo Simulation for Scout Mini (with Nav2 capabilities)#3InfinityJuice wants to merge 10 commits into
Conversation
|
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
left a comment
There was a problem hiding this comment.
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.
| <!-- <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> --> |
There was a problem hiding this comment.
Briefly explain why we are not using these 2 plugins.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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" ?> | |||
There was a problem hiding this comment.
add a brief summary about the purpose of this file at the top
| plugin: "nav2_smac_planner/SmacPlanner2D" | ||
| plugin: "nav2_smac_planner::SmacPlanner2D" |
There was a problem hiding this comment.
revert this change as ROS Humble has not fully switched to :: syntax
| path_handler_plugins: ["PathHandler"] | ||
| path_handler: | ||
| plugin: "nav2_controller::FeasiblePathHandler" |
There was a problem hiding this comment.
Why are we removing this?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
refer to comment in scout_mini.xacro about this file
| <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> |
There was a problem hiding this comment.
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.
| <mesh filename="file://$(find scoutmini_description)/meshes/sensors.dae" scale="1 1 1"/> | ||
| <box size="0.32 0.18 0.12"/> |
There was a problem hiding this comment.
I can revert it. It was just for slight performance boost at first
| <!-- 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> | ||
|
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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
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