21 #define HUMOTO_CONFIG_SECTION_ID "ModelState" 22 #define HUMOTO_CONFIG_CONSTRUCTOR ModelState 23 #define HUMOTO_CONFIG_ENTRIES \ 24 HUMOTO_CONFIG_MEMBER_CLASS(base_state_, "base_state") \ 25 HUMOTO_CONFIG_MEMBER_CLASS(body_state_, "body_state") \ 26 HUMOTO_CONFIG_SCALAR_(base_mass) \ 27 HUMOTO_CONFIG_SCALAR_(body_mass) 28 #include HUMOTO_CONFIG_DEFINE_ACCESSORS 42 const double body_height = 7.50001340031501e-01,
43 const double body_x_offset = -0.00656061094036387,
46 const double base_mass = 16.34234,
47 const double body_mass = 12.3389)
50 base_state_.setDefaults();
51 body_state_.setDefaults();
53 base_state_.position_.z() = base_height;
54 base_state_.rpy_.z() = 0.0;
56 body_state_.position_.z() = body_height;
57 body_state_.position_.x() = body_x_offset;
59 base_mass_ = base_mass;
60 body_mass_ = body_mass;
99 const double body_height,
100 const double body_x_offset)
102 setParameters(body_height, base_height, body_x_offset);
115 const double & body_mass,
116 const etools::Vector3 & base_position,
117 const etools::Vector3 & body_position)
119 set(base_mass, body_mass, base_position, body_position);
133 base_state_ = base_state;
134 body_state_ = body_state;
146 void set(
const double & base_mass,
147 const double & body_mass,
148 const etools::Vector3 & base_position,
149 const etools::Vector3 & body_position)
151 base_mass_ = base_mass;
152 body_mass_ = body_mass;
173 const double & body_mass,
174 const etools::Vector3 & base_position,
175 const etools::Vector3 & body_position,
176 const double & base_orientation)
178 base_mass_ = base_mass;
179 body_mass_ = body_mass;
182 base_state_.
rpy_.z() = base_orientation;
197 const std::string &name =
"model_state")
const 201 logger.log(
LogEntryName(subname).add(
"base_mass"), base_mass_);
202 logger.log(
LogEntryName(subname).add(
"body_mass"), body_mass_);
204 base_state_.
log(logger, subname,
"base_state");
205 body_state_.
log(logger, subname,
"body_state");
void log(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="model_state") const
Log.
Class that groups together parameters related to a robot foot.
etools::Vector3 position_
#define HUMOTO_GLOBAL_LOGGER_IF_DEFINED
Default configurable base is strict.
Represents log entry name.
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.
Threaded logger: any data sent to this logger is wrapped in a message and pushed to a queue...
ModelState(const double &base_mass, const double &body_mass, const etools::Vector3 &base_position, const etools::Vector3 &body_position)
Construct class using given parameters.
void update(const double &base_mass, const double &body_mass, const etools::Vector3 &base_position, const etools::Vector3 &body_position, const double &base_orientation)
Partial update of the state.
ModelState(const double base_height, const double body_height, const double body_x_offset)
Construct class using given parameters.
ModelState()
Default constructor.
humoto::rigidbody::PointMassState body_state_
State of the body.
The root namespace of HuMoTo.
Class that groups together parmeters related to a robot foot.
humoto::rigidbody::RigidBodyState base_state_
State of the base.
Abstract class to be used for interfaces.
void setDefaults()
Set members to their default values.
LogEntryName & add(const char *name)
extends entry name with a subname
void setDefaults()
Initialize state (everything is set to zeros).
void setParameters(const double base_height=0.125564931735602, const double body_height=7.50001340031501e-01, const double body_x_offset=-0.00656061094036387, const double base_mass=16.34234, const double body_mass=12.3389)
Set default parameters.
void setDefaults()
Initialize state (everything is set to zeros).