What is ROS?
Getting Started with ROS
Controlling the Donkey Car Using ROS Nodes
Utilizing the Donkeycar framework, in theory, should be simple: a direct publisher-subscriber connection should suffice to directly operate and control the Donkeycar. To accomplish this, the following is implemented:
> A publisher node to receive specified keyboard inputs and post them to the controls topic for subscribers to draw from. > A subscriber node to receive values posted to the controls topic and send them to the motors to operate the Donkeycar.
Specified details are described below. All of the following code can be found on GitHub at the following repository:
Main Publisher Node: keyboard_inputs
Our central publisher node is named keyboard_inputs.py, and utilizes Python as the language of operation. This publisher node is organized such that additional keyboard-input features can easily be implemented for future projects.
The backbone of this node is built from the curses library, a powerful set of functions leveraging user keyboard inputs. Please note that this publisher node utilizes the curses library, so if you do not have it downloaded on your RPi (or similarly, if you receive an error stating that "import curses" failed), run the command:
pip install curses
This will install the curses library on your machine.
Documentation for the curses library can be found HERE. We highly recommend taking a look through the various functions available through this library, to understand the scope of its functionality as well as to inspire potential add-ons to the current set of curses functions implemented in our publisher node.
Main Subscriber Node:
NOTE: These nodes DO NOT CURRENTLY WORK. Our team was unable to solve the logistical bug issues that resulted when attempting to run these nodes. Specific errors and their speculated causes are described below.