The package was made using ROS2 Humble
You need to have installed:
- ros-xacro:
sudo apt install ros-<ros2-distro>-xacro
- ros-joint-state-publisher:
sudo apt install ros-<ros2-distro>-joint-state-publisher-gui
- gazebo-ros:
sudo apt install ros-<ros2-distro>-gazebo-ros-pkgs
To build the packages in this repository follow these steps:
cd
into an existing or create a new workspacemkdir -p skidbot_ws/src
- clone this repository in the
src
folder of your workspacecd skidbot_ws/src
git clone https://github.com/odobot/ROS2-SKID-STEER-DRIVE-ROBOT.git
- Naviage back to the workspace folder
cd ../
- build the workspace using the colcon build tool
colcon build --symlink-install
- source the
setup.bash
filesource install/setup.bash
- You can add the
setup.bash
file on the bashrc script file, just open the file and add it at end:gedit ~/.bashrc
source ~/skidbot_ws/install/setup.bash
To view the urdf in rviz open 3 terminals:
On the first terminal (needs to the terminal you sourced your setup.bash file in) type:
ros2 launch skid_bot rsp.launch.py
Second terminal
rviz2
third terminal
ros2 run joint_state_publisher_gui joint_state_publisher_gui
To view and control the robot in gazebo:
Run:
ros2 launch skid_bot launch_sim.launch.py
ros2 run teleop_twist_keyboard teleop_twist_keyboard
Gazebo_skidbot.mp4
Run:
ros2 launch skid_bot launch_sim.launch.py world:=<path to the custom world>
Viewing the robot in gazebo and get its relative position to the centre using Rviz
Run:
ros2 launch skid_bot launch_sim.launch.py
ros2 run teleop_twist_keyboard teleop_twist_keyboard
rviz2