TF|URDF|RViz|Gazebo - Kraft2k/icebox-rover GitHub Wiki

sudo apt install ros-humble-urdf-tutorial

sudo apt install ros-humble-tf2-tools

cd /opt/ros/humble/share/urdf_tutorial/urdf

ros2 launch urdf_tutorial display.launch.py model:=08-macroed.urdf.xacro

Generating graph in frames.pdf

ros2 run tf2_tools view_frames

Build only package ercole_description

colcon build --packages-select ercole_description --symlink-install


in first terminal

~ros2_ws/src/ercole_description/urdf$ ros2 run robot_state_publisher robot_state_publisher --ros-args -p robot_description:="$(xacro ercole.urdf.xacro)"

in second terminal

ros2 launch gazebo_ros gazebo.launch.py

in third terminal

ros2 run gazebo_ros spawn_entity.py -topic robot_description -entity ercole


Launch all

ros2 launch ercole_bringup ercole_gazebo.launch.xml


Control the rover in Gazebo

ros2 topic pub /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.5}, angular: {z: 0}}"

or

ros2 run teleop_twist_keyboard teleop_twist_keyboard

Run model in RVIZ

rviz2 -d ros2_ws/src/ercole_description/rviz/main.rviz


Launch simulation mode

ros2 launch ercole_description launch_sim.launch.py world:=./src/ercole_description/worlds/obstacles.world

Launch real rover

ros2 launch ercole_description launch_ercole.launch.py


Robot navigation with NAV2

in first terminal

ros2 run twist_mux twist_mux --ros-args --params-file ./src/ercole_description/config/twist_mux.yaml -r cmd_vel_out:=diff_cont/cmd_vel_unstamped

in second terminal

ros2 launch ercole_description launch_sim.launch.py world:=./src/ercole_description/worlds/obstacles.world

in third terminal

ros2 launch slam_toolbox online_async_launch.py params_file:=./src/ercole_description/config/mapper_params_online_async.yaml use_sim_time:=true

Test joystisck

ros2 launch ercole_description test_joystick.launch.py

ros2 run nav2_map_server map_saver_cli -f obstacles_map

ros2 run nav2_map_server map_server --ros-args -p yaml_filename:=my_map_save.yaml -ros2 run nav2_map_server map_saver_cli -f obstacles_mapp use_sim_time:=true

ros2 run nav2_util lifecycle_bringup map_server

References

https://classic.gazebosim.org/tutorials?tut=ros_gzplugins

https://github.com/ros-simulation/gazebo_ros_pkgs