Beam Bots - Resilient Robotics on the BEAM

Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns.

Why?

When you look at ROS2’s architecture, so much of what it provides maps directly to BEAM/OTP patterns:

  • ROS2’s pubsub → Phoenix.PubSub, Registry, process messaging
  • ROS2’s Services → GenServer.call/3
  • ROS2’s Actions → supervised Task with progress messages
  • ROS2’s Controllers → GenServers with state machines
  • ROS2’s parameter system → ETS

The BEAM already gives you fault tolerance, concurrency, soft real-time performance, and good behaviour in resource-constrained environments. BB builds on that
foundation.

See harton.nz • Elixir for Robots for more

Features

  • Spark DSL for declarative robot definitions - your code mirrors your robot’s physical structure
  • Topology-based supervision - the supervision tree mirrors your robot topology for fault isolation
  • Physical units with the ~u sigil - ~u(90 degree), ~u(0.5 meter), ~u(10 newton_meter)
  • Forward kinematics using Nx (GPU-accelerated where supported)
  • Hierarchical PubSub for sensor data with message type filtering
  • URDF export for integration with ROS visualisation tools

Current Status

Early days - the framework compiles, tests pass, and the DSL works, but it hasn’t controlled physical robots yet. I’m currently building a rover to close that loop.
Looking for feedback and contributors.

Read harton.nz • Announcing Beam Bots: Resilient Robotics on the BEAM for more details.

Links

Tutorials

See the tutorials for a guided introduction:

  1. Your First Robot - defining robots with the DSL
  2. Starting and Stopping - supervision trees
  3. Sensors and PubSub - publishing and subscribing to messages
  4. Forward Kinematics - computing link positions
  5. Commands and State Machine - controlling the robot
  6. Exporting to URDF - interoperability with ROS tools
  7. Parameters - runtime-adjustable configuration
  8. Parameter Bridges - bidirectional remote access

The DSL Reference documents all available options.

31 Likes

Amazing, as far a I have read , this is intended to run in Nerves or any OS, right ?

I suppose it will be something like this if we go full Elixir stack:

Your entire stack will be a Nerves application.

You will just add the Robot done with BB to the Nerves supervision tree.

Let me know if I am wrong please.

2 Likes

Yeah, it’s will run anywhere. You define your robot in the DSL, add genservers for the various sensors and actuators and controllers and away you go. Nerves is optional, but I expect a lot of folks will want to use it.

2 Likes

Amazing! Thank you for the tutorials, I’ll work my way through them during the holidays

2 Likes

This looks neat! Curious to see what kind of Robots people will use it for - are there any particular types BB is suited to?

Videos of cute/cool robots powered by Elixir always appreciated too! :robot:

1 Like

It should be generic enough to handle pretty much any kind of bot. You can load in a bunch of links and joints and use IK to move it through the world or you can use a single link and ignore kinematics altogether. The idea is to give you structure to help you model your robot without requiring you to do so.

2 Likes

Ah nice! If you position it as a framework it could be a nice way to not only be seen as a competitor to ROS, but as an inroad into Elixir too (people are generally attracted to frameworks, especially for new/unfamiliar territory).

2 Likes

That’s definitely the idea. I want to build it out to the point that it’s a no brainer if you want to build robots to use BB. I know I’m in for the long haul to build out the ecosystem of packages and device support but it’s something that I’ve wanted to exist for years, and now I’ve spent several years being shown how to lovingly own and evangelise a framework by @zachdaniel I think I can handle the challenge.

9 Likes

Just thinking out loud, this could also be great for students as an approachable robotics kit for the classroom like what Arduino did with their starter kits

3 Likes

it’s definitely something I plan to do, starting with something very very simple.

7 Likes

Lots of work going on over in beam bots land. We’ve been adding new standard message types as well as publishing initial versions of bb_servo_pigpio and bb_servo_pca9685 which use the new message types to send and receive motion information. Something I’m particularly happy about is having a standardised position estimator for open loop joints (ie anything without position feedback) - and that it’s such a simple genserver.

4 Likes

It’s been a very busy first week. So much so that I had to write up an update.

4 Likes

Week two status update.

2 Likes

Week three status update:

1 Like

Week four progress update for Beam Bots - the Elixir robotics framework.

Highlights:

  • Collision detection system (broad phase AABB + narrow phase primitives)
  • IK solvers can now reject self-colliding solutions
  • Commands converted from Tasks to GenServers for interruptibility (E-stop actually stops mid-motion now)
  • New Parameters widget for Livebook
  • WidowX 200 arm running real motions with DLS inverse kinematics
8 Likes

Busy week for Beam Bots - four new repositories shipped:

  • bb_reactor - Reactor saga orchestration for robot task sequencing. Compensation/rollback, dependency-driven concurrency, event-driven execution. Wrote a whole post on Beyond Behaviour Trees: Task Orchestration the Elixir Way | Beam Bots.
  • feetech + bb_servo_feetech - Driver for Feetech/WaveShare STS/SCS serial servos (the affordable ones used in SO-101 arms). Still buggy, but it’s a start.
  • proposals - Lightweight RFC repo. See what’s planned, propose features, or pick something up if you’re keen.

Other updates:

  • BB v0.13 adds reactive controllers (Threshold, PatternMatch) for event-driven safety interlocks
  • Simulation mode now auto-creates position estimators so the 3D view actually updates
  • bb_servo_robotis finally on Hex (no longer “release imminent”)

Full post: Week Five: Tasks Get Orchestrated, Roadmaps Get Transparent | Beam Bots

1 Like