Numerical OptimizationΒΆ

cuRobo implements a few numerical optimization solvers. All solvers in cuRobo take in a rollout class that will take as input [batch, horizon, dof] actions and output [batch, horizon] cost. Even when running optimization over 1 seed, cuRobo internally uses 4 parallel line search scales to find the best step direction. Check curobo.rollout.arm_base.ArmBase for an example implementation of the rollout class and curobo.opt.newton.newton_base.NewtonOptBase for an implementation of gradient descent.

cuRobo enables chaining solvers together so that solution from 1 solver can used as the seed for another solver. This is done in the curobo.wrap.reacher.ik_solver.IKSolver and curobo.wrap.reacher.trajopt.TrajOptSolver, where a random seed is optimized with MPPI before sending to LBFGS as seen in the below graph.

digraph { #rankdir=LR; edge [color = "#2B4162"; fontsize=10]; node [shape="box", style="rounded, filled", fontsize=12, color="#cccccc"] seed [label="random seed"] opt_sol [label="optimized solution", shape="plain", style="rounded"] subgraph cluster_query{ label="Query"; start [label="Current State"] goal [label="Goal Pose"] } subgraph cluster_robot{ label="Robot World Configuration"; kin_model [label="RobotConfig", color="#76b900",fontcolor="white"] world_model [label="WorldCollision", color="#76b900",fontcolor="white"] } kin_model -> mppi_rollout [style="dashed", fontcolor="#708090", label="reference"]; world_model -> mppi_rollout [style="dashed", fontcolor="#708090", label="reference"]; seed -> mppi_solver [color="#76b900"]; start -> mppi_rollout [style="dashed"]; goal -> mppi_rollout [style="dashed"]; start -> lbfgs_rollout [style="dashed"]; goal -> lbfgs_rollout [style="dashed"]; kin_model -> lbfgs_rollout [style="dashed", fontcolor="#708090", label="reference"]; world_model -> lbfgs_rollout [style="dashed", fontcolor="#708090", label="reference"]; mppi_solver -> mppi_sol [color="#76b900"]; subgraph cluster_particle { label="Particle Optimization"; mppi_solver[label = "Parallel MPPI"]; mppi_rollout [label = "Rollout for MPPI"] mppi_sol[label="MPPI Solution"] mppi_rollout -> mppi_solver; } subgraph cluster_newton { label="Newton Optimization"; lbfgs_solver[label = "LBFGS Solver"]; lbfgs_rollout [label = "Rollout for L-BFGS"] lbfgs_sol [label = "LBFGS Solution"] lbfgs_rollout -> lbfgs_solver; } mppi_sol -> lbfgs_solver [color="#76b900"]; lbfgs_solver -> lbfgs_sol [color="#76b900"]; lbfgs_sol -> opt_sol [color="#76b900"]; }

The steps inside the optimization solver is illustrated for reference. #cccccc blocks indicate running rollout for 1 trajectory in the batch and green blocks refer to the cost terms.

../_images/optimization_graph.png