Using MATLAB Robotics System Toolbox and Baxter Simulator
In these next sections, we will explore using MATLAB to publish and subscribe to the Baxter Simulator and control some primary functions of his arms and grippers.
Installing Baxter messages in MATLAB
Baxter has a unique set of ROS messages that are used to communicate with a real Baxter and Baxter Simulator in Gazebo. MATLAB requires that these custom Baxter message and service definitions be processed into ROS custom messages understood by MATLAB.
Locate the ROS packages for Baxter on your computer. If you followed the installation instructions in Chapter 6, Wobbling Robot Arms Using Joint Control, these packages will be located in your Baxter workspace, ~/baxter_ws
.
In the MATLAB command window, type the following command:
>> rosgenmsg('~/baxter_ws/src/baxter_common')
This is the location of Baxter's message files. If your Baxter workspace is in another location, use the absolute path name to the baxter_common
package...