Writing a ROS Python driver for ChefBot

After uploading the embedded code to LaunchPad, the next step is to handle the serial data from LaunchPad and convert it to ROS topics for further processing. The launchpad_node.py ROS Python driver node interfaces Tiva-C LaunchPad with ROS. The launchpad_node.py file is in the script folder, which is inside the ChefBot_bringup package. The following is an explanation of the important code sections of launchpad_node.py:

#ROS Python client import rospy import sys import time import math #This python module helps to receive values from serial port which execute in a thread from SerialDataGateway import SerialDataGateway #Importing required ROS data types for the code from std_msgs.msg import Int16,Int32, ...

Get Learning Robotics using Python - 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.