Mobile robot Cobra Flex with raspberry pi as its main brain communicating via serial with the car.
| Directory | Description |
|---|---|
pi-udp-2-cobra-usb/ |
C++ service running on the RPi — bridges UDP ↔ serial USB |
cobra-client/ |
Python GUI client for sending commands / viewing feedback |
scripts/ |
Utility scripts (serial probing, testing) |
cobra_info/ |
Protocol reference (command list) |
sudo apt-get install cmake g++ libyaml-cpp-dev nlohmann-json3-dev
# For tests:
sudo apt-get install libgtest-devcd pi-udp-2-cobra-usb
mkdir build && cd build
cmake ..
make -j$(nproc)./cobraflex-interface /path/to/config.yamlcd build
cpack
sudo dpkg -i cobraflex-interface-*.debThe service starts automatically. Config lives at /etc/cobraflex/config.yaml.
sudo dpkg -r cobraflex-interface # keeps config
sudo dpkg -P cobraflex-interface # purge (removes /etc/cobraflex)sudo systemctl status cobraflex-interface
sudo systemctl restart cobraflex-interface
sudo journalctl -u cobraflex-interface -f # live logs- Single UDP port (default 5000) for both commands and feedback — feedback replies go to the last client that sent a command.
- Motor commands (
T:1,T:11) are automatically repeated while speed ≠ 0. - See docs/architecture.md for internals.
cd cobra-client
pip install -r requirements.txt # just pyyaml, tkinter is built-in
python3 cobra_client.py
# or with a config:
python3 cobra_client.py --config client_config.yamlSee cobra-client/README.md for details.
sudo raspi-config nonint do_wifi_country SK
sudo nmcli radio wifi on
sudo nmcli dev wifi list
sudo nmcli dev wifi connect "YOUR_SSID" password "YOUR_PASSWORD"run nmcli connection show, you will see something like:
OldWiFi
MyPhone
Wired connection 1
then
sudo nmcli dev wifi connect "NEW_SSID" password "NEW_PASSWORD"
sudo nmcli connection delete "OldWiFi"Or
sudo nmcli connection add type wifi con-name "LabWiFi" ifname wlan0 ssid "LabWiFi"
sudo nmcli connection modify "LabWiFi" wifi-sec.key-mgmt wpa-psk
sudo nmcli connection modify "LabWiFi" wifi-sec.psk "labpassword123"
sudo nmcli connection modify "LabWiFi" connection.autoconnect yessudo nmcli dev wifi rescan # When cant connect to wifi
nmcli dev wifi list # List wifis TODO: from different pc