Robobot 4: Difference between revisions

From Rsewiki
Line 15: Line 15:
Change the IP address in the script <code>mqtt-client.py</code> to match your robot (in the bottom of the file, <code>localhost</code> should do). Then execute the script by:  
Change the IP address in the script <code>mqtt-client.py</code> to match your robot (in the bottom of the file, <code>localhost</code> should do). Then execute the script by:  


  python3 mqtt-client.py -n
  python3 mqtt-client.py


The parameter "-n" tells the app to start now, i.e., without waiting for a start button (see 'python3 mqtt-client.py --help' for other options).
This should do the same as pressing the start button.


This should do the same as pressing the start button.
The app can take parameters, try
python3 mqtt-client.py --help
  -h, --help            show this help message and exit
  -w, --white          Calibrate white tape level
  -i, --hostIP HOSTIP  Set host IP, default is localhost
  -g, --gyro            Calibrate gyro
  -l, --level          Calibrate horizontal (not implemented, but maybe an idea)
  -s, --silent          Print less to console
  -n, --now            Start drive now (do not wait for the start button)
  -m, --meter          Drive 1 m and stop
  -p, --pi              Turn 180 degrees (Pi) and stop
  -e, --edge            Find line and follow the left edge
  -u, --usestate USESTATE
                        set mission state to this value


For further details, see [[Robobot MQTT-client]].
For further details, see [[Robobot MQTT-client]].

Revision as of 13:15, 1 February 2026

Back to Robobot

Start the robot

At the competition, the robot must be started using the start button.

Press the start button (be prepared that the wheels will turn after a few seconds (to load the Python app).

Start from the command line

With a SSH connection to the robot, navigate to the directory with the Python app:

cd svn/robobot/mqtt_python

Change the IP address in the script mqtt-client.py to match your robot (in the bottom of the file, localhost should do). Then execute the script by:

python3 mqtt-client.py

This should do the same as pressing the start button.

The app can take parameters, try

python3 mqtt-client.py --help
 -h, --help            show this help message and exit
 -w, --white           Calibrate white tape level
 -i, --hostIP HOSTIP   Set host IP, default is localhost
 -g, --gyro            Calibrate gyro
 -l, --level           Calibrate horizontal (not implemented, but maybe an idea)
 -s, --silent          Print less to console
 -n, --now             Start drive now (do not wait for the start button)
 -m, --meter           Drive 1 m and stop
 -p, --pi              Turn 180 degrees (Pi) and stop
 -e, --edge            Find line and follow the left edge
 -u, --usestate USESTATE
                       set mission state to this value

For further details, see Robobot MQTT-client.