Kobuki Mobile Robot
ROS2 Based Mobile Robot Control
ROS2 Mobile Robot Motion Control
This project involved the practical implementation of ROS2 based mobile robot control using a Kobuki differential-drive platform.
The work focused on understanding robotic software architectures, ROS2 communication concepts, velocity command generation, and feedback-based control using real robotic hardware. A ROS2-based control workflow was implemented to command the robot through predefined trajectories while utilizing odometry feedback for closed-loop motion control.
Mobile Robot Platform
The experiments were performed using a Kobuki differential drive mobile robot platform with ROS2 compatible control interfaces.
The platform provided access to velocity commands, odometry feedback, and sensor information through ROS2 topics, enabling practical experimentation with robot communication and feedback-based control.
ROS2 Communication Architecture
The robot was controlled using ROS2 publisher–subscriber communication.
Keyboard-based teleoperation commands were converted into velocity messages and published through the /commands/velocity topic. The Kobuki driver node subscribed to these commands, interfaced with the robot base controller, and published sensor and odometry feedback.
The main ROS2 nodes involved were:
-
/kobuki_keyop_node- Generates velocity commands through ROS2 teleoperation -
/kobuki- Kobuki driver node responsible for robot control and sensor feedback
Odometry-Based Motion Control
A custom ROS2 Python controller was implemented to execute predefined trajectories using feedback from the robot’s odometry.
The controller subscribed to the /odom topic to estimate robot position and orientation while publishing velocity commands through /commands/velocity. This enabled distance-based motion control instead of relying only on fixed timing delays.
The implementation involved:
- ROS2 publisher and subscriber communication
- Odometry feedback processing
- Position-based distance estimation
- Orientation extraction from quaternion data
- Closed-loop trajectory execution
The ROS2 communication interfaces were configured as:
self.publisher = self.create_publisher(
Twist,
'/commands/velocity',
10
)
self.subscription = self.create_subscription(
Odometry,
'/odom',
self.odom_callback,
10
)
Robot position and orientation feedback were extracted from odometry messages:
def odom_callback(self, msg):
self.x = msg.pose.pose.position.x
self.y = msg.pose.pose.position.y
q = msg.pose.pose.orientation
siny_cosp = 2.0 * (q.w*q.z + q.x*q.y)
cosy_cosp = 1.0 - 2.0 * (q.y*q.y + q.z*q.z)
self.angle = math.atan2(
siny_cosp,
cosy_cosp
)
Using these motion primitives, the robot was commanded to execute a square trajectory consisting of repeated forward movements and 90-degree turns:
def move_square(self):
for side in range(4):
self.move_forward(0.375)
self.turn(90)
The project provided practical experience with ROS2 nodes, topics, publishers, subscribers, robot drivers, odometry-based feedback control, and real-world operation of a differential-drive mobile robot platform, supporting future work in autonomous navigation and robotic systems.