An attempt at fiddling together a distributed infrastructure similar to ROS
Fucking hell if my fucking job's software wasn't broken by default it would be easier to tell what was causing it to be broken in some cases.
Oh adding the build files for tfex would be good
Playin' with Matrex

heads

tip
browse log

clone

read-only
https://hg.sr.ht/~icefox/goatherd
read/write
ssh://hg@hg.sr.ht/~icefox/goatherd

#What is this

...For sheep are stupid, and have to be driven. But goats are intelligent, and need to be led.

-- Terry Pratchett

ROS is basically a distributed actor system. This code is just me playing with making something like that in Rust Erlang. Though ROS is a library, a set of tools, all sorts of stuff, and right now I'm just messing with a program.

Goals:

  • Able to fly a drone around in some kind of simulation (Gazebo?)
  • Integrate C/C++/Rust numerical code as necessary for heavy lifting
  • Supervisor/monitor structure to automatically restart things that fail
  • Fuzzing that injects failures, crashes nodes, etc.
  • Sequencing and dependencies for startup
  • Ability to easily record and replay message logs, with timing information
  • Basic TF tree

Non-goals:

  • Distributed operation on multiple systems at the same time
  • GCS running the erlang shell or such as part of the same cluster
  • General purpose tool for robotics
  • Hard real time - it will give commands to a flight controller in soft real time, but the flight controller does the flying

Maybe goals:

  • Run on an embedded-ish system a la nerves-project.org
  • Actually fly a drone around

Possible alternatives:

  • Rust + Bastion crate
  • Alternative name: brobot

#Building & running

Use rebar3: https://rebar3.org/

Install deps:

sudo apt-get install libopenblas-dev liblapacke-dev

Building:

  • rebar3 compile

Starting and running repl:

  • rebar3 shell

Repl reference:

Running tests:

  • rebar3 eunit

Buiding docs:

  • rebar3 edoc

Running lints:

  • rebar3 dialyzer

#Tools

Revised list, assuming this is gonna get redone in Elixir:

  • Build: mix (required for Nerves, which is worth it)
  • Unit tests: exunit or whatever
  • Linting/typing: dialyzer
  • Integration/deployment: Nerves
  • Math: Matrex??? Not Nx sadly
  • UI: Foxglove + Phoenix websockets -- https://kobrakai.de/kolumne/bare-websockets -- It's TCP, but an ok place to start. UDP transport for Foxglove would be interesting, DDS maybe.
  • Data logging: mcap file format
  • Flight control: PX4 + mavlink
  • Logging: Elixir's Logger and Telemetry
  • Geography and geodesy: GDAL?

Things we'll probably have to write ourselves:

  • TF tree
  • Localization (GPS or otherwise)
  • Like everything else
  • Any Rust integration we want with Nerves

Things to think about, on a philosophical level:

  • OpenCV (image processing)
  • PCL (point cloud processing)
  • DDS (distributed messaging)
  • CANBus (let's not borrow trouble though)

#References

#Random notes

Things to figure out:

One big question is what vehicle/flight controller to use. I can try to use a DJI SDK that I have some kind of access too... but DJI is increasingly in the doghouse and that doesn't seem to be changing, so, the only practical alternative seems to be PX4. I guess I should start learning how PX4 works.