$darkmode
cloe::NopDriverRequest Class Reference

#include <driver_request.hpp>

Inheritance diagram for cloe::NopDriverRequest:
Collaboration diagram for cloe::NopDriverRequest:

Public Member Functions

boost::optional< double > acceleration () const override
 
bool has_acceleration () const override
 
boost::optional< double > steering_angle () const override
 
bool has_steering_angle () const override
 
Duration process (const Sync &sync) override
 
void reset () override
 
 DriverRequest ()
 
- Public Member Functions inherited from cloe::DriverRequest
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

boost::optional< double > acceleration_ {0.0}
 
boost::optional< double > steering_angle_ {0.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

NopDriverRequest is an example no-op implementation of DriverRequest.

Member Function Documentation

◆ acceleration()

boost::optional<double> cloe::NopDriverRequest::acceleration ( ) const
inlineoverridevirtual

Return driver-requested acceleration in [m/s^2].

Implements cloe::DriverRequest.

◆ has_acceleration()

bool cloe::NopDriverRequest::has_acceleration ( ) const
inlineoverridevirtual

Return true if acceleration request is available for this step.

Implements cloe::DriverRequest.

◆ has_steering_angle()

bool cloe::NopDriverRequest::has_steering_angle ( ) const
inlineoverridevirtual

Return true if steering angle request is available for this step.

Implements cloe::DriverRequest.

◆ process()

Duration cloe::NopDriverRequest::process ( const Sync )
inlineoverridevirtual

Perform model processing given the simulation context.

In particular, the model may read and write information from and to data it has, in particular any vehicles.

  • Method is_operational() should return true.
  • It may throw an exception. Those derived from ModelError are more likely to be correctly handled, however. The simulation may handle it by a) removing or replacing the model, b) stopping the simulation, or c) ignoring the exception. In the last case, this method will be called again in the next simulation step. In any case, assume that the simulation will print a message to the logs or the console.
  • It should return the current simulation duration from the model's time domain, which is expected to be less or equal to sync.time().

Implements cloe::Model.

Here is the call graph for this function:

◆ reset()

void cloe::NopDriverRequest::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.

Here is the call graph for this function:

◆ steering_angle()

boost::optional<double> cloe::NopDriverRequest::steering_angle ( ) const
inlineoverridevirtual

Return driver-requested steering angle at front wheels in [rad].

Implements cloe::DriverRequest.


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