Aisprid implementation challenge
Find a file
2024-09-05 15:49:34 +02:00
cfg Add config 2024-09-03 12:55:55 +02:00
doc Add pdf 2024-09-05 09:49:42 +02:00
src Remove unnecessary print 2024-09-05 15:43:56 +02:00
.gitignore Update git ignore for artifacts 2024-09-03 15:56:04 +02:00
go.mod Log motor state with logrus 2024-09-05 10:19:31 +02:00
go.sum Log motor state with logrus 2024-09-05 10:19:31 +02:00
makefile Intial server/client setup of controller 2024-09-03 18:05:41 +02:00
README.md Update readme 2024-09-05 15:49:34 +02:00

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. Beware to set different ports to every motor.

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, if modifying default port, other controllers commands except Port 8080):
    ./motorsim -c ./cfg/motors.yaml controller serve
    

Client usage

Motor controller commands

  • Get joints values:
    ./motorsim -c ./cfg/motors.yaml controller getJoints
    
  • Set joints values:
    ./motorsim -c ./cfg/motors.yaml controller setJoints [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 [Velocity]
    

TODO

  • Closed loop control. Currently, not robust to delay in communications and limited command precision.
  • Share Motor controller server port with other controller commands.
  • Use coroutines for gRPC services callbacks.
  • Fix get Motor State service (Behavior not robust).
  • Send error responses to clients of gRPC services.