Przejdź do treści

Robotic Programming Environments: L9-L10

Mobile robot simulation in ROS 2 (0-20 points)


Design and implement a system that simulate and control simple mobile robot.


Create a system that will simulate motion of the unicycle mobile robot

\left\{\begin{array}{rcl} \dot{x} & = & \cos{\phi}\cdot u_1,\\ \dot{y} & = & \sin{\phi}\cdot u_1,\\ \dot{\phi} & = & u_2,\end{array}\right.

x, y, \phi represent the pose of the robot (position and orientation),
u_1 is the linear velocity control signal,
u_2 is the angular velocity control signal.

The diagram shows an example system (in the simplest case, open-loop control)

Mobile robot simulator

This node should calculate the consecutive states of the robot assuming received control values. If there is no control value in the specific time point, it should assume control values equal to 0 and publish new state.


It should generate controls functions for the mobile robot simulator. Control values should include parameters for linear velocity (u_1) and angular velocity (u_2). Consider using geometry_msgs/Twist message as the output from the controller.

The possible extension could be adding the closed-loop controller (with trajectory generator).


  • Assume that the robot is moving on the XY plane and z is equal to 0.
  • Assume that at the beginning robot is placed in point (0,0,0).
  • Publish trajectory of the robot as a series of geometry_msgs/PoseStamped messages.
  • Publish the robot pose also with tf2 as a transformation between world and base_link frame. You can assume that the world frame is constant.
  • Visualize the path and frames in rviz (alternatively in foxglove).
  • The simulated robot should move in a meaningful way, for example, along a square.
  • Create a new ROS 2 package for your robot simulation project.
  • Create a launcher (Python based launcher) that will start all nodes and load parameters from a YAML files. The system should be started with single command.
    ros2 launch package_name launcher_name
  • Document your code!