Skip to content

[General] GPU Accelerated Trajectory Optimization with External Transcription #676

@andrewrosemberg

Description

@andrewrosemberg

@jbcaillau and @ocots,

I am trying to figure out the best way to implement optimal control problems for trajectory optimization in Julia to be solved with GPUs, making the best use of existing packages.

After chatting with @amontoison, I believe that OptimalControl.jl can be a useful framework to communicate with the appropriate modeling tools (e.g., Examodels) and solvers (e.g., those in MadSuit), besides handling the integrator part.

Unfortunately, I haven’t been able to completely derive the dynamics of my quadruped robot from scratch, which I believe is necessary for OptimalControl.jl.

Taking inspiration from TORA.jl (cc @ferrolho), I thought of using RigidBodyDynamics.jl (RBD) to derive them from a URDF file. In TORA.jl, this approach calls the RBD dynamics inference API compatible with AD to calculate both the Jacobian and Hessian. From my chat with @amontoison, I believe this could be made compatible with OptimalControl.jl by using the NLPModels Manual API: https://jso.dev/tutorials/create-a-manual-model/. The issue here is that this approach would require me to extend and ensure that RigidBodyDynamics.jl can perform dynamics inference on the GPU, as far as I know (AFAIK).

A while back, I also tried to rewrite RigidBodyDynamics.jl to directly create the appropriate constraints in a given JuMP model instead of solving the dynamics (andrewrosemberg/RigidBodyDynamics.jl#1). However, it seems that my naive implementation produces extremely large expressions, causing JuMP to stall when trying to check if they belong to the model. I now believe the rewrite would need to be much more intricate, ensuring that the expressions are created cleverly, avoiding redundancy, and being appropriately compatible with how the GPU kernels should be created for good performance.

Sorry for the long post, but I wanted to see what you and others from the community think. :)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions