scenario_simulator_v2 C++ API
|
#include <api.hpp>
Public Member Functions | |
template<typename NodeT , typename AllocatorT = std::allocator<void>, typename... Ts> | |
API (NodeT &&node, const Configuration &configuration, Ts &&... xs) | |
template<typename ParameterT , typename... Ts> | |
auto | getROS2Parameter (Ts &&... xs) const -> decltype(auto) |
auto | init () -> bool |
auto | setVerbose (const bool verbose) -> void |
auto | setSimulationStepTime (const double step_time) -> bool |
auto | startNpcLogic () -> void |
auto | isNpcLogicStarted () const -> bool |
auto | getCurrentTime () const noexcept -> double |
auto | closeZMQConnection () -> void |
auto | updateFrame () -> bool |
template<typename PoseType , typename ParamsType , typename = std::enable_if_t<std::disjunction_v< std::is_same<std::decay_t<ParamsType>, traffic_simulator_msgs::msg::VehicleParameters>, std::is_same<std::decay_t<ParamsType>, traffic_simulator_msgs::msg::PedestrianParameters>, std::is_same<std::decay_t<ParamsType>, traffic_simulator_msgs::msg::MiscObjectParameters>>>> | |
auto | spawn (const std::string &name, const PoseType &pose, const ParamsType ¶meters, const std::string &behavior="", const std::string &model3d="") -> entity::EntityBase & |
auto | attachImuSensor (const std::string &, const simulation_api_schema::ImuSensorConfiguration &configuration) -> bool |
auto | attachPseudoTrafficLightDetector (const simulation_api_schema::PseudoTrafficLightDetectorConfiguration &) -> bool |
auto | attachLidarSensor (const simulation_api_schema::LidarConfiguration &) -> bool |
auto | attachLidarSensor (const std::string &, const double lidar_sensor_delay, const helper::LidarType=helper::LidarType::VLP16) -> bool |
auto | attachDetectionSensor (const simulation_api_schema::DetectionSensorConfiguration &) -> bool |
auto | attachDetectionSensor (const std::string &, double detection_sensor_range, bool detect_all_objects_in_range, double pos_noise_stddev, int random_seed, double probability_of_lost, double object_recognition_delay) -> bool |
auto | attachOccupancyGridSensor (const simulation_api_schema::OccupancyGridSensorConfiguration &) -> bool |
auto | getFirstEgoName () const -> std::optional< std::string > |
auto | getEgoEntity (const std::string &name) -> entity::EgoEntity & |
auto | getEgoEntity (const std::string &name) const -> const entity::EgoEntity & |
auto | isEntityExist (const std::string &name) const -> bool |
auto | getEntityNames () const -> std::vector< std::string > |
auto | getEntity (const std::string &name) -> entity::EntityBase & |
auto | getEntity (const std::string &name) const -> const entity::EntityBase & |
auto | getEntityPointer (const std::string &name) const -> std::shared_ptr< entity::EntityBase > |
auto | resetBehaviorPlugin (const std::string &name, const std::string &behavior_plugin_name) -> void |
auto | respawn (const std::string &name, const geometry_msgs::msg::PoseWithCovarianceStamped &new_pose, const geometry_msgs::msg::PoseStamped &goal_pose) -> void |
auto | despawn (const std::string &name) -> bool |
auto | despawnEntities () -> bool |
auto | checkCollision (const std::string &first_entity_name, const std::string &second_entity_name) const -> bool |
auto | getHdmapUtils () const -> const std::shared_ptr< hdmap_utils::HdMapUtils > & |
auto | getV2ITrafficLights () const -> std::shared_ptr< V2ITrafficLights > |
auto | getConventionalTrafficLights () const -> std::shared_ptr< ConventionalTrafficLights > |
auto | addTrafficSource (const double radius, const double rate, const double speed, const geometry_msgs::msg::Pose &position, const traffic::TrafficSource::Distribution &distribution, const bool allow_spawn_outside_lane=false, const bool require_footprint_fitting=false, const bool random_orientation=false, std::optional< int > random_seed=std::nullopt) -> void |
Add a traffic source to the simulation. More... | |
|
inlineexplicit |
auto traffic_simulator::API::addTrafficSource | ( | const double | radius, |
const double | rate, | ||
const double | speed, | ||
const geometry_msgs::msg::Pose & | position, | ||
const traffic::TrafficSource::Distribution & | distribution, | ||
const bool | allow_spawn_outside_lane = false , |
||
const bool | require_footprint_fitting = false , |
||
const bool | random_orientation = false , |
||
std::optional< int > | random_seed = std::nullopt |
||
) | -> void |
Add a traffic source to the simulation.
radius | The radius defining the area on which entities will be spawned |
rate | The rate at which entities will be spawned [Hz] |
speed | The speed of the spawned entities |
position | The center of the area on which entities will be spawned (includes orientation) |
distribution | The parameters of the spawned entities with their respective weights for random distribution For each entity there are 4 parameters in a tuple:
|
allow_spawn_outside_lane | Whether entities can be spawned outside the lane |
require_footprint_fitting | Whether entities are required to fit inside lanelet polygon when spawned (allow_spawn_outside_lane has higher priority) |
random_orientation | Whether entities should have their orientation randomized before lane matching |
random_seed | [Optional] The seed for the random number generator |
auto traffic_simulator::API::attachDetectionSensor | ( | const simulation_api_schema::DetectionSensorConfiguration & | sensor_configuration | ) | -> bool |
auto traffic_simulator::API::attachDetectionSensor | ( | const std::string & | entity_name, |
double | detection_sensor_range, | ||
bool | detect_all_objects_in_range, | ||
double | pos_noise_stddev, | ||
int | random_seed, | ||
double | probability_of_lost, | ||
double | object_recognition_delay | ||
) | -> bool |
auto traffic_simulator::API::attachImuSensor | ( | const std::string & | , |
const simulation_api_schema::ImuSensorConfiguration & | configuration | ||
) | -> bool |
auto traffic_simulator::API::attachLidarSensor | ( | const simulation_api_schema::LidarConfiguration & | lidar_configuration | ) | -> bool |
auto traffic_simulator::API::attachLidarSensor | ( | const std::string & | entity_name, |
const double | lidar_sensor_delay, | ||
const helper::LidarType | lidar_type = helper::LidarType::VLP16 |
||
) | -> bool |
auto traffic_simulator::API::attachOccupancyGridSensor | ( | const simulation_api_schema::OccupancyGridSensorConfiguration & | sensor_configuration | ) | -> bool |
auto traffic_simulator::API::attachPseudoTrafficLightDetector | ( | const simulation_api_schema::PseudoTrafficLightDetectorConfiguration & | configuration | ) | -> bool |
auto traffic_simulator::API::checkCollision | ( | const std::string & | first_entity_name, |
const std::string & | second_entity_name | ||
) | const -> bool |
auto traffic_simulator::API::closeZMQConnection | ( | ) | -> void |
auto traffic_simulator::API::despawn | ( | const std::string & | name | ) | -> bool |
auto traffic_simulator::API::despawnEntities | ( | ) | -> bool |
auto traffic_simulator::API::getConventionalTrafficLights | ( | ) | const -> std::shared_ptr<ConventionalTrafficLights> |
|
noexcept |
auto traffic_simulator::API::getEgoEntity | ( | const std::string & | name | ) | -> entity::EgoEntity & |
auto traffic_simulator::API::getEgoEntity | ( | const std::string & | name | ) | const -> const entity::EgoEntity & |
auto traffic_simulator::API::getEntity | ( | const std::string & | name | ) | -> entity::EntityBase & |
auto traffic_simulator::API::getEntity | ( | const std::string & | name | ) | const -> const entity::EntityBase & |
auto traffic_simulator::API::getEntityNames | ( | ) | const -> std::vector<std::string> |
auto traffic_simulator::API::getEntityPointer | ( | const std::string & | name | ) | const -> std::shared_ptr<entity::EntityBase> |
auto traffic_simulator::API::getFirstEgoName | ( | ) | const -> std::optional<std::string> |
auto traffic_simulator::API::getHdmapUtils | ( | ) | const -> const std::shared_ptr<hdmap_utils::HdMapUtils> & |
|
inline |
auto traffic_simulator::API::getV2ITrafficLights | ( | ) | const -> std::shared_ptr<V2ITrafficLights> |
auto traffic_simulator::API::init | ( | ) | -> bool |
auto traffic_simulator::API::isEntityExist | ( | const std::string & | name | ) | const -> bool |
auto traffic_simulator::API::isNpcLogicStarted | ( | ) | const -> bool |
auto traffic_simulator::API::resetBehaviorPlugin | ( | const std::string & | name, |
const std::string & | behavior_plugin_name | ||
) | -> void |
auto traffic_simulator::API::respawn | ( | const std::string & | name, |
const geometry_msgs::msg::PoseWithCovarianceStamped & | new_pose, | ||
const geometry_msgs::msg::PoseStamped & | goal_pose | ||
) | -> void |
auto traffic_simulator::API::setSimulationStepTime | ( | const double | step_time | ) | -> bool |
auto traffic_simulator::API::setVerbose | ( | const bool | verbose | ) | -> void |
|
inline |
auto traffic_simulator::API::startNpcLogic | ( | ) | -> void |
auto traffic_simulator::API::updateFrame | ( | ) | -> bool |