CoTiMo Planner Code Report
Collision-Free Smooth Path Generation
Cubic Spline
For a group of certain points
Let's talk about a specific dimention
To ensure the smooth of the curve, we write down the constraints,
Apply
So we can get the following expressions
In open loop case, assume stationary boundary
You can also regard
Convert the expressions to vector form, we have
For every dimension in
Minimize Stretch Energy
Then, we can define energy function by acceleration
But in practice, I use the following formula
Collision Free
We want to avoid our robot get crashed into the obstacle. So that we also need to define a potential function.
First, we need to calculate the distance between the robot and the obstacle. Which is find a point

By SOCP, we can obtain the distance vector
And the potential function would be defined as below
Loss Function
Finally, we convert the problem to an optimization problem, we can use Line Search, Quasi Newton, LBFGS, or Newton-CG to solve it.
In practice, I add some trick to make the optimizer more stable. Additional to five different
Time Optimal Path Parameterization
Continuous Case
After optimizing the control points
Then the optimal time
Additional to
We also have velocity constraint,
acceleration constraint,
and always move forward constraint
The true velocity is
The true acceleration is
Denote
Then the problem is described by
Discrete Case
Try to obtain the discretized form
Second-Order Cones
To rewrite the problem to a second-order conic programming form, we first try to bound nonlinear term
Rewriting the constraints of the optimization problem, especially the nonlinear terms
PHR ALM for Symmetric Cones
All constraints are divided into second-order cone constraints, equality constraints and inequality constraints.
Therefore, we can reformulate the problem using the Augmented Lagrangian method for Symmetric Cones.
In second order cone case,
And the gradient of the augmented Lagrangian function is given by
So we can use a L-BFGS method to solve this convex and unconstrained function.
1e3
Model Predictive Control
Swerve Kinematic Model

A simple omnidirectional platform is mecanum wheel chassis. But for a FRC player, a swerve chassis is what we need.
Consider only the translation case. Let's simply denote
So that, we can use the following equation to update the states in discrete time domian.
Objective Function
Denote the number of control points of optimal control is
The method to solve this objective function is similar to the PHR ALM method mentioned above, except that the terms related to the symmetric cone are removed.