Serial data sending protocol from PC to Launchpad

For the motor, the protocol will be as follows:

s<space><pwm_value_of_motor_1><space><pwm_value_of_motor_2>

For resetting the device, the protocol will be as follows:

r<space>

We can check the serial values from the LaunchPad using a command-line tool called miniterm.py. This tool can view the serial data coming from a device. This script is already installed with the python-serial package, which is installed along with the rosserial-python Debian package. The following command will display the serial values from the robot controller:

$ miniterm.py /dev/ttyACM0 115200  

We will get values such as these shown in the following screenshot:

Figure 4: Checking serial data using miniterm.py

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.