Controlling a ROS robot from MATLAB

Here is an interesting MATLAB GUI application that uses ROS APIs to remotely control a robot. The final application will look like the following:

Figure 13: MATLAB-ROS application GUI

In this application, we can put in the ROS master IP, port, and the teleop topic of the robot in its GUI itself. When we press the connect button, the MATLAB application will connect to the ROS network. Now, we can move the robot by pressing the Forward, Backward, Left, and Right buttons.

Here is the design block diagram of this application:

Figure 14: MATLAB-ROS application design block diagram

So let's look at how we can build an application like this.

Here are some of the frequently asking questions in ROS-MATLAB interface

  1. How to run multiple ROS nodes in MATLAB?

Yes, we can run multiple ROS nodes in MATLAB. The following command in MATLAB will give you an example to do it.

    >>>openExample('robotics/RunMultipleROSNodesToPerformDifferentTasksExample')
  1. Does MATLAB support launch files?

No, there is no XML kind launch files in MATLAB, but we can start and end nodes in a MATLAB script which will work almost like a launch file.

  1. What features exist in both MATLAB and ROS?

For example plotting data, any recommendations for the use of each?

  1. There are plotting tools available in ROS and MATLAB. The tools such as rqt_gui help to plot different kind of data which are coming as topics. If you want to play with data and its analysis, MATLAB is the good choice.
..................Content has been hidden....................

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