robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
discrete_time_com_ref.hpp
Go to the documentation of this file.
1#ifndef ROBOTOC_DISCRETE_TIME_COM_REF_HPP_
2#define ROBOTOC_DISCRETE_TIME_COM_REF_HPP_
3
4#include <vector>
5#include <memory>
6
7#include "Eigen/Core"
8
12
13
14namespace robotoc {
15
21public:
27 DiscreteTimeCoMRef(const std::vector<Eigen::Vector3d>& com_to_contact_position);
28
33
40 void setCoMRef(const std::shared_ptr<ContactSequence>& contact_sequence);
41
54 void setCoMRef(const std::shared_ptr<ContactSequence>& contact_sequence,
55 const Eigen::Vector3d& first_com_ref,
56 const Eigen::Vector3d& last_com_ref,
57 const double first_rate=0, const double last_rate=0);
58
59 void updateRef(const GridInfo& grid_info,
60 Eigen::VectorXd& com_ref) const override;
61
62 bool isActive(const GridInfo& grid_info) const override;
63
64private:
65 std::vector<Eigen::Vector3d> com_position_, com_to_contact_position_;
66 std::vector<bool> has_inactive_contacts_;
67 double first_rate_, last_rate_;
68 int num_contact_phases_;
69
70};
71
72} // namespace robotoc
73
74#endif // ROBOTOC_DISCRETE_TIME_COM_REF_HPP_
Base class of reference position of the center of mass (CoM).
Definition: com_ref_base.hpp:15
Discrete-time reference of the center of mass.
Definition: discrete_time_com_ref.hpp:20
bool isActive(const GridInfo &grid_info) const override
Checks wheather the cost is active or not for the given grid info.
void updateRef(const GridInfo &grid_info, Eigen::VectorXd &com_ref) const override
Computes the reference CoM position.
void setCoMRef(const std::shared_ptr< ContactSequence > &contact_sequence, const Eigen::Vector3d &first_com_ref, const Eigen::Vector3d &last_com_ref, const double first_rate=0, const double last_rate=0)
Set the reference positions of CoM from the contact positions of the contact sequence....
void setCoMRef(const std::shared_ptr< ContactSequence > &contact_sequence)
Set the reference positions of CoM from the contact positions of the contact sequence....
DiscreteTimeCoMRef(const std::vector< Eigen::Vector3d > &com_to_contact_position)
Constructor.
~DiscreteTimeCoMRef()
Destructor.
Definition: constraint_component_base.hpp:17
Grid information.
Definition: grid_info.hpp:24