Configuring the Simulink model

Now that our model is fully connected, we only need to configure and simulate it. Firstly, we need to import the ros_rate module to synchronize the Simulink simulation. In this case, a higher frame rate assures a better behavior, so you can double click on the ros_rate block and set the rate to 100 Hz. Then, open the Model Configuration Parameters by clicking on Simulation | Model Configuration Parameters from the main menu bar of the model window or just type Ctrl + E. A suggested configuration is to use a Fixed-step size solver, specifying the desired step size (we can use 0.01 seconds):

Figure 25: Model configuration ...

Get Mastering ROS for Robotics Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.