Initializing a ROS network

Before running a ROS node, we have to run the roscore command, right? The roscore command will start a ROS master, and other ROS nodes can find each other through it. In MATLAB, instead of the roscore command, we can use the rosinit function to start a ROS master.

Figure 2 : The rosinit function in MATLAB

The rosinit function can start a ROS master and a global node that is connected to the master. Here, we can see that MATLAB itself can act as a ROS master and other nodes can connect to it. We can also connect to a ROS network from MATLAB. We'll cover that in the next section. In such a setup, the ROS master is running on a different system, either on a ROS robot or ROS PC. Let's try some of the ROS commands in MATLAB to list ROS nodes, topics, and all that. The good thing about the MATLAB - ROS interface is that the commands of Robotics Toolbox are similar to the actual ROS bash commands. Let's go through a few commands to list out ROS parameters.

..................Content has been hidden....................

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