JuliaCon 2023

Using Julia to Optimise Trajectories for Robots with Legs
2023-07-27 , 32-124

Planning trajectories for underactuated systems is a challenging problem in robotics. The dynamics governing such systems are quite complex, and mechanisms themselves have strict physical limits. In this talk, I will explain how we can use Julia (and packages from its robotics ecosystem) to frame motion planning problems as numerical optimisations. I will also share videos of robots solving practical tasks in the real world, tracking trajectories computed with this approach.


In this talk, I will explain how direct transcription works ─ a numerical optimisation approach that uses the model of a robot and its dynamics to plan feasible motions. I will start with a brief introduction on underactuated systems, and then explain how we can model system states (joint positions, velocities, torques, and contact forces). Next, I will go over the equations of motion that govern the system and show how to write equality and inequality constraints to enforce system dynamics, kinematic goals, and contact stability. After that, I will explain how we can formulate direct transcription problems in Julia (using existing packages from its rich ecosystem). In short, these are:

  • Ipopt.jl/KNITRO.jl for interfacing with off-the-shelf nonlinear programming solvers
  • RigidBodyDynamics.jl for calculating the whole-body system dynamics of complex mechanism models
  • SparsityDetection.jl, ForwardDiff.jl, and SparseDiffTools.jl for sparsity calculation and automatic differentiation of the NLP constraints and their Jacobians
  • StaticArrays.jl for non-allocating arrays used within the NLP constraints
  • MeshCat.jl for 3D visualisation of mechanisms
  • RobotOS.jl for ROS-related communications

I will also mention TORA.jl, an open-source implementation of direct transcription for robot arms, and go over a Jupyter notebook with a demo. Finally, I will share some videos of robot experiments on quadrupeds and humanoids from my PhD and postdoc work.

Henrique Ferrolho has a B.Sc./M.Sc. in informatics and computing engineering from the University of Porto, and a Ph.D. in robotics and autonomous systems from the University of Edinburgh. Currently, he is a Robotics Engineer at Ocado Technology in the UK, developing robot manipulation solutions for picking and placing tens of thousands of grocery products of varying shapes, sizes, weights, and fragility. His research interests include robust motion planning, and optimal control of complex robotic systems like quadrupeds and humanoids.