robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
jump_foot_step_planner.hpp
Go to the documentation of this file.
1#ifndef ROBOTOC_JUMP_FOOT_STEP_PLANNER_HPP_
2#define ROBOTOC_JUMP_FOOT_STEP_PLANNER_HPP_
3
4#include <vector>
5#include <iostream>
6
7#include "Eigen/Core"
8#include "Eigen/Geometry"
9
12#include "robotoc/robot/se3.hpp"
15
16
17namespace robotoc {
18
24public:
30
35
40
45
50
55
59 JumpFootStepPlanner& operator=(JumpFootStepPlanner&&) noexcept = default;
60
66 void setJumpPattern(const Eigen::Vector3d& jump_length, const double jump_yaw);
67
72 void setContactSurfaces(const std::vector<Eigen::Matrix3d>& contact_surfaces);
73
79 const std::vector<std::vector<Eigen::Matrix3d>>& contact_surfaces);
80
81 void init(const Eigen::VectorXd& q) override;
82
83 bool plan(const double t, const Eigen::VectorXd& q, const Eigen::VectorXd& v,
84 const ContactStatus& contact_status,
85 const int planning_steps) override;
86
87 const aligned_vector<SE3>& contactPlacements(const int step) const override;
88
89 const std::vector<Eigen::Vector3d>& contactPositions(const int step) const override;
90
91 const std::vector<Eigen::Matrix3d>& contactSurfaces(const int step) const override;
92
93 const Eigen::Vector3d& CoM(const int step) const override;
94
95 const Eigen::Matrix3d& R(const int step) const override;
96
97 int size() const override { return planning_size_; }
98
99 friend std::ostream& operator<<(std::ostream& os,
100 const JumpFootStepPlanner& planner);
101
102 friend std::ostream& operator<<(std::ostream& os,
103 const std::shared_ptr<JumpFootStepPlanner>& planner);
104
105 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
106
107private:
108 Robot robot_;
109 std::vector<int> contact_frames_;
110 int current_step_, planning_size_;
111 aligned_vector<aligned_vector<SE3>> contact_placement_ref_;
112 std::vector<std::vector<Eigen::Vector3d>> contact_position_ref_;
113 std::vector<std::vector<Eigen::Matrix3d>> contact_surface_ref_;
114 std::vector<Eigen::Vector3d> com_ref_, com_to_contact_position_local_;
115 std::vector<Eigen::Matrix3d> R_;
116 Eigen::Vector3d jump_length_;
117 Eigen::Matrix3d R_yaw_;
118 bool is_biped_;
119
120};
121
122} // namespace robotoc
123
124#endif // ROBOTOC_JUMP_FOOT_STEP_PLANNER_HPP_
Base interface of contact planners.
Definition: contact_planner_base.hpp:21
Contact status of robot model.
Definition: contact_status.hpp:32
Foot step planner for the jump motion.
Definition: jump_foot_step_planner.hpp:23
const aligned_vector< SE3 > & contactPlacements(const int step) const override
Gets the contact placements of a specified step.
const Eigen::Matrix3d & R(const int step) const override
Gets the rotation matrix of the base at a specified step.
void setJumpPattern(const Eigen::Vector3d &jump_length, const double jump_yaw)
Sets the gait pattern.
bool plan(const double t, const Eigen::VectorXd &q, const Eigen::VectorXd &v, const ContactStatus &contact_status, const int planning_steps) override
Plans the foot steps in the MPC (receding-horizon) fashion.
const std::vector< Eigen::Vector3d > & contactPositions(const int step) const override
Gets the contact positions of a specified step.
const Eigen::Vector3d & CoM(const int step) const override
Gets the CoM position of a specified step.
JumpFootStepPlanner(const JumpFootStepPlanner &)=default
Default copy constructor.
JumpFootStepPlanner()
Default constructor.
int size() const override
Gets the size of each planned quantities.
Definition: jump_foot_step_planner.hpp:97
const std::vector< Eigen::Matrix3d > & contactSurfaces(const int step) const override
Gets the contact surfaces of a specified step.
friend std::ostream & operator<<(std::ostream &os, const JumpFootStepPlanner &planner)
friend std::ostream & operator<<(std::ostream &os, const std::shared_ptr< JumpFootStepPlanner > &planner)
JumpFootStepPlanner(JumpFootStepPlanner &&) noexcept=default
Default move constructor.
JumpFootStepPlanner(const Robot &robot)
Constructs the planner.
void setContactSurfaces(const std::vector< Eigen::Matrix3d > &contact_surfaces)
Sets the rotation of the contact surfaces.
void init(const Eigen::VectorXd &q) override
Initializes the planner.
JumpFootStepPlanner & operator=(const JumpFootStepPlanner &)=default
Default copy assign operator.
Dynamics and kinematics model of robots. Wraps pinocchio::Model and pinocchio::Data....
Definition: robot.hpp:32
Definition: constraint_component_base.hpp:17
std::vector< T, Eigen::aligned_allocator< T > > aligned_vector
std vector with Eigen::aligned_allocator.
Definition: aligned_vector.hpp:14
pinocchio::SE3 SE3
Using pinocchio::SE3 without its namespace.
Definition: se3.hpp:15