Robobot MQTT-client: Difference between revisions

From Rsewiki
Line 16: Line 16:
  python3 mqtt-client.py
  python3 mqtt-client.py


All the interfaces, except the GPIO (General Purpose Input Output), have a network interface.  
All the interfaces have a network interface except the GPIO (General Purpose Input Output).  
This allows the app to run anywhere with network access to the robot.
This allows the app to run anywhere with network access to the robot.



Revision as of 18:10, 18 January 2025

Back to Robobot_B

MQTT-client in Python

This skeleton is intended as the mission controller app.

mqtt-client.py

This is the primary file in the mission control skeleton.

It is intended to run on the Raspberry Pi, using the command:

cd ~/svn/robobot/mqtt_python
python3 mqtt-client.py

All the interfaces have a network interface except the GPIO (General Purpose Input Output). This allows the app to run anywhere with network access to the robot.

Command line parameters

The app has defined a few command line parameters, among these help:

python3 mqtt-client.py --help
% Starting
usage: mqtt-client.py [-h] [-w] [-g] [-l] [-s] [-n]
Robobot app 2024
options:
 -h, --help    show this help message and exit
 -w, --white   Calibrate white tape level
 -g, --gyro    Calibrate gyro
 -l, --level   Calibrate horizontal
 -s, --silent  Print less to console
 -n, --now     Start drive now (do not wait for start button)

The command line options include some sensor calibration. The distance sensor calibration is missing (but needed).

Main loop

The