momentumopt
|
#include <DynamicsOptimizer.hpp>
Public Member Functions | |
DynamicsOptimizer () | |
void | initialize (PlannerSetting &planner_setting) |
function to initialize and configure the optimization More... | |
solver::ExitCode | optimize (const DynamicsState &ini_state, ContactPlanInterface *contact_plan, const KinematicsSequence &kin_sequence, bool update_tracking_objective=false) |
function to parse equations and objective into optimization problem and attempt to find a solution More... | |
DynamicsSequence & | dynamicsSequence () |
this function gives access to the optimized motion plan More... | |
const DynamicsSequence & | dynamicsSequence () const |
const double & | solveTime () const |
Private Member Functions | |
PlannerSetting & | getSetting () |
const PlannerSetting & | getSetting () const |
const ContactType | contactType (int time_id, int eff_id) const |
const Eigen::Matrix3d | contactRotation (int time_id, int eff_id) const |
const double | contactLocation (int time_id, int eff_id, int axis_id) const |
void | initializeOptimizationVariables () |
function to initialize optimization variables: type [continuous or binary], guess value [if any], upper and lower bounds for the variable | |
void | addVariableToModel (const solver::OptimizationVariable &opt_var, solver::Model &model, std::vector< solver::Var > &vars) |
function to add each variable to the Model and assign a unique identifier to it, to be used by the optimizer to construct the problem More... | |
void | internalOptimize (const KinematicsSequence &kin_sequence, bool is_first_time=false) |
functions to update tracking objective for momentum from penalty to tracking and attempt to find a solution to the optimization problem More... | |
void | updateTrackingObjective () |
void | saveSolution (solver::OptimizationVariable &opt_var) |
functions that transfers optimal solution from model to helper class OptimizationVariable, from helper class OptimizationVariable to dynamics sequence to be accessed by the user, and from dynamics sequence to a file. More... | |
void | storeSolution () |
void | saveToFile (const KinematicsSequence &kin_sequence) |
Private Attributes | |
PlannerSetting * | planner_setting_ |
solver::Model | model_ |
class that stores all information about the problem, interfaces between high level definition of the problem and its corresponding mathematical construction to solve it with a solver instance | |
solver::LinExpr | lin_cons_ |
solver::DCPQuadExpr | quad_objective_ |
solver::DCPQuadExpr | quad_cons_ |
solver::ExitCode | exitcode_ |
std::vector< solver::Var > | vars_ |
c++ vector containing all problem variables defined by the user. More... | |
DynamicsState | ini_state_ |
initial configuration of the robot, including center of mass position, linear and angular momenta, end-effectors configurations: activation, position, orientation | |
FrictionCone | friction_cone_ |
FrictionCone::ConeMat | cone_matrix_ |
DynamicsSequence | dyn_sequence_ |
dynamics sequence of dynamic states. More... | |
ContactPlanInterface * | contact_plan_ |
helper class to store information about the contact plan, such as surfaces, position and orientation of a sequence of contacts | |
Clock | timer_ |
char | variable_type_ |
bool | has_converged_ |
int | size_ |
int | num_vars_ |
double | solve_time_ |
double | convergence_err_ |
double | last_convergence_err_ |
Eigen::Vector3d | com_pos_goal_ |
Eigen::Vector3d | weight_desired_com_tracking_ |
solver::OptimizationVariable | dt_ |
solver::OptimizationVariable | com_ |
solver::OptimizationVariable | lmom_ |
solver::OptimizationVariable | amom_ |
solver::OptimizationVariable | lmomd_ |
solver::OptimizationVariable | amomd_ |
std::array< solver::OptimizationVariable, Problem::n_endeffs_ > | frc_world_ |
std::array< solver::OptimizationVariable, Problem::n_endeffs_ > | trq_local_ |
std::array< solver::OptimizationVariable, Problem::n_endeffs_ > | cop_local_ |
std::array< solver::OptimizationVariable, Problem::n_endeffs_ > | ub_var_ |
std::array< solver::OptimizationVariable, Problem::n_endeffs_ > | lb_var_ |
solver::OptimizationVariable::OptVector | solution_ |
solver::OptimizationVariable::OptMatrix | mat_lb_ |
solver::OptimizationVariable::OptMatrix | mat_ub_ |
solver::OptimizationVariable::OptMatrix | mat_guess_ |
solver::OptimizationVariable::OptMatrix | com_guess_ |
solver::OptimizationVariable::OptMatrix | lmom_guess_ |
solver::OptimizationVariable::OptMatrix | amom_guess_ |
main class of the dynamics optimization problem
|
inline |
default class constructor and destructor
|
private |
function to add each variable to the Model and assign a unique identifier to it, to be used by the optimizer to construct the problem
[in] | opt_var | helper optimization variable for model predictive control |
[in] | model | instance of solver interface to collect constraints, objective and solve problem |
[in] | vars | vector of optimization variables |
|
private |
helper functions for the optimization problem
|
inline |
this function gives access to the optimized motion plan
|
inlineprivate |
Getter and setter methods for getting the planner variables
void momentumopt::DynamicsOptimizer::initialize | ( | PlannerSetting & | planner_setting | ) |
function to initialize and configure the optimization
[in] | PlannerSetting | setting of planner configuration variables |
|
private |
functions to update tracking objective for momentum from penalty to tracking and attempt to find a solution to the optimization problem
[in] | ref_sequence | dynamics sequence to be used as momentum tracking reference (can be zeros). |
[in] | is_first_time | flag to indicate if this is the first time the solution is being constructed |
ExitCode momentumopt::DynamicsOptimizer::optimize | ( | const DynamicsState & | ini_state, |
ContactPlanInterface * | contact_plan, | ||
const KinematicsSequence & | kin_sequence, | ||
bool | update_tracking_objective = false |
||
) |
function to parse equations and objective into optimization problem and attempt to find a solution
[in] | ini_state | initial state of the robot |
[in] | contact_plan | container of contact sequence to be used for dynamics planning |
[in] | kin_sequence | kinematics sequence to be used as momentum tracking reference (can be zeros). |
[in] | update_tracking_objective | changes weights from regulation to tracking of momentum in ref_sequence |
|
private |
functions that transfers optimal solution from model to helper class OptimizationVariable, from helper class OptimizationVariable to dynamics sequence to be accessed by the user, and from dynamics sequence to a file.
[in] | opt_var | helper optimization variable for model predictive control |
[in] | ref_sequence | dynamics sequence to be used as momentum tracking reference (can be zeros). |
|
inline |
function to have access to time required to solve the optimization problem
|
private |
helper vector variables for the optimization problem
|
private |
helper optimization variables for the optimization problem
|
private |
dynamics sequence of dynamic states.
This is the main interface between the user and the planner. The user can find in this variable all the optimization results
|
private |
exit code of the optimization problem
|
private |
simple helper class to build a linear approximation of a friction cone
|
private |
helper boolean variables for the optimization problem
|
private |
helper variables to construct linear and quadratic expressions
|
private |
Variables required for optimization
|
private |
helper integer variables for the optimization problem
|
private |
helper matrices and vectors for the optimization problem
|
private |
helper double variables for the optimization problem
|
private |
clock for timing purposes
|
private |
type for optimization variable: continuous 'C' or binary 'B' and type of heuristic
|
private |
c++ vector containing all problem variables defined by the user.
Does not include extra variables required to write the problem in standard conic form.