$darkmode
cloe::NopPowertrainSensor Class Reference

#include <powertrain_sensor.hpp>

Inheritance diagram for cloe::NopPowertrainSensor:
Collaboration diagram for cloe::NopPowertrainSensor:

Public Member Functions

double pedal_position_acceleration () const override
 
int gear_transmission () const override
 
void reset () override
 
 PowertrainSensor ()
 
- Public Member Functions inherited from cloe::PowertrainSensor
fable::Json active_state () const override
 
 Component (const std::string &name, const std::string &description="")
 
 Component (std::string &&name, std::string &&description="")
 
- Public Member Functions inherited from cloe::Component
 Component (const std::string &name, const std::string &description="")
 
 Component (std::string &&name, std::string &&description="")
 
uint64_t id () const
 
template<typename T >
T * as ()
 
Duration process (const Sync &sync) override
 
void reset () override
 
void abort () override
 
- Public Member Functions inherited from cloe::Model
virtual ~Model () noexcept=default
 
virtual Duration resolution () const
 
virtual bool is_connected () const
 
virtual bool is_operational () const
 
virtual void connect ()
 
virtual void disconnect ()
 
virtual void enroll (Registrar &)
 
virtual void start (const Sync &)
 
virtual void pause (const Sync &)
 
virtual void resume (const Sync &)
 
virtual void stop (const Sync &)
 
 Entity (std::string name)
 
 Entity (std::string name, std::string desc)
 
- Public Member Functions inherited from cloe::Entity
 Entity (std::string name)
 
 Entity (std::string name, std::string desc)
 
const std::string & name () const
 
void set_name (std::string name)
 
const std::string & description () const
 
void set_description (std::string desc)
 

Protected Attributes

double pedal_position_acceleration_ {0.0}
 
int gear_transmission_ {0}
 
- Protected Attributes inherited from cloe::Model
bool connected_ {false}
 
bool operational_ {false}
 
- Protected Attributes inherited from cloe::Entity
std::string name_
 
std::string desc_
 

Additional Inherited Members

- Protected Member Functions inherited from cloe::Entity
virtual Logger logger () const
 

Detailed Description

NopPowertrainSensor is an example no-op implementation of PowertrainSensor.

Member Function Documentation

◆ gear_transmission()

int cloe::NopPowertrainSensor::gear_transmission ( ) const
inlineoverridevirtual

Return the gear transmission.

The sign of this field is linked to the mode of the gear

  • positive: driving forward (e.g. a value of 3 means the third gear in driving forward mode)
  • 0: means that the gear lever is in neutral position
  • negative: reverse mode (e.g. a value of -1 means the first gear in reverse mode)
  • int max: means that the transmission is in parking position (can be accessed via std::numeric_limits<int>::max())

Implements cloe::PowertrainSensor.

◆ pedal_position_acceleration()

double cloe::NopPowertrainSensor::pedal_position_acceleration ( ) const
inlineoverridevirtual

Return the position of the acceleration pedal with no unit.

The range goes from 0 (unpressed) to 1 (fully pressed).

Implements cloe::PowertrainSensor.

◆ reset()

void cloe::NopPowertrainSensor::reset ( )
inlineoverridevirtual

Reset the model state.

This is called when Cloe is asked to reset the whole simulation to time 0. This can be the case when the simulator or a controller asks us to recover from a temporary problem without repeating the whole simulation setup.

The default implementation will raise an error. So if your model is not able to re-initialize, the simulation will be aborted.

Reimplemented from cloe::Model.


The documentation for this class was generated from the following file: