motors

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

Subclassed by jiminy::SimpleMotor

Public Functions

inline virtual configHolder_t getDefaultMotorOptions(void)

Dictionary gathering the configuration options shared between motors.

AbstractMotorBase(AbstractMotorBase const &abstractMotor) = delete

Forbid the copy of the class.

AbstractMotorBase &operator=(AbstractMotorBase const &other) = delete
AbstractMotorBase(std::string const &name)

Constructor.

Parameters
  • robot[in] Robot

  • name[in] Name of the motor

virtual ~AbstractMotorBase(void)
virtual hresult_t refreshProxies(void)

Refresh the proxies.

Remark

This method is not intended to be called manually. The Robot to which the motor is added is taking care of it when its own refresh method is called.

virtual hresult_t resetAll(void)

Reset the internal state of the motors.

This method resets the internal state of the motor.

Remark

This method is not intended to be called manually. The Robot to which the motor is added is taking care of it when its own reset method is called.

configHolder_t getOptions(void) const

Get the configuration options of the motor.

Returns

Dictionary with the parameters of the motor

float64_t const &get(void) const

Get the actual effort of the motor at the current time.

vectorN_t const &getAll(void) const

Get the actual effort of all the motors at the current time.

virtual hresult_t setOptions(configHolder_t const &motorOptions)

Set the configuration options of the motor.

Parameters

motorOptions[in] Dictionary with the parameters of the motor

hresult_t setOptionsAll(configHolder_t const &motorOptions)

Set the same configuration options for every motors.

Parameters

motorOptions[in] Dictionary with the parameters used for any motor

bool_t const &getIsInitialized(void) const

Get isInitialized_.

It is a flag used to determine if the motor has been initialized.

std::string const &getName(void) const

Get name_.

It is the name of the motor.

std::size_t const &getIdx(void) const

Get motorIdx_.

It is the index of the motor.

std::string const &getJointName(void) const

Get jointName_.

It is the name of the joint associated with the motor.

jointIndex_t const &getJointModelIdx(void) const

Get jointModelIdx_.

It is the index of the joint associated with the motor in the kinematic tree.

joint_t const &getJointType(void) const

Get jointType_.

It is the type of joint associated with the motor.

int32_t const &getJointPositionIdx(void) const

Get jointPositionIdx_.

It is the index of the joint associated with the motor in the configuration vector.

int32_t const &getJointVelocityIdx(void) const

Get jointVelocityIdx_.

It is the index of the joint associated with the motor in the velocity vector.

float64_t const &getCommandLimit(void) const

Get commandLimit_.

It is the maximum effort of the motor.

float64_t const &getArmature(void) const

Get armature_.

It is the rotor inertia of the motor.

virtual hresult_t computeEffort(float64_t const &t, Eigen::VectorBlock<vectorN_t const> const &q, float64_t const &v, float64_t const &a, float64_t command) = 0

Request the motor to update its actual effort based of the input data.

It assumes that the internal state of the robot is consistent with the input arguments.

Parameters
  • t[in] Current time.

  • q[in] Current configuration of the motor.

  • v[in] Current velocity of the motor.

  • a[in] Current acceleration of the motor.

  • command[in] Current command effort of the motor.

hresult_t computeEffortAll(float64_t const &t, vectorN_t const &q, vectorN_t const &v, vectorN_t const &a, vectorN_t const &command)

Request every motors to update their actual effort based of the input data.

It assumes that the internal state of the robot is consistent with the input arguments.

Remark

This method is not intended to be called manually. The Robot to which the motor is added is taking care of it while updating the state of the motors.

Parameters
  • t[in] Current time.

  • q[in] Current configuration vector of the robot.

  • v[in] Current velocity vector of the robot.

  • a[in] Current acceleration vector of the robot.

  • command[in] Current command effort vector of the robot.

Returns

Return code to determine whether the execution of the method was successful.

Public Members

std::unique_ptr<abstractMotorOptions_t const> baseMotorOptions_

Structure with the parameters of the motor.

struct abstractMotorOptions_t

Subclassed by jiminy::SimpleMotor::motorOptions_t

Public Functions

inline abstractMotorOptions_t(configHolder_t const &options)

Public Members

float64_t const mechanicalReduction

Mechanical reduction ratio of the transmission (joint / motor, usually >= 1.0.

bool_t const enableCommandLimit
bool_t const commandLimitFromUrdf
float64_t const commandLimit
bool_t const enableArmature
float64_t const armature
class jiminy::SimpleMotor : public jiminy::AbstractMotorBase

Public Functions

inline virtual configHolder_t getDefaultMotorOptions(void) override

Dictionary gathering the configuration options shared between motors.

SimpleMotor(std::string const &name)
virtual ~SimpleMotor(void) = default
inline auto shared_from_this()
inline auto shared_from_this() const
hresult_t initialize(std::string const &jointName)
virtual hresult_t setOptions(configHolder_t const &motorOptions) final override

Set the configuration options of the motor.

Parameters

motorOptions[in] Dictionary with the parameters of the motor

struct motorOptions_t : public jiminy::AbstractMotorBase::abstractMotorOptions_t

Public Functions

inline motorOptions_t(configHolder_t const &options)

Public Members

bool_t const enableFriction

Flag to enable the joint friction. It is always negative.

float64_t const frictionViscousPositive

Viscous coefficient of the joint friction for positive velocity. It is always negative.

float64_t const frictionViscousNegative

Viscous coefficient of the joint friction for negative velocity. It is always negative.

float64_t const frictionDryPositive

Dry coefficient of the joint friction for positive velocity, which corresponds to the positive dry friction at saturation. It is always negative.

float64_t const frictionDryNegative

Dry coefficient of the joint friction for negative velocity, which corresponds to the negative dry friction at saturation. It is always negative.

float64_t const frictionDrySlope

Slope of the Tanh of the joint velocity that saturate the dry friction at frictionDry. It is always positive (no dry friction when equal to zero).