Calculating Adjoint for Optimizations

Discussion in 'Simulation' started by FMC, Feb 7, 2018.

  1. FMC

    FMC

    For my research, I need to find the gradient with respect to control input of a specific cost function, for which I want to use an adjoint formulation I've derived by hand.

    In my mind, the rocedure would go as:
    1. Start with a given trajectory
    2. Use inverse kinematics to find torque inputs
    3. Use adjoint to find gradient
    MuJoCo is great for steps 1 and 2, but I'm not completely sure how to do the simulations for step 3. I need a lot of derivatives that I'm not sure how to extract from mjData.
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    Derivatives can be computed with a finite difference approximation as illustrated here:

    http://www.mujoco.org/book/programming.html#saDerivative

    There is a new product under development called Optico, which is an optimal control toolbox build on top of MuJoCo, and it will have the ability to compute gradients of cost functions (in many cases analytically). But it is not ready yet.