Now that we have learned how to interface Simulink and ROS, we can try to implement a more complex system that is able to control a real or simulated robot. We will continue to work with the Turtlebot robot simulated in Gazebo, and we will see how to control its orientation in order to bring it to a desired value. In other words, we will implement a control system that will measure the orientation of the robot using its odometry, comparing this value with the desired orientation and obtaining the orientation error. We will use a PID controller to calculate the velocity to actuate the robot to reach the final desired orientation, setting the orientation error to zero. This controller is already available in Simulink, so we don't need to implement it by ourselves. Let's start to discuss all the elements of our model:
Developing a simple control system in Simulink
Figure...