Running the application

You can load your own application or the application that came along with the section. Here's how to run the application:

Figure 19: Running MATLAB application

First, you have to click on the Browse button, marked 1, to go to the application folder. If you are in the application folder, you can see the application files listed in the folder marked 2. After obtaining the files, double-click on the application file, which will pop up in the editor, and click on the Run button, marked 3.

Now, you will get the GUI and can fill the input arguments. After filling it all in, press the Enter key; only then it will give the value to the main code. You can fill the form like shown in the following screenshot. You can see the main GUI entries here.

Figure 20: Running the MATLAB application

Before connecting to the ROS robot, confirm whether robot or robot simulation is running on the ROS PC. For doing a test, you can start a TurtleBot simulation on the ROS PC using the following command:

    $ roslaunch turtlebot_gazebo turtlebot_world.launch

The teleop topic of TurtleBot is /cmd_vel_mux/input/teleop, which we have already provided in the application.

After starting the simulation, you can connect to the MATLAB application by pressing the Connect to Robot button. If the connection is successful, you can see that the robot is moving when you press the corresponding buttons, as shown here:

Figure 21: Controlling a robot in a ROS network

You can echo the command velocity topic using the following command:

    $ rostopic echo /cmd_vel_mux/input/teleop

After working with the robot, you can press the Disconnect button to disconnect from the ROS network.

    You can clone the book code using the following command
    $ git clone https://github.com/qboticslabs/ros_robotics_projects
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.28.48