sensors

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

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

Public Functions

inline virtual configHolder_t getDefaultSensorOptions(void)

Dictionary gathering the configuration options shared between sensors.

AbstractSensorBase(AbstractSensorBase const &abstractSensor) = delete

Forbid the copy of the class.

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

Constructor.

Parameters

name[in] Name of the sensor

virtual ~AbstractSensorBase(void) = default
virtual hresult_t resetAll(void) = 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 hresult_t refreshProxies(void) = 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 hresult_t configureTelemetry(std::shared_ptr<TelemetryData> telemetryData, std::string const &objectPrefixName = "")

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 recoder 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

Returns

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

void updateTelemetry(void)

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

virtual void updateTelemetryAll(void) = 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

virtual hresult_t setOptions(configHolder_t const &sensorOptions)

Set the configuration options of the sensor.

Parameters

sensorOptions[in] Dictionary with the parameters of the sensor

virtual hresult_t setOptionsAll(configHolder_t const &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

configHolder_t getOptions(void) const

Get the configuration options of the sensor.

Returns

Dictionary with the parameters of the sensor

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

Get the 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 vectorN_t, or the extraction of a column vector from a higher dimensional tensor.

bool_t const &getIsInitialized(void) const

Get isInitialized_.

It is a flag used to determine if 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 is the only thing to do before being ready to use.

bool_t const &getIsAttached(void) const

Get isAttached_.

It is a flag used to determine if the sensor has been attached to a robot.

bool_t const &getIsTelemetryConfigured(void) const

Get isTelemetryConfigured_.

It is a flag used to determine if the telemetry of the controller has been initialized.

std::string const &getName(void) const

Get name_.

It is the name of the sensor.

virtual int32_t const &getIdx(void) const = 0

Get sensorIdx_.

It is the index of the sensor of the global shared buffer.

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

Get type_.

It is the type of the sensor.

virtual uint64_t getSize(void) const = 0

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

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

Get the name of each element of the data measured by the sensor.

Public Members

std::unique_ptr<abstractSensorOptions_t const> baseSensorOptions_

Structure with the parameters of the sensor.

struct abstractSensorOptions_t

Public Functions

inline abstractSensorOptions_t(configHolder_t const &options)

Public Members

vectorN_t const noiseStd

Standard deviation of the noise of the sensor.

vectorN_t const bias

Bias of the sensor.

float64_t const delay

Delay of the sensor.

uint32_t const delayInterpolationOrder

Order of the interpolation used to compute delayed sensor data. [0: Zero-order holder, 1: Linear interpolation].

class jiminy::ImuSensor : public jiminy::AbstractSensorTpl<ImuSensor>

Public Functions

ImuSensor(std::string const &name)
~ImuSensor(void) = default
inline auto shared_from_this()
hresult_t initialize(std::string const &frameName)
virtual hresult_t setOptions(configHolder_t const &sensorOptions) final override

Set the configuration options of the sensor.

Parameters

sensorOptions[in] Dictionary with the parameters of the sensor

virtual hresult_t refreshProxies(void) final 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.

std::string const &getFrameName(void) const
frameIndex_t const &getFrameIdx(void) const
class jiminy::ContactSensor : public jiminy::AbstractSensorTpl<ContactSensor>

Public Functions

ContactSensor(std::string const &name)
~ContactSensor(void) = default
inline auto shared_from_this()
hresult_t initialize(std::string const &frameName)
virtual hresult_t refreshProxies(void) final 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.

std::string const &getFrameName(void) const
frameIndex_t const &getFrameIdx(void) const
class jiminy::ForceSensor : public jiminy::AbstractSensorTpl<ForceSensor>

Public Functions

ForceSensor(std::string const &name)
~ForceSensor(void) = default
inline auto shared_from_this()
hresult_t initialize(std::string const &frameName)
virtual hresult_t refreshProxies(void) final 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.

std::string const &getFrameName(void) const
frameIndex_t const &getFrameIdx(void) const
jointIndex_t getJointIdx(void) const
class jiminy::EncoderSensor : public jiminy::AbstractSensorTpl<EncoderSensor>

Public Functions

EncoderSensor(std::string const &name)
~EncoderSensor(void) = default
inline auto shared_from_this()
hresult_t initialize(std::string const &jointName)
virtual hresult_t refreshProxies(void) final 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.

std::string const &getJointName(void) const
jointIndex_t const &getJointIdx(void) const
joint_t const &getJointType(void) const
class jiminy::EffortSensor : public jiminy::AbstractSensorTpl<EffortSensor>

Public Functions

EffortSensor(std::string const &name)
~EffortSensor(void) = default
inline auto shared_from_this()
hresult_t initialize(std::string const &motorName)
virtual hresult_t refreshProxies(void) final 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.

std::string const &getMotorName(void) const
int32_t const &getMotorIdx(void) const