Robobot architecture: Difference between revisions

From Rsewiki
 
(46 intermediate revisions by the same user not shown)
Line 1: Line 1:
Back to [[Robobot B]]
Back to [[Robobot_B | Robobot]]


== Software block overview ==
== Display and LED-band ==


[[File:robobot-in-blocks-2024.png | 600px]]
=== O-LED display ===
 
[[file:o-led-display-ann.jpg | 500 px]]
 
The primary function of this display is the battery voltage. The AS encoder is not used by Robobot.


Figure 1. The main building blocks.
=== LED-band ===


=== Software building blocks ===
[[file:led-band-annotated.jpg | 750px]]


[[File:robobot-function-blocks.png | 600px]]
The Teensy maintains the LED band. Most LEDs show sensor values. The last 3 LEDs can be set by commands to the Teensy.


Figure 2. The main software building blocks.
== Hardware block overview ==


[[File:robobot-in-blocks-2024.png | 600px]]


==== Base control====
Figure 1. The main hardware building blocks.
The 'base control' block is the 'brain' of the robot.


The base control is an expandable skeleton software that is intended as the mission controller.
== Software building blocks ==
The skeleton includes basic functionality to interface the Teensy board, to interface the digital IO and to communicate with a Python app.


The base control skeleton is written in C++.
[[File:robobot-function-blocks.png | 600px]]


==== Python3 block====
Figure 2. The main software building blocks.  
Vision functions are often implemented using the Python libraries.


The provided skeleton Python app includes communication with the Base control. The interface is a simple socket connection, and the communication protocol is lines of text both ways. The lines from the base control could be e.g. "aruco" or "golf" to trigger some detection og ArUco codes or golf balls.
The blocks marked with a blue dot are available in the repository as source code.
The reply back to the Base control could be "golfpos 3 1 0.34 0.05" for; found 3 balls, ball 1 is at position x=0.34m (forward), y=0.05m (left).


The Python3 block is optional, as the same libraries often are available in C++, and therefore could be implemented in the 'Base control' directly.
==== Mission app====
The mission app block is the robot's top-level controller.


==== IP-disp ====
It can subscribe to data streams from the Teensy interface and command the robot to perform actions (like forward and turn velocity).
It attaches to the camera video stream and connects to the IO board (e.g. the start and stop buttons.


Is a silent app that is started at reboot and has two tasks:
The mission app is in svn/robobot/mqtt_python; its main file is ''mqtt-client.py.''
* Detect the IP net address of the Raspberry and send it to the small display on the Teensy board.
* Detect if the "start" button is pressed, and if so, start the 'Base control' app.


==== Teensy PCB ====
==== Teensy interface ====


The Teensy board is actually a baseboard used in the simpler 'Regbot' robot.
The Teensy interface connects the Teensy USB interface and the MQTT protocol.
This board has most of the hardware interfaces and offers all sensor data to be streamed in a publish-subscribe protocol.
All communication is based on text lines.


==Software architecture==
The Teensy interface further has closed-loop control for forward velocity and implements turn-rate commands.


The software architecture is based on the old NASREM architecture, and this is the structure for the description on this page.
The interface decodes many essential data types and allows these data streams to be logged.
The logged files are text-based and intended for Matlab for analysis and debugging.
See more details in [[Robobot teensy interface]].


The National Aeronautics and Space Administration (NASA) and the US National Institute of Standards and Technology (NIST) have developed a Standard Reference Model Telerobot Control System Architecture called NASREM. Albus, J. S. (1992), A reference model architecture for intelligent systems design.
==== Mosquitto MQTT server ====


[[File:nasrem.png | 700px]]
This Mosquitto server is an open-source MQTT protocol server - see https://mosquitto.org/.
This server is running as a service.


Figure 3. The NASREM model divides the control software into a two-dimensional structure. The columns are software function: Sensor data processing, modelling and behaviour control.
==== Camera streamer====


=== Level 1; Pose and drive control ===
The camera streamer is a small Python app that takes data from the camera and streams the video to socket port 7123.
This means that the stream is also available on Wi-Fi.
See [[Robobot webcam server]] for more details


[[File:robobot_level_1.png | 800px]]
==== IP-disp ====


Figure 4. The lowest level in the control software. The encoder ticks are received from the hardware (from the Teensy board) into the sensor interface. The encoder values are then modeled into an odometry pose. The pose is used to control the wheel velocity using a PID controller.
IP_disp is a silent app that is started at reboot (by ''on_reboot.bash'') and has two tasks:
The desired wheel velocity for each wheel is generated in the mixer from a desired linear and rotational velocity.
* Detect the IP net address of the Raspberry and send it to the small display on the Teensy board (inactive if the Teensy_interface is running.)
* Detect if the "start" button is pressed, and start the mission app.
* Detect if the "start" button is pressed for more than 5 seconds to shut down the robot.


===== Velocity control details =====
==== Digital IO ====


More [[Robobot level 1]] details of the individual blocks.
This is the board on top of the Robobot. It provides digital IO and a power supply for external devices.


=== Level 2; drive select ===
The IO is connected to the Raspberry PI pins GPIO06 (stop), 13 (start), 16, 19, 20, 21, and 26.
See details in [[Robobot circuits]].


[[File:robobot_level_2.png | 800px]]
==== Teensy PCB ====
 
The Teensy board is a baseboard used in the more straightforward 'Regbot' robot.
This board has most of the hardware interfaces and offers all sensor data to be streamed in a publish-subscribe protocol.
All communication is based on clear text lines.


Figure 5. At level 2 further sensor data is received, modeled, and used as optional control sources.
The firmware is in ''svn/robobot/teensy_firmware_8'', compiled with ''./compile'' and uploaded to the Teensy by ''./upload''. NB! An upload will cut the battery power, so press the ''power'' switch during upload.
See details in [[Robobot circuits]].


===== Drive select details =====
== Start buttons (and external power) ==


More [[robobot level 3]] details of the individual blocks.
[[file:start-buttons.png | 600px]]


=== Level 3; behaviour ===
The two start buttons are quite different. The Arduino mission start will start the mission code in the Teensy. The mqtt-client reads the Python mission start.


[[File:robobot_level_3.png | 800px]]
Both buttons can shut down the robot when pressed for 5 seconds.


Figure 6. At level 3, the drive types are used to implement more abstract behaviour, e.g. follow the tape line to the axe-challenge, detect the situation where the axe is out of the way, and then continue the mission.
The digital-io can only be used for a shutdown if a mission is not running (mqtt-client will reserve all IO).


=====More mission behaviour details====
=== External power ===


[[Robobot level 3 details]]
On the digital-io board, there are power pins available for 3V, 5V, and 12V. 12V is the battery voltage, which can vary from 10 to 16V.

Latest revision as of 12:57, 9 February 2025

Back to Robobot

Display and LED-band

O-LED display

The primary function of this display is the battery voltage. The AS encoder is not used by Robobot.

LED-band

The Teensy maintains the LED band. Most LEDs show sensor values. The last 3 LEDs can be set by commands to the Teensy.

Hardware block overview

Figure 1. The main hardware building blocks.

Software building blocks

Figure 2. The main software building blocks.

The blocks marked with a blue dot are available in the repository as source code.

Mission app

The mission app block is the robot's top-level controller.

It can subscribe to data streams from the Teensy interface and command the robot to perform actions (like forward and turn velocity). It attaches to the camera video stream and connects to the IO board (e.g. the start and stop buttons.

The mission app is in svn/robobot/mqtt_python; its main file is mqtt-client.py.

Teensy interface

The Teensy interface connects the Teensy USB interface and the MQTT protocol.

The Teensy interface further has closed-loop control for forward velocity and implements turn-rate commands.

The interface decodes many essential data types and allows these data streams to be logged. The logged files are text-based and intended for Matlab for analysis and debugging. See more details in Robobot teensy interface.

Mosquitto MQTT server

This Mosquitto server is an open-source MQTT protocol server - see https://mosquitto.org/. This server is running as a service.

Camera streamer

The camera streamer is a small Python app that takes data from the camera and streams the video to socket port 7123. This means that the stream is also available on Wi-Fi. See Robobot webcam server for more details

IP-disp

IP_disp is a silent app that is started at reboot (by on_reboot.bash) and has two tasks:

  • Detect the IP net address of the Raspberry and send it to the small display on the Teensy board (inactive if the Teensy_interface is running.)
  • Detect if the "start" button is pressed, and start the mission app.
  • Detect if the "start" button is pressed for more than 5 seconds to shut down the robot.

Digital IO

This is the board on top of the Robobot. It provides digital IO and a power supply for external devices.

The IO is connected to the Raspberry PI pins GPIO06 (stop), 13 (start), 16, 19, 20, 21, and 26. See details in Robobot circuits.

Teensy PCB

The Teensy board is a baseboard used in the more straightforward 'Regbot' robot. This board has most of the hardware interfaces and offers all sensor data to be streamed in a publish-subscribe protocol. All communication is based on clear text lines.

The firmware is in svn/robobot/teensy_firmware_8, compiled with ./compile and uploaded to the Teensy by ./upload. NB! An upload will cut the battery power, so press the power switch during upload. See details in Robobot circuits.

Start buttons (and external power)

The two start buttons are quite different. The Arduino mission start will start the mission code in the Teensy. The mqtt-client reads the Python mission start.

Both buttons can shut down the robot when pressed for 5 seconds.

The digital-io can only be used for a shutdown if a mission is not running (mqtt-client will reserve all IO).

External power

On the digital-io board, there are power pins available for 3V, 5V, and 12V. 12V is the battery voltage, which can vary from 10 to 16V.