ROS2 Node for controlling a JetBot via ROS Control interfaces.
From a WaveShare JetBot robot, clone this repository and open it over SSH. Install the Dev Containers extension and allow it to build the Docker container and open the workspace in that container.
Then build the code using colcon build
from the workspace root:
source /opt/ros/humble/setup.bash
colcon build
Once built, you can run the test function to check that the library can be loaded correctly as follows:
source install/setup.bash
./build/jetbot_control/test_jetbot_system
The test should pass with log messages showing a successful initialization of the control library.
Once built, it should be possible to launch the jetbot controller using the provided launch file. Note that this will only run on a JetBot with the i2c-1 bus available.
source install/setup.bash
ros2 launch jetbot_control jetbot.launch.py
After this, the robot will respond to commands sent with TwistStamped
type sent on the /cmd_vel
topic.
If you want to run mock hardware for any reason, such as not having a JetBot to run the code on, you can enable the flag as follows:
ros2 launch jetbot_control jetbot.launch.py use_mock_hardware:=true
The code in this repository is covered by the MIT license in the LICENSE file. However, four files are included from the ros2_control_demos repository, and so are covered by the ROS2_CONTROL_LICENSE file instead. These four files are as follows: