$darkmode
minimator::MinimatorVehicle Class Reference
Inheritance diagram for minimator::MinimatorVehicle:
Collaboration diagram for minimator::MinimatorVehicle:

Public Member Functions

 MinimatorVehicle (uint16_t id, const std::string &name, SimulatorSensorMockup &simulator_sensor_mockup)
 
cloe::Duration process (const cloe::Sync &sync) final
 
- Public Member Functions inherited from cloe::Vehicle
 Vehicle (uint64_t id, const std::string &name)
 
std::shared_ptr< Vehicleclone (uint64_t id, const std::string &name)
 
uint64_t id () const
 
size_t size () const
 
bool has (const std::string &key) const
 
template<typename Enum , std::enable_if_t< std::is_enum< Enum >::value, int > = 0>
bool has (Enum c) const
 
template<typename T >
std::shared_ptr< const T > get (const std::string &key) const
 
template<typename T >
std::shared_ptr< T > get (const std::string &key)
 
template<typename T , typename Enum , std::enable_if_t< std::is_enum< Enum >::value, int > = 0>
std::shared_ptr< const T > get (Enum c) const
 
template<typename T , typename Enum , std::enable_if_t< std::is_enum< Enum >::value, int > = 0>
std::shared_ptr< T > get (Enum c)
 
template<typename... Arguments>
void new_component (Component *ptr, const Arguments &... aliases)
 
template<typename First , typename... Arguments>
void add_component (std::shared_ptr< Component > sp, const First &alias, const Arguments &... aliases)
 
template<typename Enum , std::enable_if_t< std::is_enum< Enum >::value, int > = 0>
void add_component (std::shared_ptr< Component > sp, Enum c)
 
void add_component (std::shared_ptr< Component > sp, const std::string &alias)
 
template<typename First , typename... Arguments>
void emplace_component (std::shared_ptr< Component > sp, const First &alias, const Arguments &... aliases)
 
template<typename Enum , std::enable_if_t< std::is_enum< Enum >::value, int > = 0>
void emplace_component (std::shared_ptr< Component > sp, Enum c)
 
void emplace_component (std::shared_ptr< Component > sp, const std::string &alias)
 
void set_component (const std::string &key, std::shared_ptr< Component > component)
 
std::vector< std::string > component_names () const
 
Duration process (const Sync &sync) override
 
void connect () override
 
void disconnect () override
 
void enroll (Registrar &r) 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 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

SimulatorSensorMockupsimulator_sensor_mockup_
 
- 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::Vehicle
std::shared_ptr< const Componentat (const std::string &key) const
 
std::shared_ptr< Componentat (const std::string &key)
 
- Protected Member Functions inherited from cloe::Entity
virtual Logger logger () const
 

Detailed Description

MinimatorVehicle is the implementation of a vehicle that comes from a Minimator simulator.

In a Cloe simulation, a Vehicle provides the platform on which communication between simulators and controllers occurs. This communication happens through components that are contained in the vehicle. These components are filled and read by the simulator that provides the vehicle. The controller doesn't need to know what exact type each component is or how it gets its data, as long as the components fulfill one of the common component interfaces. This leaves the simulator plugin the job of dealing with concrete types. In fact, the simulator must normally provide each component implementation.

During initialization, Minimator will create a vehicle for each name that is provided in the configuration.

See also
cloe/vehicle.hpp

Constructor & Destructor Documentation

◆ MinimatorVehicle()

minimator::MinimatorVehicle::MinimatorVehicle ( uint16_t  id,
const std::string &  name,
SimulatorSensorMockup simulator_sensor_mockup 
)
inline

Construct a MinimatorVehicle.

  • id unique ID within simulator's set of vehicles
  • name unique name within simulator's set of vehicles
  • simulator_sensor_mockup world object containing list of ego vehicles and traffic objects, simulating data coming from a simulator.

Components

There are a great number of components that can be added to a vehicle. (It is also possible for a vehicle to have no components – we could be dealing with a vehicle from the 1970s for all we know – but such a vehicle wouldn't be very interesting for us.) In our minimalistic simulator, we provide three components.

  • Ego sensor. This provides information on the vehicle itself, such as how fast the vehicle is traveling or where it is in the world.
  • Object sensor. This provides information on the world outside of the vehicle, such as would come from a video camera or radar.
  • Actuator. This lets of send actuation commands to the vehicle, such as an acceleration or a steering angle.

We would normally create our own implementation of these sensors, based on our feature set, but since this is a super-minimalistic simulator, we'll use dummy sensors.

See also
cloe/component.hpp
cloe/component/ego_sensor.hpp
cloe/component/object_sensor.hpp
cloe/component/latlong_actuator.hpp

Member Function Documentation

◆ process()

cloe::Duration minimator::MinimatorVehicle::process ( const cloe::Sync sync)
inlinefinalvirtual

Update vehicle component data for the given time step.

If any components in the vehicle need to clear their cache or update underlying data, this is the time to do it. If any trigger events are associated with the vehicle, this is also the right point to trigger them.

If the vehicle is not used in the simulation, this method will not be called.

  • sync Simulation synchronization information
    Returns
    Minimum simulation time of all components
    See also
    Vehicle::process

Implements cloe::Model.


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