Tetrapod Project
miqp_biped.h
Go to the documentation of this file.
1 #ifndef miqp_biped_h
2 #define miqp_biped_h
3 
4 #include<Eigen/Core>
5 
6 #include<tuple>
7 
9 
10 #include "drake/solvers/mathematical_program.h"
11 
12 #include "drake/solvers/osqp_solver.h"
13 
14 #include "drake/solvers/branch_and_bound.h"
15 
16 #include "drake/common/symbolic.h"
17 
18 namespace miqp{
19 namespace biped{
20 
21 using drake::solvers::MatrixXDecisionVariable;
22 
23 struct DecVars
24 {
25  MatrixXDecisionVariable position_left;
26 
27  MatrixXDecisionVariable position_right;
28 
29  MatrixXDecisionVariable stone_left;
30 
31  MatrixXDecisionVariable stone_right;
32 
33  drake::solvers::DecisionVariable first_left;
34 };
35 
37 {
38  Eigen::MatrixXd position_left;
39 
40  Eigen::MatrixXd position_right;
41 
42  Eigen::MatrixXd stone_left;
43 
44  Eigen::MatrixXd stone_right;
45 
46  bool first_left;
47 
48  double cost;
49 };
50 
51 DecVars add_decision_variables(drake::solvers::MathematicalProgram &prog, Terrain &terrain, int n_steps);
52 
53 void set_initial_and_goal_position(drake::solvers::MathematicalProgram &prog, Terrain &terrain, DecVars &decision_variables);
54 
55 void relative_position_limits(drake::solvers::MathematicalProgram &prog, int n_steps, double step_span, DecVars &decision_variables);
56 
57 void step_sequence(drake::solvers::MathematicalProgram &prog, int n_steps, double step_span, DecVars &decision_variables);
58 
59 void one_stone_per_foot(drake::solvers::MathematicalProgram &prog, int n_steps, DecVars &decision_variables);
60 
61 Eigen::Vector4d get_big_M(Terrain terrain);
62 
63 void foot_in_stepping_stone(drake::solvers::MathematicalProgram &prog, Terrain &terrain, int n_steps, DecVars &decision_variables);
64 
65 void minimize_step_length(drake::solvers::MathematicalProgram &prog, int n_steps, DecVars &decision_variables);
66 #endif
67 
68 void writeMatToFile(Eigen::MatrixXd &mat, std::string filename);
69 
70 void writeDecVarsToFile(DecVars_res &decision_variables, std::string base_name="footstep_planner");
71 
72 }
73 }
void foot_in_stepping_stone(drake::solvers::MathematicalProgram &prog, Terrain &terrain, int n_steps, DecVars &decision_variables)
Definition: miqp_biped.cpp:167
void relative_position_limits(drake::solvers::MathematicalProgram &prog, int n_steps, double step_span, DecVars &decision_variables)
void set_initial_and_goal_position(drake::solvers::MathematicalProgram &prog, Terrain &terrain, DecVars &decision_variables)
Definition: miqp_biped.cpp:34
void writeMatToFile(Eigen::MatrixXd &mat, std::string filename)
Definition: miqp_biped.cpp:242
DecVars add_decision_variables(drake::solvers::MathematicalProgram &prog, Terrain &terrain, int n_steps)
Definition: miqp_biped.cpp:13
Eigen::Vector4d get_big_M(Terrain terrain)
Definition: miqp_biped.cpp:150
void minimize_step_length(drake::solvers::MathematicalProgram &prog, int n_steps, DecVars &decision_variables)
Definition: miqp_biped.cpp:218
void step_sequence(drake::solvers::MathematicalProgram &prog, int n_steps, double step_span, DecVars &decision_variables)
Definition: miqp_biped.cpp:93
void writeDecVarsToFile(DecVars_res &decision_variables, std::string base_name="footstep_planner")
Definition: miqp_biped.cpp:263
void one_stone_per_foot(drake::solvers::MathematicalProgram &prog, int n_steps, DecVars &decision_variables)
Definition: miqp_biped.cpp:137
int step_span
Definition: visualize.py:14
Eigen::MatrixXd position_left
Definition: miqp_biped.h:38
Eigen::MatrixXd position_right
Definition: miqp_biped.h:40
Eigen::MatrixXd stone_right
Definition: miqp_biped.h:44
Eigen::MatrixXd stone_left
Definition: miqp_biped.h:42
drake::solvers::DecisionVariable first_left
Definition: miqp_biped.h:33
MatrixXDecisionVariable stone_right
Definition: miqp_biped.h:31
MatrixXDecisionVariable position_left
Definition: miqp_biped.h:25
MatrixXDecisionVariable stone_left
Definition: miqp_biped.h:29
MatrixXDecisionVariable position_right
Definition: miqp_biped.h:27