sensors

class AbstractSensorBase : public std::enable_shared_from_this<AbstractSensorBase>

Generic interface for any sensor.

Any sensor must inherit from this base class and implement its virtual methods.

Subclassed by jiminy::AbstractSensorTpl< EffortSensor >, jiminy::AbstractSensorTpl< ContactSensor >, jiminy::AbstractSensorTpl< ForceSensor >, jiminy::AbstractSensorTpl< EncoderSensor >, jiminy::AbstractSensorTpl< ImuSensor >, jiminy::AbstractSensorTpl< T >

Public Functions

inline virtual GenericConfig getDefaultSensorOptions()

Dictionary gathering the configuration options shared between sensors.

explicit AbstractSensorBase(const std::string &name) noexcept
Parameters:

name[in] Name of the sensor

virtual ~AbstractSensorBase()
virtual void resetAll(uint32_t seed) = 0

Reset the internal state of the sensors.

This method resets the internal state of the sensor and unset the configuration of the telemetry.

Remark

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

virtual void refreshProxies() = 0

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 configureTelemetry(std::shared_ptr<TelemetryData> telemetryData, const std::string &prefix = {})

Configure the telemetry of the sensor.

This method connects the controller-specific telemetry sender to a given telemetry data (which is unique for a given exoskeleton robot), so that it is later possible to register the variables that one want to monitor. Finally, the telemetry recorder logs every registered variables at each timestep in a memory buffer.

Remark

This method is not intended to be called manually. The Robot to which the sensor is added is taking care of it before flushing the telemetry data at the end of each simulation steps.

Parameters:

telemetryData[in] Shared pointer to the robot-wide telemetry data object

void updateTelemetry()

Update the internal buffers of the telemetry associated with variables monitored by the sensor.

virtual void updateTelemetryAll() = 0

Update the internal buffers of the telemetry associated with variables monitored every sensors of the same type than the current one.

Remark

This method is not intended to be called manually. The Robot to which the sensor is added is taking care of it before flushing the telemetry data at the end of each simulation steps.

virtual void setOptions(const GenericConfig &sensorOptions)

Set the configuration options of the sensor.

Parameters:

sensorOptions[in] Dictionary with the parameters of the sensor.

virtual void setOptionsAll(const GenericConfig &sensorOptions) = 0

Set the same configuration options of any sensor of the same type than the current one.

Parameters:

sensorOptions[in] Dictionary with the parameters used for any sensor.

const GenericConfig &getOptions() const noexcept

Configuration options of the sensor.

template<typename DerivedType>
void set(const Eigen::MatrixBase<DerivedType> &value)
virtual Eigen::Ref<const Eigen::VectorXd> get() const = 0

Measurement of the sensor at the current time.

Note that the current time corresponds to the last time sensor data was recorded. If the delay of the sensor is nonzero, then an interpolation method is used to compute the delayed measurement based on a buffer of previously recorded non-delayed data.

Returns:

Eigen reference to a Eigen Vector where to store of sensor measurement. It can be an actual Eigen::VectorXd, or the extraction of a column vector from a higher dimensional tensor.

bool getIsInitialized() const

Whether the sensor has been initialized.

Remark

Note that a sensor can be considered initialized even if its telemetry is not properly configured. If not, it must be done before being ready to use.

bool getIsAttached() const

Whether the sensor has been attached to a robot.

bool getIsTelemetryConfigured() const

Whether the telemetry of the controller has been initialized.

const std::string &getName() const

Name of the sensor.

virtual std::size_t getIndex() const = 0

Index of the sensor of the global shared buffer.

virtual const std::string &getType() const = 0

Type of the sensor.

virtual std::size_t getSize() const = 0

It is the size of the sensor’s data vector.

virtual const std::vector<std::string> &getFieldnames() const = 0

Name of each element of the data measured by the sensor.

Public Members

std::unique_ptr<const AbstractSensorOptions> baseSensorOptions_ = {nullptr}

Structure with the parameters of the sensor.

struct AbstractSensorOptions

Public Functions

inline AbstractSensorOptions(const GenericConfig &options)

Public Members

const Eigen::VectorXd noiseStd

Standard deviation of the noise of the sensor.

const Eigen::VectorXd bias

Bias of the sensor.

const double delay

Delay of the sensor.

const double jitter

Jitter of the sensor.

const uint32_t delayInterpolationOrder

Order of the interpolation used to compute delayed sensor data.

[0: Zero-order holder, 1: Linear interpolation].

class ImuSensor : public jiminy::AbstractSensorTpl<ImuSensor>

Public Functions

inline auto shared_from_this()
void initialize(const std::string &frameName)
virtual void setOptions(const GenericConfig &sensorOptions) override

Set the configuration options of the sensor.

Parameters:

sensorOptions[in] Dictionary with the parameters of the sensor.

virtual void refreshProxies() override

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.

const std::string &getFrameName() const
pinocchio::FrameIndex getFrameIndex() const
class ContactSensor : public jiminy::AbstractSensorTpl<ContactSensor>

Public Functions

inline auto shared_from_this()
void initialize(const std::string &frameName)
virtual void setOptions(const GenericConfig &sensorOptions) override

Set the configuration options of the sensor.

Parameters:

sensorOptions[in] Dictionary with the parameters of the sensor.

virtual void refreshProxies() override

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.

const std::string &getFrameName() const
pinocchio::FrameIndex getFrameIndex() const
class ForceSensor : public jiminy::AbstractSensorTpl<ForceSensor>

Public Functions

inline auto shared_from_this()
void initialize(const std::string &frameName)
virtual void setOptions(const GenericConfig &sensorOptions) override

Set the configuration options of the sensor.

Parameters:

sensorOptions[in] Dictionary with the parameters of the sensor.

virtual void refreshProxies() override

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.

const std::string &getFrameName() const
pinocchio::FrameIndex getFrameIndex() const
pinocchio::JointIndex getJointIndex() const
class EncoderSensor : public jiminy::AbstractSensorTpl<EncoderSensor>

Public Functions

inline auto shared_from_this()
void initialize(const std::string &jointName)
virtual void setOptions(const GenericConfig &sensorOptions) override

Set the configuration options of the sensor.

Parameters:

sensorOptions[in] Dictionary with the parameters of the sensor.

virtual void refreshProxies() override

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.

const std::string &getJointName() const
pinocchio::JointIndex getJointIndex() const
JointModelType getJointType() const
class EffortSensor : public jiminy::AbstractSensorTpl<EffortSensor>

Public Functions

inline auto shared_from_this()
void initialize(const std::string &motorName)
virtual void setOptions(const GenericConfig &sensorOptions) override

Set the configuration options of the sensor.

Parameters:

sensorOptions[in] Dictionary with the parameters of the sensor.

virtual void refreshProxies() override

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.

const std::string &getMotorName() const
std::size_t getMotorIndex() const