motors¶
-
class AbstractMotorBase : public std::enable_shared_from_this<AbstractMotorBase>¶
Subclassed by jiminy::SimpleMotor
Public Functions
-
inline virtual GenericConfig getDefaultMotorOptions()¶
Dictionary gathering the configuration options shared between motors.
-
explicit AbstractMotorBase(const std::string &name) noexcept¶
- Parameters:
name – [in] Name of the motor.
-
virtual ~AbstractMotorBase()¶
-
virtual void refreshProxies()¶
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 void resetAll()¶
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.
-
const GenericConfig &getOptions() const noexcept¶
Configuration options of the motor.
-
double get() const¶
Actual effort of the motor at the current time.
-
const Eigen::VectorXd &getAll() const¶
Actual effort of all the motors at the current time.
-
virtual void setOptions(const GenericConfig &motorOptions)¶
Set the configuration options of the motor.
- Parameters:
motorOptions – [in] Dictionary with the parameters of the motor.
-
void setOptionsAll(const GenericConfig &motorOptions)¶
Set the same configuration options for all motors of same type as current one.
- Parameters:
motorOptions – [in] Dictionary with the parameters used for any motor.
-
bool getIsInitialized() const¶
Whether the motor has been initialized.
-
const std::string &getName() const¶
Name of the motor.
-
std::size_t getIndex() const¶
Index of the motor.
-
const std::string &getJointName() const¶
Name of the joint associated with the motor.
-
pinocchio::JointIndex getJointIndex() const¶
Index of the joint associated with the motor in the kinematic tree.
-
JointModelType getJointType() const¶
Type of joint associated with the motor.
-
Eigen::Index getJointPositionIndex() const¶
Index of the joint associated with the motor in configuration vector.
-
Eigen::Index getJointVelocityIndex() const¶
Index of the joint associated with the motor in the velocity vector.
-
double getCommandLimit() const¶
Maximum effort of the motor.
-
double getArmature() const¶
Rotor inertia of the motor.
-
double getBacklash() const¶
Backlash of the transmission.
-
virtual void computeEffort(double t, const Eigen::VectorBlock<const Eigen::VectorXd> &q, double v, double a, double 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.
-
void computeEffortAll(double t, const Eigen::VectorXd &q, const Eigen::VectorXd &v, const Eigen::VectorXd &a, const Eigen::VectorXd &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.
Public Members
-
std::unique_ptr<const AbstractMotorOptions> baseMotorOptions_ = {nullptr}¶
Structure with the parameters of the motor.
-
struct AbstractMotorOptions¶
Subclassed by jiminy::SimpleMotor::SimpleMotorOptions
Public Functions
-
inline AbstractMotorOptions(const GenericConfig &options)¶
Public Members
-
const double mechanicalReduction¶
Mechanical reduction ratio of transmission (joint/motor), usually >= 1.0.
-
const bool enableCommandLimit¶
-
const bool commandLimitFromUrdf¶
-
const double commandLimit¶
-
const bool enableArmature¶
-
const double armature¶
-
const bool enableBacklash¶
-
const double backlash¶
-
inline AbstractMotorOptions(const GenericConfig &options)¶
-
inline virtual GenericConfig getDefaultMotorOptions()¶
-
class SimpleMotor : public jiminy::AbstractMotorBase¶
Public Functions
-
inline virtual GenericConfig getDefaultMotorOptions() override¶
Dictionary gathering the configuration options shared between motors.
-
explicit SimpleMotor(const std::string &name) noexcept¶
-
virtual ~SimpleMotor() = default¶
-
void initialize(const std::string &jointName)¶
-
virtual void setOptions(const GenericConfig &motorOptions) override¶
Set the configuration options of the motor.
- Parameters:
motorOptions – [in] Dictionary with the parameters of the motor.
-
struct SimpleMotorOptions : public jiminy::AbstractMotorBase::AbstractMotorOptions¶
Public Functions
-
inline SimpleMotorOptions(const GenericConfig &options)¶
Public Members
-
const bool enableFriction¶
Flag to enable the joint friction.
- Pre:
Must be negative.
-
const double frictionViscousPositive¶
Viscous coefficient of the joint friction for positive velocity.
- Pre:
Must be negative.
-
const double frictionViscousNegative¶
Viscous coefficient of the joint friction for negative velocity.
- Pre:
Must be negative.
-
const double frictionDryPositive¶
Dry coefficient of the joint friction for positive velocity, which corresponds to the positive dry friction at saturation.
- Pre:
Must be negative.
-
const double frictionDryNegative¶
Dry coefficient of the joint friction for negative velocity, which corresponds to the negative dry friction at saturation.
- Pre:
Must be negative.
-
const double frictionDrySlope¶
Slope of the Tanh of the joint velocity that saturates the dry friction.
- Pre:
Must be negative.
-
inline SimpleMotorOptions(const GenericConfig &options)¶
-
inline virtual GenericConfig getDefaultMotorOptions() override¶