robot

class jiminy::Model : public std::enable_shared_from_this<Model>

Subclassed by jiminy::Robot

Public Functions

inline virtual configHolder_t getDefaultJointOptions()
inline virtual configHolder_t getDefaultDynamicsOptions()
inline virtual configHolder_t getDefaultCollisionOptions()
inline virtual configHolder_t getDefaultModelOptions()
Model(Model const &robot) = delete
Model &operator=(Model const &other) = delete
Model(void)
~Model(void) = default
inline auto shared_from_this()
inline auto shared_from_this() const
hresult_t initialize(std::string const &urdfPath, bool_t const &hasFreeflyer = true, std::vector<std::string> const &meshPackageDirs = {})
hresult_t addFrame(std::string const &frameName, std::string const &parentBodyName, pinocchio::SE3 const &framePlacement)

Add a frame in the kinematic tree, attached to the frame of an existing body.

Parameters
  • frameName[in] Name of the frame to be added

  • parentBodyName[in] Name of the parent body frame

  • framePlacement[in] Frame placement wrt the parent body frame

hresult_t removeFrame(std::string const &frameName)
hresult_t addCollisionBodies(std::vector<std::string> const &bodyNames, bool_t const &ignoreMeshes = false)
hresult_t removeCollisionBodies(std::vector<std::string> frameNames = {})
hresult_t addContactPoints(std::vector<std::string> const &frameNames)
hresult_t removeContactPoints(std::vector<std::string> const &frameNames = {})
hresult_t addConstraint(std::string const &constraintName, std::shared_ptr<AbstractConstraintBase> const &constraint)

Add a kinematic constraint to the robot.

Parameters
  • constraintName[in] Unique name identifying the kinematic constraint.

  • constraint[in] Constraint to add.

hresult_t removeConstraint(std::string const &constraintName)

Remove a kinematic constraint form the system.

Parameters

constraintName[in] Unique name identifying the kinematic constraint.

hresult_t getConstraint(std::string const &constraintName, std::shared_ptr<AbstractConstraintBase> &constraint)

Get a pointer to the constraint referenced by constraintName.

Parameters

constraintName[in] Name of the constraint to get.

Returns

ERROR_BAD_INPUT if constraintName does not exist, SUCCESS otherwise.

hresult_t getConstraint(std::string const &constraintName, std::weak_ptr<AbstractConstraintBase const> &constraint) const
constraintsHolder_t getConstraints(void)
bool_t existConstraint(std::string const &constraintName) const
hresult_t resetConstraints(vectorN_t const &q, vectorN_t const &v)
void computeConstraints(vectorN_t const &q, vectorN_t const &v)

Compute jacobian and drift associated to all the constraints.

The results are accessible using getConstraintsJacobian and getConstraintsDrift.

Note

It is assumed frames forward kinematics has already been called.

Parameters
  • q[in] Joint position.

  • v[in] Joint velocity.

constMatrixBlock_t getConstraintsJacobian(void) const

Get jacobian of the constraints.

constVectorBlock_t getConstraintsDrift(void) const

Get drift of the constraints.

constVectorBlock_t getConstraintsLambda(void) const

Get lambda multipliers of the constraints.

Get drift of the constraints.

bool_t hasConstraints(void) const

Returns true if at least one constraint is active on the robot.

hresult_t setOptions(configHolder_t modelOptions)
configHolder_t getOptions(void) const
virtual void reset(void)

This method are not intended to be called manually. The Engine is taking care of it.

bool_t const &getIsInitialized(void) const
std::string const &getUrdfPath(void) const
std::vector<std::string> const &getMeshPackageDirs(void) const
bool_t const &getHasFreeflyer(void) const
int32_t const &nq(void) const
int32_t const &nv(void) const
int32_t const &nx(void) const
std::vector<std::string> const &getCollisionBodiesNames(void) const
std::vector<std::string> const &getContactFramesNames(void) const
std::vector<frameIndex_t> const &getCollisionBodiesIdx(void) const
std::vector<std::vector<pairIndex_t>> const &getCollisionPairsIdx(void) const
std::vector<frameIndex_t> const &getContactFramesIdx(void) const
std::vector<std::string> const &getRigidJointsNames(void) const
std::vector<jointIndex_t> const &getRigidJointsModelIdx(void) const
std::vector<int32_t> const &getRigidJointsPositionIdx(void) const
std::vector<int32_t> const &getRigidJointsVelocityIdx(void) const
std::vector<std::string> const &getFlexibleJointsNames(void) const
std::vector<jointIndex_t> const &getFlexibleJointsModelIdx(void) const
vectorN_t const &getPositionLimitMin(void) const
vectorN_t const &getPositionLimitMax(void) const
vectorN_t const &getVelocityLimit(void) const
std::vector<std::string> const &getPositionFieldnames(void) const
std::vector<std::string> const &getVelocityFieldnames(void) const
std::vector<std::string> const &getAccelerationFieldnames(void) const
std::vector<std::string> const &getForceExternalFieldnames(void) const
hresult_t getFlexibleConfigurationFromRigid(vectorN_t const &qRigid, vectorN_t &qFlex) const
hresult_t getRigidConfigurationFromFlexible(vectorN_t const &qFlex, vectorN_t &qRigid) const
hresult_t getFlexibleVelocityFromRigid(vectorN_t const &vRigid, vectorN_t &vFlex) const
hresult_t getRigidVelocityFromFlexible(vectorN_t const &vFlex, vectorN_t &vRigid) const

Public Members

pinocchio::Model pncModel_
mutable pinocchio::Data pncData_
pinocchio::GeometryModel collisionModel_
mutable std::unique_ptr<pinocchio::GeometryData> pncGeometryData_
pinocchio::Model pncModelRigidOrig_
pinocchio::Data pncDataRigidOrig_
std::unique_ptr<modelOptions_t const> mdlOptions_
forceVector_t contactForces_

Buffer storing the contact forces.

struct collisionOptions_t

Public Functions

inline collisionOptions_t(configHolder_t const &options)

Public Members

uint32_t const maxContactPointsPerBody
struct dynamicsOptions_t

Public Functions

inline dynamicsOptions_t(configHolder_t const &options)

Public Members

float64_t const inertiaBodiesBiasStd
float64_t const massBodiesBiasStd
float64_t const centerOfMassPositionBodiesBiasStd
float64_t const relativePositionBodiesBiasStd
bool_t const enableFlexibleModel
flexibilityConfig_t const flexibilityConfig
struct jointOptions_t

Public Functions

inline jointOptions_t(configHolder_t const &options)

Public Members

bool_t const enablePositionLimit
bool_t const positionLimitFromUrdf
vectorN_t const positionLimitMin

Min position limit of all the actual joints, namely without freeflyer and flexible joints if any.

vectorN_t const positionLimitMax
bool_t const enableVelocityLimit
bool_t const velocityLimitFromUrdf
vectorN_t const velocityLimit
struct modelOptions_t

Public Functions

inline modelOptions_t(configHolder_t const &options)

Public Members

dynamicsOptions_t const dynamics
jointOptions_t const joints
collisionOptions_t const collisions
class jiminy::Robot : public jiminy::Model

Public Types

using motorsHolder_t = std::vector<std::shared_ptr<AbstractMotorBase>>
using sensorsHolder_t = std::vector<std::shared_ptr<AbstractSensorBase>>
using sensorsGroupHolder_t = std::unordered_map<std::string, sensorsHolder_t>
using sensorsSharedHolder_t = std::unordered_map<std::string, std::shared_ptr<SensorSharedDataHolder_t>>

Public Functions

Robot(Robot const &robot) = delete
Robot &operator=(Robot const &other) = delete
Robot(void)
~Robot(void)
inline auto shared_from_this()
inline auto shared_from_this() const
hresult_t initialize(std::string const &urdfPath, bool_t const &hasFreeflyer = true, std::vector<std::string> const &meshPackageDirs = {})
hresult_t attachMotor(std::shared_ptr<AbstractMotorBase> motor)
hresult_t getMotor(std::string const &motorName, std::shared_ptr<AbstractMotorBase> &motor)
hresult_t getMotor(std::string const &motorName, std::weak_ptr<AbstractMotorBase const> &motor) const
motorsHolder_t const &getMotors(void) const
hresult_t detachMotor(std::string const &motorName)
hresult_t detachMotors(std::vector<std::string> const &motorsNames = {})
hresult_t attachSensor(std::shared_ptr<AbstractSensorBase> sensor)
hresult_t getSensor(std::string const &sensorType, std::string const &sensorName, std::shared_ptr<AbstractSensorBase> &sensor)
hresult_t getSensor(std::string const &sensorType, std::string const &sensorName, std::weak_ptr<AbstractSensorBase const> &sensor) const
sensorsGroupHolder_t const &getSensors(void) const
hresult_t detachSensor(std::string const &sensorType, std::string const &sensorName)
hresult_t detachSensors(std::string const &sensorType = {})
void computeMotorsEfforts(float64_t const &t, vectorN_t const &q, vectorN_t const &v, vectorN_t const &a, vectorN_t const &command)
vectorN_t const &getMotorsEfforts(void) const
float64_t const &getMotorEffort(std::string const &motorName) const
void setSensorsData(float64_t const &t, vectorN_t const &q, vectorN_t const &v, vectorN_t const &a, vectorN_t const &uMotor)
sensorsDataMap_t getSensorsData(void) const
Eigen::Ref<vectorN_t const> getSensorData(std::string const &sensorType, std::string const &sensorName) const
hresult_t setOptions(configHolder_t const &robotOptions)
configHolder_t getOptions(void) const
hresult_t setMotorOptions(std::string const &motorName, configHolder_t const &motorOptions)
hresult_t setMotorsOptions(configHolder_t const &motorsOptions)
hresult_t getMotorOptions(std::string const &motorName, configHolder_t &motorOptions) const
configHolder_t getMotorsOptions(void) const
hresult_t setSensorOptions(std::string const &sensorType, std::string const &sensorName, configHolder_t const &sensorOptions)
hresult_t setSensorsOptions(std::string const &sensorType, configHolder_t const &sensorsOptions)
hresult_t setSensorsOptions(configHolder_t const &sensorsOptions)
hresult_t getSensorOptions(std::string const &sensorType, std::string const &sensorName, configHolder_t &sensorOptions) const
hresult_t getSensorsOptions(std::string const &sensorType, configHolder_t &sensorsOptions) const
configHolder_t getSensorsOptions(void) const
hresult_t setModelOptions(configHolder_t const &modelOptions)
configHolder_t getModelOptions(void) const
hresult_t setTelemetryOptions(configHolder_t const &telemetryOptions)
configHolder_t getTelemetryOptions(void) const
hresult_t dumpOptions(std::string const &filepath) const
hresult_t loadOptions(std::string const &filepath)
virtual void reset(void) override

This method are not intended to be called manually. The Engine is taking care of it.

virtual hresult_t configureTelemetry(std::shared_ptr<TelemetryData> telemetryData, std::string const &objectPrefixName = "")
void updateTelemetry(void)
bool_t const &getIsTelemetryConfigured(void) const
std::vector<std::string> const &getMotorsNames(void) const
std::vector<jointIndex_t> getMotorsModelIdx(void) const
std::vector<std::vector<int32_t>> getMotorsPositionIdx(void) const
std::vector<int32_t> getMotorsVelocityIdx(void) const
std::unordered_map<std::string, std::vector<std::string>> const &getSensorsNames(void) const
std::vector<std::string> const &getSensorsNames(std::string const &sensorType) const
vectorN_t const &getCommandLimit(void) const
vectorN_t const &getArmatures(void) const
std::vector<std::string> const &getCommandFieldnames(void) const
std::vector<std::string> const &getMotorEffortFieldnames(void) const
uint64_t const &nmotors(void) const
hresult_t getLock(std::unique_ptr<LockGuardLocal> &lock)
bool_t const &getIsLocked(void) const