multi-motors-controller/README.md

44 lines
1.7 KiB
Markdown
Raw Permalink Normal View History

2024-09-05 11:54:34 +02:00
# Multi motor controller
Simulation of a multi-motor controller for [Aisprid technical challenge](doc/Aisprid_ingenieur_robotique_challenge_technique.pdf).
## Compile
In root directory, call `make` to generate binary file. To clean up, call `make clean`.
## Usage
### Configure simulation
2024-09-05 15:49:34 +02:00
- Edit [config file](./cfg/motors.yaml) with simulation parameters. This file should be provided to every commands. Beware to set different ports to every motor.
2024-09-05 11:54:34 +02:00
### Servers startup
1. Start Motor servers (with valid IDs from [config file](./cfg/motors.yaml)):
```bash
./motorsim -c ./cfg/motors.yaml motor --id [ID] serve
```
2024-09-05 15:49:34 +02:00
2. Start Motor controller server (Beware, if modifying default port, other controllers commands except Port 8080):
2024-09-05 11:54:34 +02:00
```bash
2024-09-05 15:39:17 +02:00
./motorsim -c ./cfg/motors.yaml controller serve
2024-09-05 11:54:34 +02:00
```
### Client usage
#### Motor controller commands
- Get joints values:
```bash
./motorsim -c ./cfg/motors.yaml controller getJoints
```
2024-09-05 15:39:17 +02:00
- Set joints values:
2024-09-05 11:54:34 +02:00
```bash
2024-09-05 15:39:17 +02:00
./motorsim -c ./cfg/motors.yaml controller setJoints [Joint goals]
2024-09-05 11:54:34 +02:00
```
#### Motor commands
Every command should be provided with valid ID from [config file](./cfg/motors.yaml):
- Listen motor state:
```bash
./motorsim -c ./cfg/motors.yaml motor --id [ID] listen
```
- Set motor velocity:
```bash
2024-09-05 15:49:34 +02:00
./motorsim -c ./cfg/motors.yaml motor --id [ID] moveVel [Velocity]
2024-09-05 11:54:34 +02:00
```
## TODO
2024-09-05 15:49:34 +02:00
- [ ] Closed loop control. Currently, not robust to delay in communications and limited command precision.
- [ ] Share Motor controller server port with other controller commands.
2024-09-05 14:32:01 +02:00
- [ ] Use coroutines for gRPC services callbacks.
- [ ] Fix get Motor State service (Behavior not robust).
2024-09-05 15:39:17 +02:00
- [ ] Send error responses to clients of gRPC services.