robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
biped_walk_foot_step_planner.hpp
Go to the documentation of this file.
1#ifndef ROBOTOC_BIPED_WALK_FOOT_STEP_PLANNER_HPP_
2#define ROBOTOC_BIPED_WALK_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"
17
18
19namespace robotoc {
20
26public:
31 BipedWalkFootStepPlanner(const Robot& biped_robot);
32
37
42
47
52
57
61 BipedWalkFootStepPlanner& operator=(BipedWalkFootStepPlanner&&) noexcept = default;
62
70 void setGaitPattern(const Eigen::Vector3d& step_length, const double step_yaw,
71 const bool enable_double_support_phase);
72
81 void setRaibertGaitPattern(const Eigen::Vector3d& vcom_cmd,
82 const double yaw_rate_cmd, const double swing_time,
83 const double double_support_time, const double gain);
84
85 void init(const Eigen::VectorXd& q) override;
86
87 bool plan(const double t, const Eigen::VectorXd& q, const Eigen::VectorXd& v,
88 const ContactStatus& contact_status,
89 const int planning_steps) override;
90
91 const aligned_vector<SE3>& contactPlacements(const int step) const override;
92
96 const std::vector<Eigen::Vector3d>& contactPositions(const int step) const override;
97
101 const std::vector<Eigen::Matrix3d>& contactSurfaces(const int step) const override;
102
103 const Eigen::Vector3d& CoM(const int step) const override;
104
105 const Eigen::Matrix3d& R(const int step) const override;
106
107 int size() const override { return planning_size_; }
108
109 friend std::ostream& operator<<(std::ostream& os,
110 const BipedWalkFootStepPlanner& planner);
111
112 friend std::ostream& operator<<(std::ostream& os,
113 const std::shared_ptr<BipedWalkFootStepPlanner>& planner);
114
115 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
116
117private:
118 Robot robot_;
119 RaibertHeuristic raibert_heuristic_;
120 MovingWindowFilter<2> vcom_moving_window_filter_;
121 bool enable_raibert_heuristic_;
122 int L_foot_id_, R_foot_id_, current_step_, planning_size_;
123 double left_to_right_leg_distance_, foot_height_to_com_height_;
124 aligned_vector<aligned_vector<SE3>> contact_placement_ref_;
125 std::vector<std::vector<Eigen::Vector3d>> contact_position_ref_;
126 std::vector<std::vector<Eigen::Matrix3d>> contact_surface_ref_;
127 std::vector<Eigen::Vector3d> com_ref_;
128 std::vector<Eigen::Matrix3d> R_;
129 Eigen::Vector3d vcom_, vcom_cmd_, step_length_;
130 Eigen::Matrix3d R_yaw_, R_current_;
131 double yaw_rate_cmd_;
132 bool enable_double_support_phase_;
133
134};
135
136} // namespace robotoc
137
138#endif // ROBOTOC_BIPED_WALK_FOOT_STEP_PLANNER_HPP_
Foot step planner for the biped robot walk.
Definition: biped_walk_foot_step_planner.hpp:25
BipedWalkFootStepPlanner & operator=(const BipedWalkFootStepPlanner &)=default
Default copy assign operator.
const aligned_vector< SE3 > & contactPlacements(const int step) const override
Gets the contact placements of a specified step.
void setGaitPattern(const Eigen::Vector3d &step_length, const double step_yaw, const bool enable_double_support_phase)
Sets the gait pattern by step length and yaw step command.
BipedWalkFootStepPlanner(const Robot &biped_robot)
Constructs the planner.
const Eigen::Matrix3d & R(const int step) const override
Gets the rotation matrix of the base at a specified step.
friend std::ostream & operator<<(std::ostream &os, const std::shared_ptr< BipedWalkFootStepPlanner > &planner)
void init(const Eigen::VectorXd &q) override
Initializes the planner.
BipedWalkFootStepPlanner()
Default constructor.
BipedWalkFootStepPlanner(const BipedWalkFootStepPlanner &)=default
Default copy constructor.
int size() const override
Gets the size of each planned quantities.
Definition: biped_walk_foot_step_planner.hpp:107
const std::vector< Eigen::Vector3d > & contactPositions(const int step) const override
This is invalid in BipedWalkFootStepPlanner.
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::Matrix3d > & contactSurfaces(const int step) const override
This is invalid in BipedWalkFootStepPlanner.
BipedWalkFootStepPlanner(BipedWalkFootStepPlanner &&) noexcept=default
Default move constructor.
friend std::ostream & operator<<(std::ostream &os, const BipedWalkFootStepPlanner &planner)
void setRaibertGaitPattern(const Eigen::Vector3d &vcom_cmd, const double yaw_rate_cmd, const double swing_time, const double double_support_time, const double gain)
Sets the gait pattern by Raibert heuristic.
const Eigen::Vector3d & CoM(const int step) const override
Gets the CoM position of a specified step.
Base interface of contact planners.
Definition: contact_planner_base.hpp:21
Contact status of robot model.
Definition: contact_status.hpp:32
Moving window filter for foot step planning.
Definition: moving_window_filter.hpp:17
Raibert heuristic for foot step planning.
Definition: raibert_heuristic.hpp:23
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