momentumopt
ContactPlanInterface.hpp
Go to the documentation of this file.
1 
9 #pragma once
10 
11 #include <array>
12 #include <vector>
13 #include <string>
14 #include <iostream>
15 #include <Eigen/Eigen>
21 
22 namespace momentumopt {
23 
24  class KinematicsOptimizer;
25 
37  {
38  public:
41  // printf("planner_setting_=%p\n", (void*)planner_setting_);
42  }
43 
44  void initialize(const PlannerSetting& planner_setting);
45  virtual void optimize(const DynamicsState& ini_state, const TerrainDescription& terrain) = 0;
46  void fillDynamicsSequence(const DynamicsState& ini_state, DynamicsSequence& dynamics_sequence);
47  void updateEndeffectorTrajectories(const DynamicsState& ini_state, DynamicsSequence& dynamics_sequence);
48 
49  ContactSequence& contactSequence() { return contact_sequence_; }
50  const ContactSequence& contactSequence() const { return contact_sequence_; }
51 
52  ViapointSequence& viapointSequence() { return viapoint_sequence_; }
53  const ViapointSequence& viapointSequence() const { return viapoint_sequence_; }
54 
55  private:
56  double mapIdToContactTime(const DynamicsSequence& dyn_sequence, int map_id);
57  int findMakeContactId(const DynamicsSequence& dyn_seq, const int search_start_id, int eff_id);
58  int findBreakContactId(const DynamicsSequence& dyn_seq, const int search_start_id, int eff_id);
59  void findActiveViapoints(Eigen::Vector3d& viapoint_position, int eff_id, int cnt_id);
60  void generateFlightPhase(DynamicsSequence& dyn_seq, int start_id, int end_id, int eff_id,
61  const Eigen::Quaternion<double>& qini, const Eigen::Quaternion<double>& qend);
62 
63  protected:
65  inline const PlannerSetting& getSetting() const { return *planner_setting_; }
66 
67  protected:
68  TrajectoryGenerator sw_traj_;
69  ContactSequence contact_sequence_;
70  ViapointSequence viapoint_sequence_;
71  const PlannerSetting* planner_setting_;
72  };
73 }
This class is a container for a terrain description in terms of terrain surfaces. ...
Definition: TerrainDescription.hpp:66
Definition: TrajectoryGenerator.hpp:42
This class is a container for all variables required to define a dynamic state: center of mass positi...
Definition: DynamicsState.hpp:29
This class is a container for a sequence of viapoint states for all end-effectors.
Definition: ContactState.hpp:150
const PlannerSetting & getSetting() const
Definition: ContactPlanInterface.hpp:65
Definition: PlannerSetting.hpp:22
This class implements a simple interface to store a sequence of contacts, including its activation an...
Definition: ContactPlanInterface.hpp:36
This class is a container for a sequence of dynamic states, for all time steps in the optimization...
Definition: DynamicsState.hpp:123
This class is a container for a sequence of contact states, for all end-effectors.
Definition: ContactState.hpp:91