Loading [MathJax]/extensions/tex2jax.js
pinocchio  3.3.1
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages
ocp Namespace Reference

Classes

class  CallBack
 

Functions

def cost (U)
 
def display (U, verbose=False)
 

Variables

 approx_grad
 
tuple bounds
 
 c
 
 callback = CallBack()
 
 cost
 
 env = Pendulum(1)
 
 info
 
int NSTEPS = 50
 
 True
 
 U
 
 U0 = np.zeros(NSTEPS * env.nu) - env.umax
 — OCP resolution
 
 x0 = env.reset().copy()
 

Detailed Description

Example of optimal control resolution by direct optimization of a single trajectory.

Function Documentation

◆ cost()

def ocp.cost (   U)
Cost for a trajectory starting at state X0 with control U

Definition at line 18 of file ocp.py.

◆ display()

def ocp.display (   U,
  verbose = False 
)
Display the trajectory on Gepetto viewer.

Definition at line 29 of file ocp.py.

Variable Documentation

◆ bounds

bounds
Initial value:
1 = (
2  [
3  [-env.umax, env.umax],
4  ]
5  * env.nu
6  * NSTEPS
7 )

Definition at line 71 of file ocp.py.