ROS 2 Jazzy | Ubuntu 24.04 | RA305 Robotics Programming
The MentorPi communicates over USB serial via /dev/rrc. A udev rule creates this symlink automatically when the robot is plugged in.
Create the rule:
sudo nano /etc/udev/rules.d/99-rrc.rulesAdd this line:
KERNEL=="ttyACM*", SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d4", SYMLINK+="rrc", MODE="0666", GROUP="dialout"
Reload and apply:
sudo udevadm control --reload-rules
sudo udevadm triggerAdd your user to the dialout group (requires logout/login to take effect):
sudo usermod -a -G dialout piVerify the symlink exists after plugging in the robot:
ls -la /dev/rrcNote: If you see
Permission deniedon/dev/rrcbefore the group change takes effect, runsudo chmod 666 /dev/ttyACM0as a temporary fix.
mkdir -p ~/mentorpi_ws/srccd ~/mentorpi_ws/srcNow clone the repository.
git clone https://github.com/KSU-Chad/rover_ws.git .Note: The trailing
.clones the repo contents directly intosrc/rather than creating a nested subdirectory.
The MentorPi requires a typerc environment file to be sourced before launching. This sets the machine type, lidar type, and other hardware variables that the driver nodes depend on. Without it, odom_publisher will crash on startup.
Source the following in every new terminal you open, in this order:
source ~/mentorpi_ws/src/.typerc
source ~/mentorpi_ws/install/setup.bashcd ~/mentorpi_wscolcon build --symlink-installsource ~/mentorpi_ws/install/setup.bashWait for the build to complete. Fix any errors before proceeding.
Note:
--symlink-installlinks install files directly to source files, so changes to Python nodes and launch files take effect immediately without rebuilding.
The robot motor controller must be plugged in to the RPi via USB before launching Terminal 1.
ros2 launch my_rover launch_robot.launch.pyThis starts three things: the hardware driver (ros_robot_controller), the robot state publisher (TF tree), and the odometry publisher (motor commands + dead-reckoning odom). Leave this running.
rviz2 -d ~/mentorpi_ws/src/my_rover/rviz/view_bot.rvizros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r /cmd_vel:=/controller/cmd_velClick on Terminal 3 to make sure it has focus, then use the keyboard to drive the robot.
Note: The topic remap is required —
odom_publisherlistens on/controller/cmd_vel, not/cmd_vel.
| Terminal | Command |
|---|---|
| 1 | ros2 launch my_rover launch_robot.launch.py |
| 2 | rviz2 -d ~/mentorpi_ws/src/my_rover/rviz/view_bot.rviz |
| 3 | ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r /cmd_vel:=/controller/cmd_vel |
- Controller board must be plugged in before launching —
/dev/rrcwon't exist otherwise - Source
.typercfirst —MACHINE_TYPEmust be set orodom_publishercrashes - Odometry is dead-reckoning only —
odom_publisherestimates position from commanded velocity, not encoder feedback, so drift accumulates over time - Vendor launch files use hardcoded paths — don't call
odom_publisher.launch.pyorrobot_description.launch.pydirectly, they contain/home/localuserpaths that will fail
Kansas State University Salina — Robotics and Autonomous Systems