29 current_base_position_ = state_.base_state_.position_.head(2);
59 setParameters(robot_parameters);
68 robot_parameters_ = robot_parameters;
115 return(getMPCBaseState(state_));
126 return(getMPCBodyState(state_));
140 etools::Vector6 mpc_state;
142 mpc_state = convertBaseStateRBtoMPC(model_state.
base_state_);
156 etools::Vector6 mpc_state;
158 mpc_state = convertBodyStateRBtoMPC(model_state.
body_state_);
170 return (getCoP(state_));
217 const etools::Vector2 &base_control,
218 const etools::Vector2 &body_control,
219 const double base_height,
220 const double body_height,
221 const double theta)
const 223 getNextState( model_state,
253 const etools::Vector2 &base_control,
254 const etools::Vector2 &body_control,
255 const double base_height,
256 const double body_height,
257 const double theta)
const 261 mpc_state = evaluate(T, Ts, preceding_mpcstate, base_control, body_control);
263 model_state.
base_state_ = convertBaseStateMPCtoRB(mpc_state, base_height);
264 model_state.
body_state_ = convertBodyStateMPCtoRB(mpc_state, body_height);
278 return(getTheta(state_));
373 const std::string &name =
"model")
const 377 state_.
log(logger, subname,
"state");
379 logger.log(
LogEntryName(subname).add(
"mpc_state") , getMPCState());
380 logger.log(
LogEntryName(subname).add(
"current_base_position"), current_base_position_);
void log(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="model_state") const
Log.
humoto::rigidbody::RigidBodyState getBaseState() const
Returns current base state.
void getNextState(humoto::pepper_mpc::ModelState &model_state, const double T, const double Ts, const etools::Vector2 &base_control, const etools::Vector2 &body_control, const double base_height, const double body_height, const double theta) const
Get next state from the current state.
double getBodyHeight() const
Get body height.
Class that groups together parameters related to a robot foot.
humoto::rigidbody::PointMassState getBodyState() const
Returns current body state.
etools::Vector3 position_
#define HUMOTO_GLOBAL_LOGGER_IF_DEFINED
etools::Vector2 getCoP(const humoto::pepper_mpc::ModelState &model_state) const
Get CoP position.
void updateState(const humoto::ModelState &model_state)
Update model state.
Represents log entry name.
double getBaseMass() const
Get base mass.
etools::Vector2 getCoP() const
Get CoP position.
EIGENTOOLS_CONSTANT_SIZE_VECTOR(12) getMPCState() const
Get MPC state.
void log(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="model") const
Log.
etools::Vector6 getMPCBaseState(const humoto::pepper_mpc::ModelState &model_state) const
Get base state.
etools::Vector6 getMPCBodyState(const humoto::pepper_mpc::ModelState &model_state) const
Get body state.
double getTheta() const
Get theta angle of the current state.
Threaded logger: any data sent to this logger is wrapped in a message and pushed to a queue...
etools::Vector6 getMPCBodyState() const
Get body state.
etools::Vector2 current_base_position_
2d position of the base
double getBaseOrientation() const
Get base orientation.
double getBaseHeight() const
Get base height.
humoto::rigidbody::PointMassState body_state_
State of the body.
The root namespace of HuMoTo.
humoto::pepper_mpc::RobotParameters robot_parameters_
robot parameters
Class that groups together parmeters related to a robot foot.
humoto::rigidbody::RigidBodyState base_state_
State of the base.
Instances of this class are passed to a virtual method 'humoto::TaskBase::form()', so even though this class is basically useless in its present form we cannot avoid its definition using a template.
void finalize()
Determines position of the base.
etools::Vector6 getMPCBaseState() const
Get base state.
Parameters of the motion.
Abstract class to be used for interfaces.
Model(const humoto::pepper_mpc::RobotParameters &robot_parameters)
Construct and initialize robot parameters.
Model()
Default constructor.
void setParameters(const humoto::pepper_mpc::RobotParameters &robot_parameters)
Initialize robot parameters.
LogEntryName & add(const char *name)
extends entry name with a subname
double getTheta(const humoto::pepper_mpc::ModelState &model_state) const
Get theta angle of the given state.
void getNextState(humoto::pepper_mpc::ModelState &model_state, const double T, const double Ts, const EIGENTOOLS_CONSTANT_SIZE_VECTOR(12) &preceding_mpcstate, const etools::Vector2 &base_control, const etools::Vector2 &body_control, const double base_height, const double body_height, const double theta) const
Get next state from the given state.
double getBodyMass() const
Get body mass.
humoto::pepper_mpc::ModelState state_
state of the model