This is a major component of the Simulation backend, which maintains a SimulationWorld object and keeps updating it. The SimulationWorld represents the most up-to-date information about all the objects in the emulated world, including the car, the planning trajectory, etc. NOTE: This class is not thread-safe.
More...
#include <simulation_world_service.h>
|
| | SimulationWorldService (const MapService *map_service, bool routing_from_file=false) |
| | Constructor of SimulationWorldService. More...
|
| |
| const SimulationWorld & | world () const |
| | Get a read-only view of the SimulationWorld. More...
|
| |
| nlohmann::json | GetUpdateAsJson (double radius) const |
| | Returns the json representation of the SimulationWorld object. This is a public API used by offline dreamview. More...
|
| |
| void | GetWireFormatString (double radius, std::string *sim_world, std::string *sim_world_with_planning_data) |
| | Returns the binary representation of the SimulationWorld object. More...
|
| |
| nlohmann::json | GetMapElements (double radius) const |
| | Returns the json representation of the map element Ids and hash within the given radius from the car. More...
|
| |
| void | Update () |
| | The function Update() is periodically called to check for updates from the external messages. All the updates will be written to the SimulationWorld object to reflect the latest status. More...
|
| |
| void | SetToClear () |
| | Sets the flag to clear the owned simulation world object. More...
|
| |
| bool | ReadyToPush () const |
| | Check whether the SimulationWorld object has enough information. The backend won't push the SimulationWorld to frontend if it is not ready. More...
|
| |
| void | PublishMonitorMessage (apollo::common::monitor::MonitorMessageItem::LogLevel log_level, const std::string &msg) |
| | Publish message to the monitor. More...
|
| |
| void | PublishNavigationInfo (const std::shared_ptr< apollo::relative_map::NavigationInfo > &) |
| |
| void | PublishRoutingRequest (const std::shared_ptr< apollo::routing::RoutingRequest > &) |
| |
| void | PublishTask (const std::shared_ptr< apollo::task_manager::Task > &) |
| |
| void | GetMapElementIds (double radius, MapElementIds *ids) const |
| |
| const apollo::hdmap::Map & | GetRelativeMap () const |
| |
| nlohmann::json | GetRoutePathAsJson () const |
| |
| void | DumpMessages () |
| |
This is a major component of the Simulation backend, which maintains a SimulationWorld object and keeps updating it. The SimulationWorld represents the most up-to-date information about all the objects in the emulated world, including the car, the planning trajectory, etc. NOTE: This class is not thread-safe.
◆ SimulationWorldService()
| apollo::dreamview::SimulationWorldService::SimulationWorldService |
( |
const MapService * |
map_service, |
|
|
bool |
routing_from_file = false |
|
) |
| |
◆ DumpMessages()
| void apollo::dreamview::SimulationWorldService::DumpMessages |
( |
| ) |
|
◆ GetMapElementIds()
| void apollo::dreamview::SimulationWorldService::GetMapElementIds |
( |
double |
radius, |
|
|
MapElementIds * |
ids |
|
) |
| const |
◆ GetMapElements()
| nlohmann::json apollo::dreamview::SimulationWorldService::GetMapElements |
( |
double |
radius | ) |
const |
Returns the json representation of the map element Ids and hash within the given radius from the car.
- Parameters
-
| radius | the search distance from the current car location |
- Returns
- Json object that contains mapElementIds and mapHash.
◆ GetRelativeMap()
| const apollo::hdmap::Map& apollo::dreamview::SimulationWorldService::GetRelativeMap |
( |
| ) |
const |
◆ GetRoutePathAsJson()
| nlohmann::json apollo::dreamview::SimulationWorldService::GetRoutePathAsJson |
( |
| ) |
const |
◆ GetUpdateAsJson()
| nlohmann::json apollo::dreamview::SimulationWorldService::GetUpdateAsJson |
( |
double |
radius | ) |
const |
Returns the json representation of the SimulationWorld object. This is a public API used by offline dreamview.
- Parameters
-
| radius | the search distance from the current car location |
- Returns
- Json object equivalence of the SimulationWorld object.
◆ GetWireFormatString()
| void apollo::dreamview::SimulationWorldService::GetWireFormatString |
( |
double |
radius, |
|
|
std::string * |
sim_world, |
|
|
std::string * |
sim_world_with_planning_data |
|
) |
| |
Returns the binary representation of the SimulationWorld object.
- Parameters
-
| radius | the search distance from the current car location. |
| sim_world | output of binary format sim_world string. |
| sim_world_with_planning_data | output of binary format sim_world string with planning_data. |
◆ PublishMonitorMessage()
| void apollo::dreamview::SimulationWorldService::PublishMonitorMessage |
( |
apollo::common::monitor::MonitorMessageItem::LogLevel |
log_level, |
|
|
const std::string & |
msg |
|
) |
| |
Publish message to the monitor.
- Parameters
-
| msg | the string to send to monitor |
| log_level | defined in modules/common/monitor_log/proto/monitor_log.proto |
◆ PublishNavigationInfo()
| void apollo::dreamview::SimulationWorldService::PublishNavigationInfo |
( |
const std::shared_ptr< apollo::relative_map::NavigationInfo > & |
| ) |
|
◆ PublishRoutingRequest()
| void apollo::dreamview::SimulationWorldService::PublishRoutingRequest |
( |
const std::shared_ptr< apollo::routing::RoutingRequest > & |
| ) |
|
◆ PublishTask()
| void apollo::dreamview::SimulationWorldService::PublishTask |
( |
const std::shared_ptr< apollo::task_manager::Task > & |
| ) |
|
◆ ReadyToPush()
| bool apollo::dreamview::SimulationWorldService::ReadyToPush |
( |
| ) |
const |
|
inline |
Check whether the SimulationWorld object has enough information. The backend won't push the SimulationWorld to frontend if it is not ready.
- Returns
- True if the object is ready to push.
◆ SetToClear()
| void apollo::dreamview::SimulationWorldService::SetToClear |
( |
| ) |
|
|
inline |
Sets the flag to clear the owned simulation world object.
◆ Update()
| void apollo::dreamview::SimulationWorldService::Update |
( |
| ) |
|
The function Update() is periodically called to check for updates from the external messages. All the updates will be written to the SimulationWorld object to reflect the latest status.
◆ world()
| const SimulationWorld& apollo::dreamview::SimulationWorldService::world |
( |
| ) |
const |
|
inline |
Get a read-only view of the SimulationWorld.
- Returns
- Constant reference to the SimulationWorld object.
◆ kMaxMonitorItems
| constexpr int apollo::dreamview::SimulationWorldService::kMaxMonitorItems = 30 |
|
static |
The documentation for this class was generated from the following file: