Droid Control Ship
An ESP32 networking project.
Parts and sourceBefore you start
Confirm board compatibility and supported firmware targets in the upstream documentation.
Upstream README
Droid Control Ship - Firmware for ZumoComSystem
The Droid Control Ship is the firmware running on the ZumoComSystem hardware, which is a shield for the Pololu 32U4 Zumo robot.
It provides different kind of exclusive applications, used for educational purposes:
- Convoy Leader Robot - Based on odometry information, it leads the followers to follow like a lemming trail.
- Convoy Follower Robot - It follows the leader by mainly reacting on the received information.
- Remote Control - Receives commands and motor speeds from an external source through MQTT.
- Turtle - A ROS2 robot controller that uses Twist messages like the ROS2 TurtleSim demo.
- Line follower - Follows a track by a black line until the start/end line is passed twice.
- LineFollowerSensorFusion - Follows a black line and combines odometry, IMU and SpaceShipRadar data to estimate the robot's pose and velocity.
- SensorFusion - Estimates the robot's position from odometry and IMU data.
- Slam - Exchanges robot telemetry and velocity commands with a TCP server.
- Commissioning - Exercises the board peripherals in an observable way for hardware bring-up and validation.
- Test - Provides an application stub for the native test environment.
Table of content
- The ZumoComSystem Shield
- The simulation
- The target
- The Applications
- Documentation
- Used Libraries
- Issues, Ideas And Bugs
- License
- Contribution
The ZumoComSystem Shield

It supports running in the Webots simulation too.
The Droid Control Ship communicates with the Radon Ulzer, which is the firmware running on the Pololu Zumo32U4 robot.
The simulation
The simulation is based on the open source robot simulator Webots. The application and the services are equal to the target firmware. Only the HAL is different in the simulation.
Installation for simulation
- Install the native compiler toolchain:
- Linux
- Install the gcc toolchain, depended on your distribution.
- Install libmosquitto-dev, depended on your distribution.
- Windows
- Install the MSYS2 toolchain.
- Open MSYS2 shell.
- Update package database:
pacman -Sy pacman - Install GCC:
pacman -Sy mingw-w64-ucrt-x86_64-gcc - Install Mosquitto:
pacman -Sy mingw-w64-ucrt-x86_64-mosquitto - Install OpenSSL:
pacman -S mingw-w64-ucrt-x86_64-openssl
- Update package database:
- Linux
How to start?
After you built the application, you will find it in .pio/build/<APPLICATION-NAME>/program[.exe]. It provides several command line arguments to configure certain features. Use -h or --help to get a short user friendly overview about them.
The applications are using a configuration file in JSON format to retrieve certain settings. In the very first run, such a configuration file will be automatically be created. If there exists already one, it will be loaded without modifications (regardless of any other program arguments).
The DroidControlShip will always try to connect to RadonUlzer, therefore its important to have the RadonUlzer executable started first! And because the RadonUlzer executable will always connect to the Webots simulation, it shall run as well having a corresponding world loaded.
Some applications require to have an MQTT server running, but it may depend on the kind of application you choose.
A complete deployment, including MQTT server, would be started in the following way:
MQTT Broker --> Webots World --> RadonUlzer --> DroidControlShip
In order to simplify this process, the Launcher project is under active development.
Run
There are 3 ways how to run now the application. Choose according to your needs.
Run with Webots launcher (recommended)
The Webots launcher is recommended to connect to the simulation.
It is mandatory if the simulation contains more than one robot. The robot is identified by its name. Adapt the robot name in the platformio_override.ini, see webots_robot_name.
The Webots documentation has more details about Single Simulation and Multiple Local Extern Robot Controllers.
It is mandatory too if the simulation does not run locally (e.g. Webots runs on windows host and RadonUlzer in WSL). Set the IP address and the port in platformio_override.ini, see webots_ip_address and webots_protocol.
Use ipc as webots_protocol for local connections and tcp for remote connections.
| Key | Description |
|---|---|
| webots_ip_address | The IP address of the Webots simulation, which is used for TCP communication. |
| webots_protocol | [ipc|tcp] - ipc is faster but only works on the same machine, tcp works also over network. |
| webots_robot_name | The robot name used to identify the robot in the Webots world. See Webots world robot prototype. |
PlatformIO project tasks --> <APP-NAME> --> Custom --> Launch
Run without Webots launcher
This can be chosen in case the simulation waits just for one robot.
PlatformIO project tasks --> <APP-NAME> --> General --> Upload
Run via terminal
- Open a command line (shell) and change to the folder with the built executable in
.pio/build/<APPLICATION-NAME>. This folder contains all necessary shared libraries as well. - Start the
program[.exe]executable.
The target
The main target of the firmware is the ZumoComSystem from NewTec GmbH, which is a shield for the Pololu 32U4 Zumo robot.
Together with Radon Ulzer it can be run in the Webots simulation too.
Installation for target
- Make sure that the hardware version of your ZumoComSystem is supported. Currently, v1 (v1.1 and v1.2), v2 and v3 are supported. Select the hardware version in the
[target:esp32]section ofplatformio.ini. - Install the drivers for the CP2102 USB-UART converter if required. The "CP210x Universal Windows Driver" is recommended, as it enables the automatic bootloader mode.
Build and flash procedure
- Build the firmware using the
Buildtask in the "PlatformIO Project Tasks"- For the target use only the applications with "Target" as postfix, e.g. LineFollowerTarget.
- Upload the firmware to the ZumoComSystem using the
Uploadtask in the "PlatformIO Project Tasks" tab, or the arrow on the bottom task bar. - After successfully uploading the firmware, the configuration has to be uploaded to the filesystem. Make sure that the information in
data/config/config.jsonmatches your setup. Upload the configuration using theUpload Filesystem Imagetask in the "PlatformIO Project Tasks" tab.
Note that the robotName can be left empty in case you want the MAC address of the hardware to be used as the name. In case you prefer to give the robot a more descriptive name, can set the name. Beware, if you use multiple robots, you will have to give each a different name manually.
In a similar way, not providing a WiFi configuration will force the target into going into Access Point Mode. In a future update it will be possible to update the WiFi credentials using this mode and an on-board web server.
The Applications
| Application | Standalone | Zumo32U4 Robot Required | RadonUlzer Application | MQTT Broker Required |
|---|---|---|---|---|
| Commissioning | Yes | No | N/A | No |
| ConvoyLeader | No | Yes | ConvoyLeader | Yes |
| ConvoyFollower | No | Yes | RemoteControl | Yes |
| LineFollower | No | Yes | RemoteControl | No |
| LineFollowerSensorFusion | No | Yes | RemoteControl | Yes |
| RemoteControl | No | Yes | RemoteControl | Yes |
| SensorFusion | No | Yes | SensorFusion | Yes |
| Slam | No | Yes | RemoteControl | No (TCP server required) |
| Test | Yes | No | N/A | No |
| Turtle | No | Yes | RemoteControl | No (ROS2 + Micro-ROS Agent required) |
Documentation
Used Libraries
| Library | Description | License |
|---|---|---|
| Arduino-ESP32 | Arduino framework for ESP32 targets. | LGPL-2.1 |
| ArduinoEigen | Eigen linear algebra library for Arduino, used by sensor fusion. | MPL-2.0 |
| ArduinoJson | JSON handling. | MIT |
| ArduinoNative | Arduino interfaces for native simulation and tests. | MIT |
| micro_ros_platformio | PlatformIO integration for micro-ROS on the Turtle target. | Apache-2.0 |
| Mosquitto | MQTT client library used by the simulation. | EPL-2.0 OR BSD-3-Clause |
| NTPClient | NTP client declared for the LineFollowerSensorFusion target. | MIT |
| PlatformIO | Cross-platform build and development tooling. | Apache-2.0 |
| PlatformIO Espressif 32 | PlatformIO platform package for ESP32 targets. | Apache-2.0 |
| PubSubClient3 | MQTT publish/subscribe client for ESP32 targets. | MIT |
| SerialMuxProt | Multiplexing communication protocol. | MIT |
| USB_Host_Shield_2.0 | USB host controller driver; a fork of the original with endpoint fixes. | GPLv2 |
| Webots | Robot simulation and controller API. | Apache-2.0 |
Issues, Ideas And Bugs
If you have further ideas or you found some bugs, great! Create a issue or if you are able and willing to fix it by yourself, clone the repository and create a pull request.
License
The whole source code is published under the MIT license. Consider the different licenses of the used third party libraries too!
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any additional terms or conditions.