15 #ifndef OPENSCENARIO_INTERPRETER__SIMULATOR_CORE_HPP_
16 #define OPENSCENARIO_INTERPRETER__SIMULATOR_CORE_HPP_
43 static inline std::unique_ptr<traffic_simulator::API> core =
nullptr;
46 template <
typename Node,
typename... Ts>
51 core = std::make_unique<traffic_simulator::API>(
52 node, configuration, std::forward<decltype(
xs)>(
xs)...);
54 throw Error(
"The simulator core has already been instantiated.");
58 static auto active() {
return static_cast<bool>(core); }
63 core->despawnEntities();
64 core->closeZMQConnection();
69 static auto update() ->
void { core->updateFrame(); }
80 template <
typename T,
typename std::enable_if_t<std::is_same_v<T, NativeLanePosition>,
int> = 0>
83 constexpr
bool include_crosswalk{
false};
87 return result.value();
90 "The specified WorldPosition = [", pose.position.x,
", ", pose.position.y,
", ",
92 "] could not be approximated to the proper Lane. Perhaps the "
93 "WorldPosition points to a location where multiple lanes overlap, and "
94 "there are at least two or more candidates for a LanePosition that "
95 "can be approximated to that WorldPosition. This issue can be "
96 "resolved by strictly specifying the location using LanePosition "
97 "instead of WorldPosition");
102 typename T,
typename std::enable_if_t<std::is_same_v<T, NativeWorldPosition>,
int> = 0>
111 if (
const auto from_entity = core->getEntityPointer(from_entity_name)) {
112 if (
const auto to_entity = core->getEntityPointer(to_entity_name)) {
115 from_entity->getMapPose(), to_entity->getMapPose()))
116 return relative_pose.value();
125 if (
const auto from_entity = core->getEntityPointer(from_entity_name)) {
127 const auto relative_pose =
129 return relative_pose.value();
138 if (
const auto to_entity = core->getEntityPointer(to_entity_name)) {
140 const auto relative_pose =
142 return relative_pose.value();
150 const RoutingAlgorithm::value_type routing_algorithm = RoutingAlgorithm::undefined)
153 if (
const auto to_entity = core->getEntityPointer(to_entity_name)) {
154 if (
const auto to_lanelet_pose = to_entity->getCanonicalizedLaneletPose()) {
156 from_entity_name, to_lanelet_pose.value(), routing_algorithm);
164 const RoutingAlgorithm::value_type routing_algorithm = RoutingAlgorithm::undefined)
167 if (
const auto from_entity = core->getEntityPointer(from_entity_name)) {
168 if (
const auto from_lanelet_pose = from_entity->getCanonicalizedLaneletPose()) {
170 from_lanelet_pose.value(), to_lanelet_pose, routing_algorithm);
178 const RoutingAlgorithm::value_type routing_algorithm = RoutingAlgorithm::undefined)
183 (routing_algorithm == RoutingAlgorithm::value_type::shortest);
185 from_lanelet_pose, to_lanelet_pose, routing_configuration, core->getHdmapUtils());
190 const RoutingAlgorithm::value_type routing_algorithm = RoutingAlgorithm::undefined)
192 if (
const auto from_entity = core->getEntityPointer(from_entity_name)) {
193 if (
const auto to_entity = core->getEntityPointer(to_entity_name)) {
194 if (
const auto from_lanelet_pose = from_entity->getCanonicalizedLaneletPose()) {
195 if (
const auto to_lanelet_pose = to_entity->getCanonicalizedLaneletPose()) {
197 from_lanelet_pose.value(), from_entity->getBoundingBox(), to_lanelet_pose.value(),
198 to_entity->getBoundingBox(), routing_algorithm);
208 const RoutingAlgorithm::value_type routing_algorithm = RoutingAlgorithm::undefined)
210 if (
const auto from_entity = core->getEntityPointer(from_entity_name)) {
211 if (
const auto from_lanelet_pose = from_entity->getCanonicalizedLaneletPose()) {
213 from_lanelet_pose.value(), from_entity->getBoundingBox(), to_lanelet_pose,
225 const RoutingAlgorithm::value_type routing_algorithm = RoutingAlgorithm::undefined)
230 (routing_algorithm == RoutingAlgorithm::value_type::shortest);
232 from_lanelet_pose, from_bounding_box, to_lanelet_pose, to_bounding_box,
233 routing_configuration, core->getHdmapUtils());
239 if (
const auto from_entity = core->getEntityPointer(from_entity_name)) {
240 if (
const auto to_entity = core->getEntityPointer(to_entity_name)) {
243 from_entity->getMapPose(), from_entity->getBoundingBox(), to_entity->getMapPose(),
244 to_entity->getBoundingBox())) {
245 return relative_pose.value();
255 if (
const auto from_entity = core->getEntityPointer(from_entity_name)) {
258 from_entity->getMapPose(), from_entity->getBoundingBox(), to_map_pose,
260 return relative_pose.value();
268 const RoutingAlgorithm::value_type routing_algorithm = RoutingAlgorithm::undefined) ->
int
271 const auto from_lanelet_pose =
272 core->getEntity(from_entity_name).getCanonicalizedLaneletPose()) {
274 const auto to_lanelet_pose =
275 core->getEntity(to_entity_name).getCanonicalizedLaneletPose()) {
278 (routing_algorithm == RoutingAlgorithm::value_type::shortest);
281 from_lanelet_pose.value(), to_lanelet_pose.value(), routing_configuration,
282 core->getHdmapUtils())) {
283 return lane_changes.value().first - lane_changes.value().second;
288 "Failed to evaluate lateral relative lanes between ", from_entity_name,
" and ",
296 template <
typename... Ts>
299 return core->getEntity(entity_ref).requestAcquirePosition(std::forward<decltype(
xs)>(
xs)...);
302 template <
typename... Ts>
305 return core->spawn(std::forward<decltype(
xs)>(
xs)...);
308 template <
typename EntityRef,
typename DynamicConstra
ints>
312 auto & entity = core->getEntity(entity_ref);
313 entity.setBehaviorParameter([&]() {
314 auto behavior_parameter = entity.getBehaviorParameter();
317 const auto setIfNotInf = [](
auto & target,
const auto & value) {
318 if (not std::isinf(value)) {
322 setIfNotInf(behavior_parameter.dynamic_constraints.max_speed, dynamic_constraints.max_speed);
323 setIfNotInf(behavior_parameter.dynamic_constraints.max_acceleration, dynamic_constraints.max_acceleration);
324 setIfNotInf(behavior_parameter.dynamic_constraints.max_acceleration_rate, dynamic_constraints.max_acceleration_rate);
325 setIfNotInf(behavior_parameter.dynamic_constraints.max_deceleration, dynamic_constraints.max_deceleration);
326 setIfNotInf(behavior_parameter.dynamic_constraints.max_deceleration_rate, dynamic_constraints.max_deceleration_rate);
329 return behavior_parameter;
333 template <
typename Controller>
337 auto & entity = core->getEntity(entity_ref);
338 entity.setVelocityLimit(controller.properties.template get<Double>(
339 "maxSpeed", std::numeric_limits<Double::value_type>::max()));
341 entity.setBehaviorParameter([&]() {
342 auto message = entity.getBehaviorParameter();
343 message.see_around = not controller.properties.template get<Boolean>(
"isBlind");
345 message.dynamic_constraints.max_acceleration =
346 controller.properties.template get<Double>(
"maxAcceleration", 10.0);
347 message.dynamic_constraints.max_acceleration_rate =
348 controller.properties.template get<Double>(
"maxAccelerationRate", 3.0);
349 message.dynamic_constraints.max_deceleration =
350 controller.properties.template get<Double>(
"maxDeceleration", 10.0);
351 message.dynamic_constraints.max_deceleration_rate =
352 controller.properties.template get<Double>(
"maxDecelerationRate", 3.0);
353 message.dynamic_constraints.max_speed =
354 controller.properties.template get<Double>(
"maxSpeed", 50.0);
358 if (controller.isAutoware()) {
359 core->attachImuSensor(entity_ref, [&]() {
360 simulation_api_schema::ImuSensorConfiguration configuration;
361 configuration.set_entity(entity_ref);
362 configuration.set_frame_id(
"base_link");
363 configuration.set_add_gravity(
true);
364 configuration.set_use_seed(
true);
365 configuration.set_seed(0);
366 configuration.set_noise_standard_deviation_orientation(0.01);
367 configuration.set_noise_standard_deviation_twist(0.01);
368 configuration.set_noise_standard_deviation_acceleration(0.01);
369 return configuration;
372 core->attachLidarSensor([&]() {
373 simulation_api_schema::LidarConfiguration configuration;
375 auto degree_to_radian = [](
auto degree) {
376 return degree / 180.0 * boost::math::constants::pi<double>();
380 configuration.set_architecture_type(core->getROS2Parameter<
std::string>(
"architecture_type",
"awf/universe/20240605"));
381 configuration.set_entity(entity_ref);
382 configuration.set_horizontal_resolution(degree_to_radian(controller.properties.template get<Double>(
"pointcloudHorizontalResolution", 1.0)));
383 configuration.set_lidar_sensor_delay(controller.properties.template get<Double>(
"pointcloudPublishingDelay"));
384 configuration.set_scan_duration(0.1);
387 const auto vertical_field_of_view = degree_to_radian(
388 controller.properties.template get<Double>(
"pointcloudVerticalFieldOfView", 30.0));
390 const auto channels =
391 controller.properties.template get<UnsignedInteger>(
"pointcloudChannels", 16);
393 for (std::size_t i = 0; i < channels; ++i) {
394 configuration.add_vertical_angles(
395 vertical_field_of_view / 2 - vertical_field_of_view / channels * i);
398 return configuration;
401 core->attachDetectionSensor([&]() {
402 simulation_api_schema::DetectionSensorConfiguration configuration;
404 configuration.set_architecture_type(core->getROS2Parameter<
std::string>(
"architecture_type",
"awf/universe/20240605"));
405 configuration.set_entity(entity_ref);
406 configuration.set_detect_all_objects_in_range(controller.properties.template get<Boolean>(
"isClairvoyant"));
407 configuration.set_object_recognition_delay(controller.properties.template get<Double>(
"detectedObjectPublishingDelay"));
408 configuration.set_pos_noise_stddev(controller.properties.template get<Double>(
"detectedObjectPositionStandardDeviation"));
409 configuration.set_probability_of_lost(controller.properties.template get<Double>(
"detectedObjectMissingProbability"));
410 configuration.set_random_seed(controller.properties.template get<UnsignedInteger>(
"randomSeed"));
411 configuration.set_range(controller.properties.template get<Double>(
"detectionSensorRange",300.0));
412 configuration.set_object_recognition_ground_truth_delay(controller.properties.template get<Double>(
"detectedObjectGroundTruthPublishingDelay"));
413 configuration.set_update_duration(0.1);
415 return configuration;
418 core->attachOccupancyGridSensor([&]() {
419 simulation_api_schema::OccupancyGridSensorConfiguration configuration;
421 configuration.set_architecture_type(core->getROS2Parameter<
std::string>(
"architecture_type",
"awf/universe/20240605"));
422 configuration.set_entity(entity_ref);
423 configuration.set_filter_by_range(controller.properties.template get<Boolean>(
"isClairvoyant"));
424 configuration.set_height(200);
425 configuration.set_range(300);
426 configuration.set_resolution(0.5);
427 configuration.set_update_duration(0.1);
428 configuration.set_width(200);
430 return configuration;
433 core->attachPseudoTrafficLightDetector([&]() {
434 simulation_api_schema::PseudoTrafficLightDetectorConfiguration configuration;
435 configuration.set_architecture_type(
436 core->getROS2Parameter<
std::string>(
"architecture_type",
"awf/universe/20240605"));
437 return configuration;
440 auto & ego_entity = core->getEgoEntity(entity_ref);
442 ego_entity.setParameter<
bool>(
443 "allow_goal_modification",
444 controller.properties.template get<Boolean>(
"allowGoalModification"));
446 for (
const auto & module :
448 manual_modules_string.erase(
450 manual_modules_string.begin(), manual_modules_string.end(),
451 [](
const auto & c) { return std::isspace(c); }),
452 manual_modules_string.end());
454 std::vector<std::string> modules;
456 std::istringstream modules_stream(manual_modules_string);
457 while (std::getline(modules_stream, buffer,
',')) {
458 modules.push_back(buffer);
461 }(controller.properties.template get<String>(
462 "featureIdentifiersRequiringExternalPermissionForAutonomousDecisions"))) {
464 ego_entity.requestAutoModeForCooperation(module,
false);
465 }
catch (
const Error & error) {
467 "featureIdentifiersRequiringExternalPermissionForAutonomousDecisions is not "
468 "supported in this environment: ",
475 template <
typename... Ts>
478 return core->getEntity(entity_ref).requestAssignRoute(std::forward<decltype(
xs)>(
xs)...);
481 template <
typename... Ts>
484 return core->despawn(std::forward<decltype(
xs)>(
xs)...);
487 template <
typename... Ts>
490 return core->getEntity(entity_ref).requestFollowTrajectory(std::forward<decltype(
xs)>(
xs)...);
493 template <
typename... Ts>
496 return core->getEntity(entity_ref).requestLaneChange(std::forward<decltype(
xs)>(
xs)...);
499 template <
typename... Ts>
502 return core->getEntity(entity_ref).requestSpeedChange(std::forward<decltype(
xs)>(
xs)...);
506 typename PoseType,
typename... Ts,
507 typename = std::enable_if_t<
513 return core->getEntity(name).setStatus(pose, std::forward<decltype(
xs)>(
xs)...);
516 template <
typename... Ts>
520 return core->getEntity(name).setStatus(
521 core->getEntity(reference_entity_name).getMapPose(), std::forward<decltype(
xs)>(
xs)...);
524 template <
typename... Ts>
527 return core->getEntity(entity_ref).requestWalkStraight(std::forward<decltype(
xs)>(
xs)...);
537 return core->getEntity(name).getCurrentAccel().linear.x;
540 template <
typename... Ts>
543 return core->checkCollision(std::forward<decltype(
xs)>(
xs)...);
550 if (
const auto from_entity = core->getEntityPointer(from_entity_name)) {
551 if (
const auto to_entity = core->getEntityPointer(to_entity_name)) {
554 from_entity->getMapPose(), from_entity->getBoundingBox(), to_entity->getMapPose(),
555 to_entity->getBoundingBox())) {
560 return std::numeric_limits<double>::quiet_NaN();
565 if (
const auto observer = core->getEntityPointer(from.name())) {
566 if (
const auto observed = core->getEntityPointer(to.name())) {
567 auto velocity = [](
const auto & entity) -> Eigen::Vector3d {
568 auto direction = [](
const auto & q) -> Eigen::Vector3d {
569 return Eigen::Quaternion(q.w, q.x, q.y, q.z) * Eigen::Vector3d::UnitX();
571 return direction(entity->getMapPose().orientation) * entity->getCurrentTwist().linear.x;
574 const Eigen::Matrix3d rotation =
577 return rotation.transpose() * velocity(observed) -
578 rotation.transpose() * velocity(observer);
582 return Eigen::Vector3d(Double::nan(), Double::nan(), Double::nan());
585 template <
typename... Ts>
589 return core->getCurrentTime(std::forward<decltype(
xs)>(
xs)...);
591 return std::numeric_limits<double>::quiet_NaN();
605 const auto linear = core->getEntity(name).getCurrentTwist().linear;
606 return Eigen::Vector3d(linear.x, linear.y, linear.z);
611 return core->getEntity(name).getStandStillDuration();
617 if (
const auto from_entity = core->getEntityPointer(from_entity_name)) {
618 if (
const auto to_entity = core->getEntityPointer(to_entity_name)) {
620 from_entity->getMapPose(), to_entity->getMapPose());
621 relative_pose && relative_pose->position.x <= 0) {
622 const double time_headway =
623 (relative_pose->position.x * -1) / to_entity->getCurrentTwist().linear.x;
624 return std::isnan(time_headway) ? std::numeric_limits<double>::infinity()
629 return std::numeric_limits<double>::quiet_NaN();
636 template <
typename Performance,
typename Properties>
641 core->getEntity(entity_ref)
642 .activateOutOfRangeJob(
645 properties.template get<Double>(
"minJerk", Double::lowest()),
646 properties.template get<Double>(
"maxJerk", Double::max()));
651 return core->startNpcLogic();
654 template <
typename... Ts>
657 return core->getEntity(entity_ref).getCurrentAction(std::forward<decltype(
xs)>(
xs)...);
660 template <
typename EntityRef,
typename OSCLanePosition>
662 const EntityRef & entity_ref,
const OSCLanePosition & osc_lane_position)
664 if (
const auto entity = core->getEntityPointer(entity_ref)) {
665 const auto from_map_pose = entity->getMapPose();
668 const auto relative_pose =
670 return static_cast<Double>(std::abs(
674 return Double::nan();
677 template <
typename EntityRef>
680 if (
const auto entity = core->getEntityPointer(entity_ref)) {
681 if (
const auto canonicalized_lanelet_pose = entity->getCanonicalizedLaneletPose()) {
682 return static_cast<Double>(std::abs(
686 return Double::nan();
691 return core->getEgoEntity(ego_ref).engage();
696 return core->getEgoEntity(ego_ref).isEngageable();
701 return core->getEgoEntity(ego_ref).isEngaged();
704 template <
typename... Ts>
708 if (
const auto ego_name = core->getFirstEgoName()) {
709 return core->getEgoEntity(ego_name.value())
710 .sendCooperateCommand(std::forward<decltype(
xs)>(
xs)...);
718 return core->getEgoEntity(ego_ref).getMinimumRiskManeuverBehaviorName();
723 return core->getEgoEntity(ego_ref).getMinimumRiskManeuverStateName();
728 return core->getEgoEntity(ego_ref).getEmergencyStateName();
733 return core->getEgoEntity(ego_ref).getTurnIndicatorsCommandName();
737 template <
typename... Ts>
740 return core->getConventionalTrafficLights()->setTrafficLightsState(
741 std::forward<decltype(
xs)>(
xs)...);
744 template <
typename... Ts>
747 return core->getConventionalTrafficLights()->setTrafficLightsConfidence(
748 std::forward<decltype(
xs)>(
xs)...);
751 template <
typename... Ts>
754 return core->getConventionalTrafficLights()->getTrafficLightsComposedState(
755 std::forward<decltype(
xs)>(
xs)...);
758 template <
typename... Ts>
761 return core->getConventionalTrafficLights()->compareTrafficLightsState(
762 std::forward<decltype(
xs)>(
xs)...);
765 template <
typename... Ts>
768 return core->getConventionalTrafficLights()->resetUpdate(std::forward<decltype(
xs)>(
xs)...);
771 template <
typename... Ts>
774 return core->getV2ITrafficLights()->setTrafficLightsState(std::forward<decltype(
xs)>(
xs)...);
777 template <
typename... Ts>
780 return core->getV2ITrafficLights()->resetUpdate(std::forward<decltype(
xs)>(
xs)...);
Definition: simulator_core.hpp:294
static auto applyWalkStraightAction(const std::string &entity_ref, Ts &&... xs)
Definition: simulator_core.hpp:525
static auto applyFollowTrajectoryAction(const std::string &entity_ref, Ts &&... xs)
Definition: simulator_core.hpp:488
static auto applyAcquirePositionAction(const std::string &entity_ref, Ts &&... xs)
Definition: simulator_core.hpp:297
static auto applyAssignRouteAction(const std::string &entity_ref, Ts &&... xs)
Definition: simulator_core.hpp:476
static auto applyAssignControllerAction(const std::string &entity_ref, Controller &&controller) -> void
Definition: simulator_core.hpp:334
static auto applyLaneChangeAction(const std::string &entity_ref, Ts &&... xs)
Definition: simulator_core.hpp:494
static auto applyProfileAction(const EntityRef &entity_ref, const DynamicConstraints &dynamic_constraints) -> void
Definition: simulator_core.hpp:309
static auto applyDeleteEntityAction(Ts &&... xs)
Definition: simulator_core.hpp:482
static auto applyTeleportAction(const std::string &name, const PoseType &pose, Ts &&... xs)
Definition: simulator_core.hpp:511
static auto applySpeedAction(const std::string &entity_ref, Ts &&... xs)
Definition: simulator_core.hpp:500
static auto applyAddEntityAction(Ts &&... xs)
Definition: simulator_core.hpp:303
static auto applyTeleportAction(const std::string &name, const std::string &reference_entity_name, Ts &&... xs)
Definition: simulator_core.hpp:517
Definition: simulator_core.hpp:533
static auto evaluateStandStill(const std::string &name)
Definition: simulator_core.hpp:609
static auto evaluateCollisionCondition(Ts &&... xs) -> bool
Definition: simulator_core.hpp:541
static auto evaluateAcceleration(const std::string &name)
Definition: simulator_core.hpp:535
static auto evaluateSimulationTime(Ts &&... xs) -> double
Definition: simulator_core.hpp:586
static auto evaluateBoundingBoxEuclideanDistance(const std::string &from_entity_name, const std::string &to_entity_name)
Definition: simulator_core.hpp:546
static auto evaluateRelativeSpeed(const Entity &from, const Entity &to) -> Eigen::Vector3d
Definition: simulator_core.hpp:563
static auto evaluateSpeed(const std::string &name)
Definition: simulator_core.hpp:595
static auto evaluateTimeHeadway(const std::string &from_entity_name, const std::string &to_entity_name)
Definition: simulator_core.hpp:614
Definition: simulator_core.hpp:72
static auto makeNativeRelativeWorldPosition(const std::string &from_entity_name, const std::string &to_entity_name)
Definition: simulator_core.hpp:108
static auto makeNativeBoundingBoxRelativeWorldPosition(const std::string &from_entity_name, const std::string &to_entity_name)
Definition: simulator_core.hpp:236
static auto makeNativeRelativeLanePosition(const std::string &from_entity_name, const NativeLanePosition &to_lanelet_pose, const RoutingAlgorithm::value_type routing_algorithm=RoutingAlgorithm::undefined) -> traffic_simulator::LaneletPose
Definition: simulator_core.hpp:162
static auto makeNativeBoundingBoxRelativeLanePosition(const std::string &from_entity_name, const std::string &to_entity_name, const RoutingAlgorithm::value_type routing_algorithm=RoutingAlgorithm::undefined)
Definition: simulator_core.hpp:188
static auto makeNativeBoundingBoxRelativeLanePosition(const NativeLanePosition &from_lanelet_pose, const traffic_simulator_msgs::msg::BoundingBox &from_bounding_box, const NativeLanePosition &to_lanelet_pose, const traffic_simulator_msgs::msg::BoundingBox &to_bounding_box, const RoutingAlgorithm::value_type routing_algorithm=RoutingAlgorithm::undefined) -> traffic_simulator::LaneletPose
Definition: simulator_core.hpp:220
static auto convert(const NativeLanePosition &native_lane_position) -> NativeWorldPosition
Definition: simulator_core.hpp:103
static auto convert(const NativeWorldPosition &pose) -> NativeLanePosition
Definition: simulator_core.hpp:81
static auto evaluateLateralRelativeLanes(const std::string &from_entity_name, const std::string &to_entity_name, const RoutingAlgorithm::value_type routing_algorithm=RoutingAlgorithm::undefined) -> int
Definition: simulator_core.hpp:266
static auto makeNativeRelativeLanePosition(const NativeLanePosition &from_lanelet_pose, const NativeLanePosition &to_lanelet_pose, const RoutingAlgorithm::value_type routing_algorithm=RoutingAlgorithm::undefined) -> traffic_simulator::LaneletPose
Definition: simulator_core.hpp:176
static auto makeNativeBoundingBoxRelativeWorldPosition(const std::string &from_entity_name, const NativeWorldPosition &to_map_pose)
Definition: simulator_core.hpp:252
static auto makeNativeRelativeLanePosition(const std::string &from_entity_name, const std::string &to_entity_name, const RoutingAlgorithm::value_type routing_algorithm=RoutingAlgorithm::undefined) -> traffic_simulator::LaneletPose
Definition: simulator_core.hpp:148
static auto canonicalize(const traffic_simulator::LaneletPose &non_canonicalized) -> NativeLanePosition
Definition: simulator_core.hpp:74
static auto makeNativeRelativeWorldPosition(const std::string &from_entity_name, const NativeWorldPosition &to_map_pose)
Definition: simulator_core.hpp:122
static auto makeNativeRelativeWorldPosition(const NativeWorldPosition &from_map_pose, const std::string &to_entity_name)
Definition: simulator_core.hpp:135
static auto makeNativeBoundingBoxRelativeLanePosition(const std::string &from_entity_name, const NativeLanePosition &to_lanelet_pose, const RoutingAlgorithm::value_type routing_algorithm=RoutingAlgorithm::undefined)
Definition: simulator_core.hpp:206
Definition: simulator_core.hpp:634
static auto isEngageable(const std::string &ego_ref) -> decltype(auto)
Definition: simulator_core.hpp:694
static auto evaluateRelativeHeading(const EntityRef &entity_ref)
Definition: simulator_core.hpp:678
static auto getMinimumRiskManeuverStateName(const std::string &ego_ref) -> decltype(auto)
Definition: simulator_core.hpp:721
static auto setV2ITrafficLightsState(Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:772
static auto resetV2ITrafficLightPublishRate(Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:778
static auto setConventionalTrafficLightsState(Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:738
static auto compareConventionalTrafficLightsState(Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:759
static auto resetConventionalTrafficLightPublishRate(Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:766
static auto getMinimumRiskManeuverBehaviorName(const std::string &ego_ref) -> decltype(auto)
Definition: simulator_core.hpp:716
static auto evaluateRelativeHeading(const EntityRef &entity_ref, const OSCLanePosition &osc_lane_position)
Definition: simulator_core.hpp:661
static auto getConventionalTrafficLightsComposedState(Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:752
static auto getTurnIndicatorsCommandName(const std::string &ego_ref) -> decltype(auto)
Definition: simulator_core.hpp:731
static auto sendCooperateCommand(Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:705
static auto activatePerformanceAssertion(const std::string &entity_ref, const Performance &performance, const Properties &properties)
Definition: simulator_core.hpp:637
static auto engage(const std::string &ego_ref) -> decltype(auto)
Definition: simulator_core.hpp:689
static auto evaluateCurrentState(const std::string &entity_ref, Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:655
static auto setConventionalTrafficLightConfidence(Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:745
static auto activateNonUserDefinedControllers() -> decltype(auto)
Definition: simulator_core.hpp:649
static auto isEngaged(const std::string &ego_ref) -> decltype(auto)
Definition: simulator_core.hpp:699
static auto getEmergencyStateName(const std::string &ego_ref) -> decltype(auto)
Definition: simulator_core.hpp:726
Definition: simulator_core.hpp:42
static auto deactivate() -> void
Definition: simulator_core.hpp:60
static auto active()
Definition: simulator_core.hpp:58
static auto activate(const Node &node, const traffic_simulator::Configuration &configuration, Ts &&... xs) -> void
Definition: simulator_core.hpp:47
static auto update() -> void
Definition: simulator_core.hpp:69
Definition: lanelet_pose.hpp:35
auto getRotationMatrix(T quat) -> Eigen::Matrix3d
Definition: get_rotation_matrix.hpp:33
auto convertQuaternionToEulerAngle(const T &q)
Definition: quaternion_to_euler.hpp:30
traffic_simulator::CanonicalizedLaneletPose NativeLanePosition
Definition: simulator_core.hpp:37
geometry_msgs::msg::Pose NativeWorldPosition
Definition: simulator_core.hpp:33
traffic_simulator::LaneletPose NativeRelativeLanePosition
Definition: simulator_core.hpp:39
NativeWorldPosition NativeRelativeWorldPosition
Definition: simulator_core.hpp:35
auto distance(const geometry_msgs::Pose &pose1, const geometry_msgs::Pose &pose2)
Definition: detection_sensor.cpp:36
auto countLaneChanges(const CanonicalizedLaneletPose &from, const CanonicalizedLaneletPose &to, const traffic_simulator::RoutingConfiguration &routing_configuration, const std::shared_ptr< hdmap_utils::HdMapUtils > &hdmap_utils_ptr) -> std::optional< std::pair< int, int >>
Definition: distance.cpp:49
auto boundingBoxDistance(const geometry_msgs::msg::Pose &from, const traffic_simulator_msgs::msg::BoundingBox &from_bounding_box, const geometry_msgs::msg::Pose &to, const traffic_simulator_msgs::msg::BoundingBox &to_bounding_box) -> std::optional< double >
Definition: distance.cpp:133
geometry_msgs::msg::Pose Pose
Definition: lanelet_wrapper.hpp:65
traffic_simulator_msgs::msg::BoundingBox BoundingBox
Definition: lanelet_wrapper.hpp:61
auto quietNaNPose() -> geometry_msgs::msg::Pose
Definition: pose.cpp:34
auto quietNaNLaneletPose() -> LaneletPose
Definition: pose.cpp:44
auto relativeLaneletPose(const CanonicalizedLaneletPose &from, const CanonicalizedLaneletPose &to, const RoutingConfiguration &routing_configuration, const std::shared_ptr< hdmap_utils::HdMapUtils > &hdmap_utils_ptr) -> LaneletPose
Definition: pose.cpp:285
auto boundingBoxRelativePose(const geometry_msgs::msg::Pose &from, const traffic_simulator_msgs::msg::BoundingBox &from_bounding_box, const geometry_msgs::msg::Pose &to, const traffic_simulator_msgs::msg::BoundingBox &to_bounding_box) -> std::optional< geometry_msgs::msg::Pose >
Definition: pose.cpp:263
auto relativePose(const geometry_msgs::msg::Pose &from, const geometry_msgs::msg::Pose &to) -> std::optional< geometry_msgs::msg::Pose >
Definition: pose.cpp:241
auto boundingBoxRelativeLaneletPose(const CanonicalizedLaneletPose &from, const traffic_simulator_msgs::msg::BoundingBox &from_bounding_box, const CanonicalizedLaneletPose &to, const traffic_simulator_msgs::msg::BoundingBox &to_bounding_box, const RoutingConfiguration &routing_configuration, const std::shared_ptr< hdmap_utils::HdMapUtils > &hdmap_utils_ptr) -> LaneletPose
Definition: pose.cpp:311
auto toCanonicalizedLaneletPose(const LaneletPose &lanelet_pose) -> std::optional< CanonicalizedLaneletPose >
Definition: pose.cpp:104
auto toMapPose(const CanonicalizedLaneletPose &lanelet_pose) -> geometry_msgs::msg::Pose
Definition: pose.cpp:87
traffic_simulator_msgs::msg::LaneletPose LaneletPose
Definition: lanelet_pose.hpp:30
Definition: junit5.hpp:25
std::string string
Definition: junit5.hpp:26
Definition: exception.hpp:27
Definition: controller.hpp:46
Definition: double.hpp:25
Definition: dynamic_constraints.hpp:44
Definition: entity_ref.hpp:35
Definition: entity.hpp:46
Definition: properties.hpp:42
Definition: configuration.hpp:31
Definition: routing_configuration.hpp:24
bool allow_lane_change
Definition: routing_configuration.hpp:25
traffic_simulator::lanelet_pose::CanonicalizedLaneletPose CanonicalizedLaneletPose
Definition: test_lanelet_pose.cpp:21