This is the minimal example and simple API for Python.
The features shown in this sample are available from iRC V14-001 but the API (AppClient.h) will be updated for the newest feature set. Check the other samples for other features.
-
rcapp.xml- app definition file, this tells RobotControl all it needs to start and integrate your app. -
ui.xml- the UI definition, this is optional if your app does not need user input -
app.py- the main file, starts the app and runs some examples. -
AppClient.py- the basic app client class. Derive this for your own application. -
MinimalApp.py- the example application class. It contains some examples of functions to be called by the robot program and UI event handlers. -
robotcontrolapp_pb2...- these files are generated from theprotos/robotcontrolapp.protodefinition. Do not change these! You can regenerate / update them by callingpython3 -m grpc_tools.protoc -Iprotos --python_out=. --pyi_out=. --grpc_python_out=. protos/robotcontrolapp.proto -
DataTypes - this contains data classes used by
AppClient
To run Python apps you need to install Python 3.7 or newer and GRPC as explained in the GRPC documentation.
Depending on your system you may need to adapt the following commands.
Download Python 3 and install it. Then run the following commands in a command line to install gRPC for Python:
python3 -m pip install --upgrade pip
python3 -m pip install grpcio
python3 -m pip install grpcio-tools
Python is already installed on the embedded robot control. You still need to install gRPC for Python. To do this (temporarily) connect the robot control to the internet (e.g. connect it to a WiFi hotspot), then run the following commands:
sudo apt update
sudo mount -o remount,rw /boot/
sudo apt upgrade
sudo apt install python3-pip
python3 -m pip install --upgrade pip
python3 -m pip install grpcio
python3 -m pip install grpcio-tools
See ui.xml documentation.