Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sea-me-coss/ecu-control
RaspberryPi based ECU for the control of PiRacer
https://github.com/sea-me-coss/ecu-control
can-bus controller piracer pygame raspberrypi
Last synced: 3 months ago
JSON representation
RaspberryPi based ECU for the control of PiRacer
- Host: GitHub
- URL: https://github.com/sea-me-coss/ecu-control
- Owner: SEA-ME-COSS
- License: cc-by-sa-4.0
- Created: 2024-04-22T13:37:15.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-06-17T12:45:35.000Z (7 months ago)
- Last Synced: 2024-10-11T16:41:57.510Z (3 months ago)
- Topics: can-bus, controller, piracer, pygame, raspberrypi
- Language: Python
- Homepage:
- Size: 188 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# About
This repository is for the **ECU-Control** part of the [Autonomous-Driving-System](https://github.com/SEA-ME-COSS/Autonomous-Driving-System) project. The ECU-Control is based on an independent RaspberryPi board and operates a physical PiRacer model vehicle. It controls the throttle and steering of the PiRacer using data received via CAN communication from the [ECU-Core](https://github.com/SEA-ME-COSS/ECU-Core).
# Requirements
- **Ubuntu 20.04**
Install Ubuntu 20.04 for RaspberryPi using RaspberryPi OS Imager.
- **CAN HAT setup**
Follow the instruction of [2-CH CAN FD HAT setup](https://www.waveshare.com/wiki/2-CH_CAN_FD_HAT) and enable **Single SPI Mode**.
- **Python packages**
```bash
pip install piracer-py
pip install python-can
pip install pygame
```# Usage
```bash
# Execute on the ECU-Control
sh can_setup.sh
python3 src/control.py
```(Optional) You can check the CAN communication using keyboard controller.
```bash
# Execute on the ECU-Core
sh can_setup.sh
python3 src/keyboard_controller.py
```When you run the controller, a small pygame window will appear. Click on it and press the WASD keys on the keyboard to operate PiRacer.
# Note
Context of CAN communication
| Message | Purpose | Arbitration ID |
|--------------------|------------------------|----------------|
| **steering** | **Control** | **0x00** |
| **throttle** | **Control** | **0x01** |
| x position | GPS | 0x02 |
| y position | GPS | 0x03 |
| orientation | GPS | 0x04 |
| headunit start | Autonomous driving | 0x05 |# Reference
- [Waveshare PiRacer](https://www.waveshare.com/wiki/PiRacer_AI_Kit)