sumo-integrator  0.4.0-alpha4+201812051700
sumo-integrator is a C++ static library that provides abstract integration tools geared towards connecting SUMO with a (any) graphic engine(s).
sumointegrator::Sumo::Ego Class Reference

Exposes facilities related to the ego entity. More...

#include <include/sumo-integrator/core/Ego.h>

Public Member Functions

void subscribe (const std::vector< int > &, const double, const double, const double)
 Subscribe to the data feed of neighbouring vehicles. More...
 
types::Datamaps poll ()
 Poll the neighbouring vehicles data feed. More...
 
void move (const types::Position &)
 Move an ego entity. More...
 
void move (const std::string &, const types::Position &)
 Move an ego entity. More...
 
std::string get_id ()
 Get the id of the ego entity. More...
 
void set_id (const std::string &)
 Set the id of the ego entity. More...
 

Detailed Description

Exposes facilities related to the ego entity.

Author
Mattia Affabris - matti.nosp@m.a.af.nosp@m.fabri.nosp@m.s@an.nosp@m.temot.nosp@m.ion..nosp@m.com
Date
2018-11-26
2018-11-29
Version
0.4.0-alpha4
3

Handles the ego entity within SUMO's simulation. It is assumed only one "main" ego entity exists, although it is possible to alter the state of other entities as if they were ego entities themselves.

Note
May only be accessed as a pointer member class of sumointegrator::Sumo (sumointegrator::Sumo::ego).

Inherits sumointegrator::Sumo::Concern.

Member Function Documentation

◆ subscribe()

void sumointegrator::Sumo::Ego::subscribe ( const std::vector< int > &  request,
const double  radius,
const double  start,
const double  end 
)

Subscribe to the data feed of neighbouring vehicles.

Data is received from only those vehicles within a circle cantered in the ego vehicle and with the given radius. Once subscribed to a data feed, on each SUMO simulation tick that data is made available through poll().

Units
start seconds (s)
end seconds (s)
'radius' meters (m)
Parameters
[in]requestThe requested data.
[in]startThe time the subscription starts taking effect.
[in]endThe time the subscription stops taking effect.
[in]radiusThe radius of the circle area.
Debug
DEBUG_INFO - Subscription target. DEBUG_DATA - Number of vehicles in the radius.

◆ poll()

types::Datamaps sumointegrator::Sumo::Ego::poll ( )

Poll the neighbouring vehicles data feed.

It is assumed a subscription was previously made with subscribe(). The data is collected in an std::map (types::Datamaps) and can be index-accessed for usage; the amount of datasets received depends on the number of vehicles within the radius specified with subscribe().

Returns
An std::map of entries, the keys being the vehicles and the corresponding content being an std::map of entries with all the requested data.
Note
No failure state is returned if no subscription was previously made.
Debug
DEBUG_DATA - Number of datapoints received from the subscription for each vehicle.

◆ move() [1/2]

void sumointegrator::Sumo::Ego::move ( const types::Position position)

Move an ego entity.

The ego entity is placed at the given coordinates, with no interpolation or extrapolation made on its state vectors between subsequent move()s. SUMO is capable of interacting with this ego entity based on (subsequent) position(s) alone.

Note
The id of the SUMO entity acting as the ego entity must be set first with set_id().
Units
position meters (m), meters (m), meters (m)
Parameters
[in]positionThe target 3D position.
Exceptions
types::RuntimeExceptionIf the id is not set.
See also
move(const std::string&, const Position&)

◆ move() [2/2]

void sumointegrator::Sumo::Ego::move ( const std::string &  id,
const types::Position position 
)

Move an ego entity.

The SUMO entity identified by its id is placed in the given coordinates, with no interpolation or extrapolation made on its state vectors between subsequent move(const std::string&, const Position&). This method is useful to move entities other than the "main" ego.

Units
position meters (m), meters (m), meters (m)
Parameters
[in]idThe id of the SUMO entity.
[in]positionThe target 3D position.
See also
move(const Position&)

◆ get_id()

std::string sumointegrator::Sumo::Ego::get_id ( )

Get the id of the ego entity.

Returns
The id of the ego entity.

◆ set_id()

void sumointegrator::Sumo::Ego::set_id ( const std::string &  id)

Set the id of the ego entity.

Parameters
[in]idThe id of the ego entity.

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