18 #define HUMOTO_CONFIG_SECTION_ID "ModelState" 19 #define HUMOTO_CONFIG_CONSTRUCTOR ModelState 20 #define HUMOTO_CONFIG_ENTRIES \ 21 HUMOTO_CONFIG_ENUM_(stance_type) \ 22 HUMOTO_CONFIG_ENUM_(next_stance_type) \ 23 HUMOTO_CONFIG_MEMBER_CLASS(com_state_, "com_state") \ 24 HUMOTO_CONFIG_MEMBER_CLASS(feet_.getLeft(), "left_foot_state") \ 25 HUMOTO_CONFIG_MEMBER_CLASS(feet_.getRight(), "right_foot_state") 26 #include HUMOTO_CONFIG_DEFINE_ACCESSORS 41 const etools::Vector2 &initial_ds_position)
44 ds_R = Eigen::Rotation2Dd(theta);
50 feet_[left_or_right].position_.z() = 0.0;
51 feet_[left_or_right].velocity_.setZero();
52 feet_[left_or_right].acceleration_.setZero();
53 feet_[left_or_right].rpy_ << 0., 0., theta;
61 const double com_height = 0.814)
65 etools::Vector2 initial_ds_position;
66 initial_ds_position.setZero();
73 com_state_.setDefaults();
74 com_state_.position_.z() = com_height;
114 const double com_height)
116 setDefaults(robot_parameters, com_height);
126 setDefaults(robot_parameters);
138 const double com_height)
140 setDefaults(robot_parameters, com_height);
161 "The stance type must be LSS, RSS, or DS.");
162 com_state_ = com_state;
163 feet_.
setLeft(left_foot_state);
166 stance_type_ = current_stance;
181 const std::string &name =
"model_state")
const 185 logger.log(
LogEntryName(subname).add(
"stance_type") , stance_type_ );
186 logger.log(
LogEntryName(subname).add(
"next_stance_type"), next_stance_type_);
188 com_state_.
log(logger, subname,
"com_state");
190 feet_.
getLeft().
log(logger, subname,
"left_foot_state");
191 feet_.
getRight().
log(logger, subname,
"right_foot_state");
humoto::rigidbody::PointMassState com_state_
State of the CoM.
Class that groups together parameters related to a robot foot.
void setDefaults(const humoto::walking::RobotFootParameters &foot_param, const double com_height=0.814)
#define HUMOTO_GLOBAL_LOGGER_IF_DEFINED
#define HUMOTO_ASSERT(condition, message)
Default configurable base is strict.
walking::StanceType::Type next_stance_type_
next stance type
Represents log entry name.
void setRight(const t_Data &data)
Get/set/copy left or right object.
void initializeFoot(const humoto::walking::RobotFootParameters &foot_param, const humoto::LeftOrRight::Type left_or_right, const double theta, const etools::Vector2 &initial_ds_position)
Initialize foot state in an ADS.
void log(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="rigid_body_state") const
Log.
void log(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="point_mass_state") const
Log.
humoto::LeftRightContainer< humoto::rigidbody::RigidBodyState > feet_
States of the feet.
Threaded logger: any data sent to this logger is wrapped in a message and pushed to a queue...
void setLeft(const t_Data &data)
Get/set/copy left or right object.
void setDefaults()
Initialize to default values (HRP2)
The root namespace of HuMoTo.
walking::StanceType::Type stance_type_
current stance type
Class that groups together parmeters related to a robot foot.
t_Data & getRight()
Get/set/copy left or right object.
void log(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="model_state") const
Log.
Abstract class to be used for interfaces.
ModelState(const humoto::walking::RobotFootParameters &robot_parameters, const double com_height)
Construct class using given parameters.
ModelState()
Default constructor.
LogEntryName & add(const char *name)
extends entry name with a subname
t_Data & getLeft()
Get/set/copy left or right object.