The Edge Controller is a python Server publishing a REST-API to control the robot.
The Gopigo will turn on the left eye led to signal the running api.
# Install dependencies
pip3 install -r requirements.txt
# Start the server
python3 ./edgehub.pyThe GoPiGo will turn on the left eye LED when the API is running at http://<robot-ip>:5000
GET /- Health checkGET /distance- Distance sensor reading (mm)GET /power- Battery voltage
POST /forward/<cm>- Move forwardPOST /backward/<cm>- Move backwardPOST /left/<degrees>- Turn leftPOST /right/<degrees>- Turn rightPOST /servo/<degrees>- Rotate servo
GET /camera- Get base64-encoded JPEG imageGET /camera.jpg- Get JPEG image
Camera returns HTTP 423 if robot is moving. Movement operations are thread-safe and execute one at a time.
# Move forward 20cm
curl -X POST http://192.168.1.100:5000/forward/20
# Get camera image
curl http://192.168.1.100:5000/camera > image.b64
# Check distance
curl http://192.168.1.100:5000/distancecd /opt/
git clone --depth 1 \
--single-branch \
--branch v2.0.0 \
https://github.com/cloud-native-robotz-hackathon/edge-controller.git
cd edge-controller
cp -v edge-controller.service /etc/systemd/system/
systemctl enable --now edge-controller- Camera issues: Check
/dev/video0exists and permissions - Robot not responding: Verify GoPiGo3 libraries and battery level
- Service logs:
sudo journalctl -u edge-controller.service