# optimize

## Syntax

## Description

The `optimize`

object function optimizes a trajectory for
both smoothness and collision avoidance using *Covariant Hamiltonian Optimization
for Motion Planning* (CHOMP), a gradient-descent based planner. To change the
weights of the smoothness costs and the collision costs, set the
`SmoothnessOptions`

, `CollisionOptions`

, and
`SolverOptions`

properties of the `manipulatorCHOMP`

object. The function also assumes that both the environment and the collision geometry of the
rigid body tree robot model are approximated as collision spheres.

`[`

optimizes the trajectory specified by the waypoints `optimtraj`

,`timesamples`

] = optimize(`manipCHOMP`

,`wpts`

,`tpts`

,`timestep`

)`wpts`

at times
`tpts`

, and using the Covariant Hamiltonian Optimization for Motion
Planning (CHOMP) algorithm, outputs the optimized waypoints `optimtraj`

at the sample times `timesamples`

. The initial trajectory fit between
waypoints at their respective times is linear interpolation.

`[`

specifies a trajectory type `optimtraj`

,`timesamples`

] = optimize(`manipCHOMP`

,`wpts`

,`tpts`

,`timestep`

,InitialTrajectoryFit=`fittype`

)`fittype`

for the initial trajectory
fitting.

`[___,`

returns solution information from the optimization.`solninfo`

] = optimize(___)

## Examples

## Input Arguments

## Output Arguments

## Extended Capabilities

## Version History

**Introduced in R2023a**