Go to the documentation of this file.
55 #ifndef EXOTICA_AICO_SOLVER_AICO_SOLVER_H_
56 #define EXOTICA_AICO_SOLVER_AICO_SOLVER_H_
66 #include <exotica_aico_solver/aico_solver_initializer.h>
76 void Instantiate(
const AICOSolverInitializer& init)
override;
81 void Solve(Eigen::MatrixXd& solution)
override;
113 std::vector<SinglePassMeanCovariance>
q_stat_;
115 std::vector<Eigen::VectorXd>
s;
116 std::vector<Eigen::MatrixXd>
Sinv;
117 std::vector<Eigen::VectorXd>
v;
118 std::vector<Eigen::MatrixXd>
Vinv;
119 std::vector<Eigen::VectorXd>
r;
120 std::vector<Eigen::MatrixXd>
R;
122 std::vector<Eigen::VectorXd>
b;
123 std::vector<Eigen::MatrixXd>
Binv;
124 std::vector<Eigen::VectorXd>
q;
125 std::vector<Eigen::VectorXd>
qhat;
199 const Eigen::Ref<const Eigen::VectorXd>& qhat_t,
double tolerance,
200 double max_step_size = -1.);
211 int max_relocation_iterations,
double tolerance,
bool force_relocation,
212 double max_step_size = -1.);
229 int max_relocation_iterations,
double tolerance,
double max_step_size = -1.);
234 double EvaluateTrajectory(
const std::vector<Eigen::VectorXd>& x,
bool skip_update =
false);
252 #endif // EXOTICA_AICO_SOLVER_AICO_SOLVER_H_
Eigen::VectorXd cost_task_
Task cost for each task for each time step.
Definition: aico_solver.h:127
Eigen::VectorXd cost_control_old_
Control cost for each time step (last most optimal value)
Definition: aico_solver.h:140
std::vector< Eigen::VectorXd > q
Configuration space trajectory.
Definition: aico_solver.h:124
void InitTrajectory(const std::vector< Eigen::VectorXd > &q_init)
Initialise AICO messages from an initial trajectory.
Eigen::MatrixXd bwd_msg_Vinv_
Backward message initialisation covariance.
Definition: aico_solver.h:109
void UpdateTimestepGaussNewton(int t, bool update_fwd, bool update_bwd, int max_relocation_iterations, double tolerance, double max_step_size=-1.)
Update messages for given time step using the Gauss Newton method.
double EvaluateTrajectory(const std::vector< Eigen::VectorXd > &x, bool skip_update=false)
Computes the cost of the trajectory.
double damping_init_
Damping.
Definition: aico_solver.h:102
Solves motion planning problem using Approximate Inference Control method.
Definition: aico_solver.h:72
void UpdateTaskMessage(int t, const Eigen::Ref< const Eigen::VectorXd > &qhat_t, double tolerance, double max_step_size=-1.)
void PerhapsUndoStep()
Reverts back to previous state if the cost of the current state is higher.
Eigen::MatrixXd cost_task_old_
Task cost for each task for each time step (last most optimal value)
Definition: aico_solver.h:141
std::vector< Eigen::MatrixXd > Vinv_old
Backward message covariance inverse (last most optimal value)
Definition: aico_solver.h:132
SweepMode
Definition: aico_solver.h:158
int max_backtrack_iterations_
Max. number of sweeps without improvement before terminating (= line-search)
Definition: aico_solver.h:106
Eigen::VectorXd cost_control_
Control cost for each time step.
Definition: aico_solver.h:126
std::vector< Eigen::MatrixXd > R
Task message covariance.
Definition: aico_solver.h:120
double Step()
Compute one step of the AICO algorithm.
bool sweep_improved_cost_
Whether the last sweep improved the cost (for backtrack iterations count)
Definition: aico_solver.h:110
std::vector< Eigen::MatrixXd > Binv
Belief covariance inverse.
Definition: aico_solver.h:123
double minimum_step_tolerance_
Update tolerance to stop update of messages if change of maximum coefficient is less than this tolera...
Definition: aico_solver.h:103
Definition: property.h:110
Definition: cartpole_dynamics_solver.h:38
Eigen::MatrixXd W
Configuration space weight matrix inverse.
Definition: aico_solver.h:150
@ SYMMETRIC
Definition: aico_solver.h:161
void InitMessages()
Initializes message data.
std::vector< Eigen::VectorXd > qhat_old
Point of linearisation (last most optimal value)
Definition: aico_solver.h:139
std::vector< Eigen::VectorXd > qhat
Point of linearisation.
Definition: aico_solver.h:125
double b_step_
Squared configuration space step.
Definition: aico_solver.h:147
void UpdateFwdMessage(int t)
Updates the forward message at time step $t$.
std::vector< Eigen::MatrixXd > Sinv_old
Forward message covariance inverse (last most optimal value)
Definition: aico_solver.h:130
std::vector< Eigen::MatrixXd > Binv_old
Belief covariance inverse (last most optimal value)
Definition: aico_solver.h:137
bool verbose_
Definition: aico_solver.h:168
double cost_old_
cost of MAP trajectory (last most optimal value)
Definition: aico_solver.h:145
void Instantiate(const AICOSolverInitializer &init) override
std::vector< Eigen::VectorXd > q_old
Configuration space trajectory (last most optimal value)
Definition: aico_solver.h:138
int best_sweep_
Definition: aico_solver.h:156
int sweep_
Sweeps so far.
Definition: aico_solver.h:155
Eigen::VectorXd rhat_old
Task message point of linearisation (last most optimal value)
Definition: aico_solver.h:135
void SpecifyProblem(PlanningProblemPtr pointer) override
Binds the solver to a specific problem which must be pre-initalised.
std::vector< Eigen::MatrixXd > Vinv
Backward message covariance inverse.
Definition: aico_solver.h:118
std::vector< Eigen::VectorXd > v_old
Backward message mean (last most optimal value)
Definition: aico_solver.h:131
Eigen::VectorXd bwd_msg_v_
Backward message initialisation mean.
Definition: aico_solver.h:108
double cost_
cost of MAP trajectory
Definition: aico_solver.h:144
int last_T_
T the last time InitMessages was called.
Definition: aico_solver.h:153
std::shared_ptr< exotica::UnconstrainedTimeIndexedProblem > UnconstrainedTimeIndexedProblemPtr
Definition: unconstrained_time_indexed_problem.h:98
std::vector< Eigen::VectorXd > b
Belief mean.
Definition: aico_solver.h:122
std::vector< Eigen::VectorXd > s
Forward message mean.
Definition: aico_solver.h:115
int iteration_count_
Iteration counter.
Definition: aico_solver.h:111
double cost_prev_
previous iteration cost
Definition: aico_solver.h:146
void Solve(Eigen::MatrixXd &solution) override
Solves the problem.
std::vector< Eigen::MatrixXd > R_old
Task message covariance (last most optimal value)
Definition: aico_solver.h:134
UnconstrainedTimeIndexedProblemPtr prob_
Shared pointer to the planning problem.
Definition: aico_solver.h:100
int sweep_mode_
Sweep mode.
Definition: aico_solver.h:165
double b_step_old_
Definition: aico_solver.h:148
Definition: motion_solver.h:42
std::shared_ptr< PlanningProblem > PlanningProblemPtr
Definition: planning_problem.h:116
std::vector< Eigen::VectorXd > v
Backward message mean.
Definition: aico_solver.h:117
int update_count_
Definition: aico_solver.h:166
Eigen::MatrixXd Winv
Configuration space weight matrix inverse.
Definition: aico_solver.h:151
void UpdateTimestep(int t, bool update_fwd, bool update_bwd, int max_relocation_iterations, double tolerance, bool force_relocation, double max_step_size=-1.)
Update messages for given time step.
@ LOCAL_GAUSS_NEWTON_DAMPED
Definition: aico_solver.h:163
double GetTaskCosts(int t)
Updates the task cost terms for time step . UnconstrainedTimeIndexedProblem::Update() has to be call...
std::vector< Eigen::VectorXd > b_old
Belief mean (last most optimal value)
Definition: aico_solver.h:136
std::vector< Eigen::VectorXd > r
Task message mean.
Definition: aico_solver.h:119
Eigen::VectorXd rhat
Task message point of linearisation.
Definition: aico_solver.h:121
std::vector< SinglePassMeanCovariance > q_stat_
Cost weighted normal distribution of configurations across sweeps.
Definition: aico_solver.h:113
double function_tolerance_
Relative function tolerance/first-order optimality criterion.
Definition: aico_solver.h:105
void RememberOldState()
Stores the previous state.
double damping
Damping.
Definition: aico_solver.h:101
std::vector< Eigen::VectorXd > s_old
Forward message mean (last most optimal value)
Definition: aico_solver.h:129
bool use_bwd_msg_
Flag for using backward message initialisation.
Definition: aico_solver.h:107
std::vector< Eigen::VectorXd > r_old
Task message mean (last most optimal value)
Definition: aico_solver.h:133
@ LOCAL_GAUSS_NEWTON
Definition: aico_solver.h:162
std::vector< Eigen::MatrixXd > Sinv
Forward message covariance inverse.
Definition: aico_solver.h:116
@ FORWARD
Definition: aico_solver.h:160
int best_sweep_old_
Definition: aico_solver.h:157
double step_tolerance_
Relative step tolerance (termination criterion)
Definition: aico_solver.h:104
std::vector< Eigen::VectorXd > damping_reference_
Damping reference point.
Definition: aico_solver.h:143
void UpdateBwdMessage(int t)
Updates the backward message at time step $t$.