This is an adapter between a demo Robot API and a Ditto feature. This adapter is developed to be used with Eclipse Kanto. When it is connected to the local MQTT broker that is being used by Kanto, a cloud connector of your choice will create a digital twin of the robot on the cloud backend.
-
Install dependencies using:
pip3 install -r requirements.txt
-
Depending on your git version you may need to run
git submodule update --init --recursive
-
Install Eclipse Ditto
cd lib/ditto-clients && make install
Before building, you may need to change the platform to match your device.
docker build -t 'your repo'/robot-controller:'tag' .
- [Install eclise Kanto](https://eclipse.dev/kanto/docs/getting-started/install/
- Run the container using minimum configuration and host network.
kanto-cm create -n robot-controller --network host docker.io/'your container repo'/robot-controller:0.0.1
kanto-cm start -n robot-controller
Example using environment variable
kanto-cm create -n robot-controller --network host --e=ROBOT_HOSTNAME=roboendpoint --e=DEVICE_ID="$FQ_DEVICE_ID" docker.io/'your container repo'/robot-controller:0.0.1
Variable | Default | Description |
---|---|---|
LOCAL_MQTT_HOST | localhost | Local MQTT broker host name |
LOCAL_MQTT_PORT | 1883 | Local MQTT broker port |
LOCAL_MQTT_USERNAME | Local MQTT broker username | |
LOCAL_MQTT_PASSWORD | Local MQTT broker password | |
ROBOT_HOSTNAME | localhost | Hostname of the robot's http endpoint |
ROBOT_PORT | 3000 | Port of the robot's http endpoint |
ROBOT_DEFAULT_PROCESS_ID | 1 | Default process which will be triggered on command |
ROBOT_REFRESH_TIMEOUT | 60 | Refresh timeout on which the Ditto feature will be updated |
DEVICE_ID | demo:robot:1.0.0 | Device id which will be used in the robot's feature namespace |
{
"topic": "demo/robot/things/live/messages/request",
"headers": {
"correlation-id": "test",
"content-type": "application/json"
},
"path": "/features/Robo/inbox/messages/request",
"value": {
"program_id": 1,
"iterations": 1,
"velocity": 1
}
}