$darkmode
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< Vehicle > | clone (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 | |
| SimulatorSensorMockup & | simulator_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 Component > | at (const std::string &key) const |
| std::shared_ptr< Component > | at (const std::string &key) |
Protected Member Functions inherited from cloe::Entity | |
| virtual Logger | logger () const |
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.
|
inline |
Construct a MinimatorVehicle.
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.
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.
|
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.
Implements cloe::Model.