Anyone using Julia for drones (or other embedded)? Any forseen problems?

You should easily be able to hit 1000 Hz for an EKF-based state estimator, as long as you don’t allocate, as you’ve noted from our case study, since

julia> using BenchmarkTools

julia> @btime GC.gc()
  46.261 ms (0 allocations: 0 bytes)

Over at QPControl.jl, @rdeits and I implemented a basic QP-based controller for a humanoid robot that doesn’t allocate and runs at about 1000 Hz. That controller performs various rigid body dynamics calculations, sets up a QP, and solves it within that millisecond, so I would definitely not expect any problems in terms of throughput for control and state estimation for a drone.

Despite the lack of allocation, we did observe somewhat significant jitter on a Linux machine without special precautions taken. Pegging the CPU frequency helps a bit: using a simple BenchmarkTools test, I’m getting times between 945 μs and 1385 μs right now. We haven’t had the chance to try this on a machine with the realtime kernel patch.

Avoiding allocations can be a hassle, and I’m hoping we’ll soon get new tools to help with this (:wink: @jeff.bezanson).

6 Likes