multi-motors-controller/README.md
2024-09-05 14:32:01 +02:00

1.7 KiB

Multi motor controller

Simulation of a multi-motor controller for Aisprid technical challenge.

Compile

In root directory, call make to generate binary file. To clean up, call make clean.

Usage

Configure simulation

  • Edit config file with simulation parameters. This file should be provided to every commands.

Servers startup

  1. Start Motor servers (with valid IDs from config file):
    ./motorsim -c ./cfg/motors.yaml motor --id [ID] serve
    
  2. Start Motor controller server (Beware, controllers commands except Port 8080):
    ./motorsim -c ./cfg/motors.yaml controller serve -p 8080
    

Client usage

Motor controller commands

  • Get joints values:
    ./motorsim -c ./cfg/motors.yaml controller getJoints
    
  • Set joints values (Beware, currently set the same values for all joints):
    ./motorsim -c ./cfg/motors.yaml controller setJoints --j [Joint goals]
    

Motor commands

Every command should be provided with valid ID from config file:

  • Listen motor state:
    ./motorsim -c ./cfg/motors.yaml motor --id [ID] listen
    
  • Set motor velocity:
    ./motorsim -c ./cfg/motors.yaml motor --id [ID] moveVel --vel [Velocity]
    

TODO

  • Closed loop control.
  • Share Motor controller port with controller commands.
  • Use coroutines for gRPC services callbacks.
  • Fix get Motor State service (Behavior not robust).
  • Fix Controller SetJoint command CLI omitting multiples input values.
  • Complete CLI help messages.