|
| |
|
In my example of the Remote Robot Control project, I have a Raspberry Pi computer to manage overall control of the robot, the OpenCV camera and the connection to the outside world via the Internet. There is an Arduino (either Uno or Mega and possibly even Nano) to manage control of the motors and sensors. The type of Arduino used will basically depend on how many GPIO pins will be required for the sensors installed.
|
| |
|
| |
|
A Raspberry Pi computer will be running Python to display a graphical user interface and the feed from an on-board camera to help in driving the robot. In this project, I will use the tKinter program built into Python to provide the graphical user interface. It provides standard widgets for text, buttons, etc. to build an interface quickly and easily.
|
| |
|
An Arduino computer will be running a C program to control the motors and connect to any attached sensors. The Arduino will be expecting commands defined in the DPRG Remote Robot Control API.
|
| |
|
These two computers will communicate with each other via serial interface over a USB cable plugged into one of the USB ports on the Raspberry Pi and plugged into the USB port on the Arduino. The Raspberry Pi will send commands to the Arduino to tell it how to use the motors to move the robot and also to move the on-board camera via servo motors. The Arduino will follow the movement commands from the Raspberry Pi and will return information received from any object avoidance or other sensors, to be displayed in the Raspberry Pi’s user interface.
|
| |
|
For a Telepresence robot, there will be a phone or tablet installed which will handle transmission of video and audio between the remote users and the users local to the robot.
|
| |
|
RealVNC will be used by the remote user to connect to the Raspberry Pi computer to access the computer desktop. There will be a graphic program running on the Pi’s desktop (in this example created in tKinter) which will provide a camera view, buttons and other controls for commanding the remote robot. The response of the camera feed over the Internet using RealVNC is remarkably fast, almost real time. Note: Keep the video resolution of the Raspberry Pi desktop as low as possible (640x480). This will make the response of the on-board camera video feed the best it can be.
|
| |
|
Python Program Running on the Raspberry Pi
|
| |
|
As mentioned earlier, the Raspberry Pi will be running a graphical user interface (GUI) on its desktop written in tKinter to provide commands to the Arduino computer which actually controls the robot’s movement.
|
| |
|
This program will consist of a panel of widgets to control the robot and a panel to display a video feed from an on-board camera to assist the remote user in seeing what is in front of the remote robot.
|
| |
|
In my example program, the control panel has three tabs which break the control widgets into groups: Movement Control, Behaviors, and Queries. In addition, there will be a surrounding group of text labels around these tabs which will display distance information from the object avoidance sensors, to help prevent the user from colliding with things.
|
| |
|
| |
|
The first tab will contain various groups of buttons to allow the user to select the direction the robot should move, set the current speed, and provide a means of pan and tilt of the camera. Direction buttons will include Forward, Left, Right, and Backward. Speed control is achieved with a slider control. Camera pan and tilt buttons will include Up, Left, Right and Down. When one of these controls is clicked, a standard API command will be sent over the serial interface to the Arduino, which will carry out the command by sending the proper information to the correct GPIO pin to control the selected hardware.
|
| |
|
Note: When complying with movement commands, the remote robot will also be monitoring its on-board object avoidance sensors and may determine that it needs to override the user issued movement command and STOP, reporting the problem which caused the stop back to the user via the controlling computer.
|
| |
|
| |
|
Behaviors are combination type commands that probably will require multiple steps, such as GOTO a pre-determined location by using autonomous logic rather than a step by step forward, turn sequence of commands. Another possible behavior might be FIND, where the robot is directed to roam about the area, searching for a specific person is facial recognition is available on the robot.
|
| |
|
The Raspberry Pi will be responsible for breaking the actions required to complete a behavior down into specific commands and issuing those commands to the Arduino as required.
|
| |
|
Other possible behaviours are: Raise Hand - to signal that you need attention, or Help - to display information to the user about the system.
|
| |
|
Behaviors are specialized commands which will be somewhat unique to each remote computer. Not every computer will be programmed to carry out all behaviors defined in the DPRG Remote Control API.
|
| |
|
| |
|
The user will have a pre-determined set of queries that can be issued to determine the current state or other information from either the Raspberry Pi or Arduino computers. An example might be BATTERY which would return the current charge of the robot batteries.
|
| |
|
C Program Running on the Arduino
|
| |
|
The Arduino computer will be running a program loop that basically listens to a serial interface waiting for commands and also queries each of its on-board sensors for their current status. If a command is received via the serial interface or from the on-board IR control sensor, the Arduino will then attempt to carry out the received command. The loop finishes with the Arduino collecting the status of all sensors into an encoded string to return over the serial interface to the controlling Raspberry Pi.
|
| |
|
| |
|
I am still working on the code for the Raspberry Pi and the Arduino. I will be posting blogs on each of these programs as part 2 and 3 of this series, hopefully soon.
|
| |