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};
86 pose, include_crosswalk, core->getHdmapUtils())) {
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->getEntity(from_entity_name)) {
112 if (
const auto to_entity = core->getEntity(to_entity_name)) {
115 from_entity->getMapPose(), to_entity->getMapPose()))
116 return relative_pose.value();
125 if (
const auto from_entity = core->getEntity(from_entity_name)) {
127 const auto relative_pose =
129 return relative_pose.value();
138 if (
const auto to_entity = core->getEntity(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->getEntity(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->getEntity(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->getEntity(from_entity_name)) {
193 if (
const auto to_entity = core->getEntity(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->getEntity(from_entity_name)) {
211 if (
const auto from_lanelet_pose = from_entity->getCanonicalizedLaneletPose()) {
213 from_lanelet_pose.value(), from_entity->getBoundingBox(), to_lanelet_pose,
214 traffic_simulator_msgs::msg::BoundingBox(), routing_algorithm);
222 const traffic_simulator_msgs::msg::BoundingBox & from_bounding_box,
224 const traffic_simulator_msgs::msg::BoundingBox & to_bounding_box,
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->getEntity(from_entity_name)) {
240 if (
const auto to_entity = core->getEntity(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->getEntity(from_entity_name)) {
258 from_entity->getMapPose(), from_entity->getBoundingBox(), to_map_pose,
259 traffic_simulator_msgs::msg::BoundingBox())) {
260 return relative_pose.value();
268 const RoutingAlgorithm::value_type routing_algorithm = RoutingAlgorithm::undefined) ->
int
272 (routing_algorithm == RoutingAlgorithm::value_type::shortest);
273 if (
const auto from_entity = core->getEntity(from_entity_name)) {
274 if (
const auto to_entity = core->getEntity(to_entity_name)) {
277 from_entity->getCanonicalizedLaneletPose().value(),
278 to_entity->getCanonicalizedLaneletPose().value(), routing_configuration,
279 core->getHdmapUtils())) {
280 return lane_changes.value().first - lane_changes.value().second;
285 "Failed to evaluate lateral relative lanes between ", from_entity_name,
" and ",
293 template <
typename... Ts>
296 core->requestClearRoute(entity_ref);
297 return core->requestAcquirePosition(entity_ref, std::forward<decltype(
xs)>(
xs)...);
300 template <
typename... Ts>
303 return core->spawn(std::forward<decltype(
xs)>(
xs)...);
306 template <
typename EntityRef,
typename DynamicConstra
ints>
310 return core->setBehaviorParameter(entity_ref, [&]() {
311 auto behavior_parameter = core->getBehaviorParameter(entity_ref);
313 if (not std::isinf(dynamic_constraints.max_speed)) {
314 behavior_parameter.dynamic_constraints.max_speed = dynamic_constraints.max_speed;
317 if (not std::isinf(dynamic_constraints.max_acceleration)) {
318 behavior_parameter.dynamic_constraints.max_acceleration =
319 dynamic_constraints.max_acceleration;
322 if (not std::isinf(dynamic_constraints.max_acceleration_rate)) {
323 behavior_parameter.dynamic_constraints.max_acceleration_rate =
324 dynamic_constraints.max_acceleration_rate;
327 if (not std::isinf(dynamic_constraints.max_deceleration)) {
328 behavior_parameter.dynamic_constraints.max_deceleration =
329 dynamic_constraints.max_deceleration;
332 if (not std::isinf(dynamic_constraints.max_deceleration_rate)) {
333 behavior_parameter.dynamic_constraints.max_deceleration_rate =
334 dynamic_constraints.max_deceleration_rate;
337 return behavior_parameter;
341 template <
typename Controller>
345 core->setVelocityLimit(
346 entity_ref, controller.properties.template get<Double>(
347 "maxSpeed", std::numeric_limits<Double::value_type>::max()));
349 core->setBehaviorParameter(entity_ref, [&]() {
350 auto message = core->getBehaviorParameter(entity_ref);
351 message.see_around = not controller.properties.template get<Boolean>(
"isBlind");
353 message.dynamic_constraints.max_acceleration =
354 controller.properties.template get<Double>(
"maxAcceleration", 10.0);
355 message.dynamic_constraints.max_acceleration_rate =
356 controller.properties.template get<Double>(
"maxAccelerationRate", 3.0);
357 message.dynamic_constraints.max_deceleration =
358 controller.properties.template get<Double>(
"maxDeceleration", 10.0);
359 message.dynamic_constraints.max_deceleration_rate =
360 controller.properties.template get<Double>(
"maxDecelerationRate", 3.0);
361 message.dynamic_constraints.max_speed =
362 controller.properties.template get<Double>(
"maxSpeed", 50.0);
366 if (controller.isAutoware()) {
367 core->attachImuSensor(entity_ref, [&]() {
368 simulation_api_schema::ImuSensorConfiguration configuration;
369 configuration.set_entity(entity_ref);
370 configuration.set_frame_id(
"base_link");
371 configuration.set_add_gravity(
true);
372 configuration.set_use_seed(
true);
373 configuration.set_seed(0);
374 configuration.set_noise_standard_deviation_orientation(0.01);
375 configuration.set_noise_standard_deviation_twist(0.01);
376 configuration.set_noise_standard_deviation_acceleration(0.01);
377 return configuration;
380 core->attachLidarSensor([&]() {
381 simulation_api_schema::LidarConfiguration configuration;
383 auto degree_to_radian = [](
auto degree) {
384 return degree / 180.0 * boost::math::constants::pi<double>();
388 configuration.set_architecture_type(core->getROS2Parameter<
std::string>(
"architecture_type",
"awf/universe/20240605"));
389 configuration.set_entity(entity_ref);
390 configuration.set_horizontal_resolution(degree_to_radian(controller.properties.template get<Double>(
"pointcloudHorizontalResolution", 1.0)));
391 configuration.set_lidar_sensor_delay(controller.properties.template get<Double>(
"pointcloudPublishingDelay"));
392 configuration.set_scan_duration(0.1);
395 const auto vertical_field_of_view = degree_to_radian(
396 controller.properties.template get<Double>(
"pointcloudVerticalFieldOfView", 30.0));
398 const auto channels =
399 controller.properties.template get<UnsignedInteger>(
"pointcloudChannels", 16);
401 for (std::size_t i = 0; i < channels; ++i) {
402 configuration.add_vertical_angles(
403 vertical_field_of_view / 2 - vertical_field_of_view / channels * i);
406 return configuration;
409 core->attachDetectionSensor([&]() {
410 simulation_api_schema::DetectionSensorConfiguration configuration;
412 configuration.set_architecture_type(core->getROS2Parameter<
std::string>(
"architecture_type",
"awf/universe/20240605"));
413 configuration.set_entity(entity_ref);
414 configuration.set_detect_all_objects_in_range(controller.properties.template get<Boolean>(
"isClairvoyant"));
415 configuration.set_object_recognition_delay(controller.properties.template get<Double>(
"detectedObjectPublishingDelay"));
416 configuration.set_pos_noise_stddev(controller.properties.template get<Double>(
"detectedObjectPositionStandardDeviation"));
417 configuration.set_probability_of_lost(controller.properties.template get<Double>(
"detectedObjectMissingProbability"));
418 configuration.set_random_seed(controller.properties.template get<UnsignedInteger>(
"randomSeed"));
419 configuration.set_range(controller.properties.template get<Double>(
"detectionSensorRange",300.0));
420 configuration.set_object_recognition_ground_truth_delay(controller.properties.template get<Double>(
"detectedObjectGroundTruthPublishingDelay"));
421 configuration.set_update_duration(0.1);
423 return configuration;
426 core->attachOccupancyGridSensor([&]() {
427 simulation_api_schema::OccupancyGridSensorConfiguration configuration;
429 configuration.set_architecture_type(core->getROS2Parameter<
std::string>(
"architecture_type",
"awf/universe/20240605"));
430 configuration.set_entity(entity_ref);
431 configuration.set_filter_by_range(controller.properties.template get<Boolean>(
"isClairvoyant"));
432 configuration.set_height(200);
433 configuration.set_range(300);
434 configuration.set_resolution(0.5);
435 configuration.set_update_duration(0.1);
436 configuration.set_width(200);
438 return configuration;
441 core->attachPseudoTrafficLightDetector([&]() {
442 simulation_api_schema::PseudoTrafficLightDetectorConfiguration configuration;
443 configuration.set_architecture_type(
444 core->getROS2Parameter<
std::string>(
"architecture_type",
"awf/universe/20240605"));
445 return configuration;
448 core->asFieldOperatorApplication(entity_ref)
449 .declare_parameter<
bool>(
450 "allow_goal_modification",
451 controller.properties.template get<Boolean>(
"allowGoalModification"));
453 for (
const auto & module :
455 manual_modules_string.erase(
457 manual_modules_string.begin(), manual_modules_string.end(),
458 [](
const auto & c) { return std::isspace(c); }),
459 manual_modules_string.end());
461 std::vector<std::string> modules;
463 std::istringstream modules_stream(manual_modules_string);
464 while (std::getline(modules_stream, buffer,
',')) {
465 modules.push_back(buffer);
468 }(controller.properties.template get<String>(
469 "featureIdentifiersRequiringExternalPermissionForAutonomousDecisions"))) {
471 core->asFieldOperatorApplication(entity_ref)
472 .requestAutoModeForCooperation(module,
false);
473 }
catch (
const Error & error) {
475 "featureIdentifiersRequiringExternalPermissionForAutonomousDecisions is not "
476 "supported in this environment: ",
483 template <
typename... Ts>
486 core->requestClearRoute(entity_ref);
487 return core->requestAssignRoute(entity_ref, std::forward<decltype(
xs)>(
xs)...);
490 template <
typename... Ts>
493 return core->despawn(std::forward<decltype(
xs)>(
xs)...);
496 template <
typename... Ts>
499 return core->requestFollowTrajectory(std::forward<decltype(
xs)>(
xs)...);
502 template <
typename... Ts>
505 return core->requestLaneChange(std::forward<decltype(
xs)>(
xs)...);
508 template <
typename... Ts>
511 return core->requestSpeedChange(std::forward<decltype(
xs)>(
xs)...);
514 template <
typename... Ts>
517 return core->setEntityStatus(std::forward<decltype(
xs)>(
xs)...);
520 template <
typename... Ts>
523 return core->requestWalkStraight(std::forward<decltype(
xs)>(
xs)...);
531 template <
typename... Ts>
534 return core->getCurrentAccel(std::forward<decltype(
xs)>(
xs)...).linear.x;
537 template <
typename... Ts>
540 return core->checkCollision(std::forward<decltype(
xs)>(
xs)...);
547 if (
const auto from_entity = core->getEntity(from_entity_name)) {
548 if (
const auto to_entity = core->getEntity(to_entity_name)) {
551 from_entity->getMapPose(), from_entity->getBoundingBox(), to_entity->getMapPose(),
552 to_entity->getBoundingBox())) {
557 return std::numeric_limits<double>::quiet_NaN();
562 if (
const auto observer = core->getEntity(from.name())) {
563 if (
const auto observed = core->getEntity(to.name())) {
564 auto velocity = [](
const auto & entity) -> Eigen::Vector3d {
565 auto direction = [](
const auto & q) -> Eigen::Vector3d {
566 return Eigen::Quaternion(q.w, q.x, q.y, q.z) * Eigen::Vector3d::UnitX();
568 return direction(entity->getMapPose().orientation) * entity->getCurrentTwist().linear.x;
571 const Eigen::Matrix3d rotation =
574 return rotation.transpose() * velocity(observed) -
575 rotation.transpose() * velocity(observer);
579 return Eigen::Vector3d(Double::nan(), Double::nan(), Double::nan());
582 template <
typename... Ts>
586 return core->getCurrentTime(std::forward<decltype(
xs)>(
xs)...);
588 return std::numeric_limits<double>::quiet_NaN();
592 template <
typename... Ts>
603 const auto linear = core->getCurrentTwist(std::forward<decltype(
xs)>(
xs)...).linear;
604 return Eigen::Vector3d(linear.x, linear.y, linear.z);
607 template <
typename... Ts>
610 return core->getStandStillDuration(std::forward<decltype(
xs)>(
xs)...);
613 template <
typename... Ts>
616 if (
const auto result = core->getTimeHeadway(std::forward<decltype(
xs)>(
xs)...); result) {
617 return result.value();
619 using value_type =
typename std::decay<decltype(result)>::type::value_type;
620 return std::numeric_limits<value_type>::quiet_NaN();
628 template <
typename Performance,
typename Properties>
633 core->activateOutOfRangeJob(
635 +performance.
max_acceleration, properties.template get<Double>(
"minJerk", Double::lowest()),
636 properties.template get<Double>(
"maxJerk", Double::max()));
639 template <
typename... Ts>
642 return core->asFieldOperatorApplication(std::forward<decltype(
xs)>(
xs)...);
647 return core->startNpcLogic();
650 template <
typename... Ts>
653 return core->getCurrentAction(std::forward<decltype(
xs)>(
xs)...);
656 template <
typename EntityRef,
typename OSCLanePosition>
658 const EntityRef & entity_ref,
const OSCLanePosition & osc_lane_position)
660 if (
const auto entity = core->getEntity(entity_ref)) {
661 const auto from_map_pose = entity->getMapPose();
664 const auto relative_pose =
666 return static_cast<Double>(std::abs(
670 return Double::nan();
673 template <
typename EntityRef>
676 if (
const auto entity = core->getEntity(entity_ref)) {
677 if (
const auto canonicalized_lanelet_pose = entity->getCanonicalizedLaneletPose()) {
678 return static_cast<Double>(std::abs(
682 return Double::nan();
685 template <
typename... Ts>
689 .sendCooperateCommand(std::forward<decltype(
xs)>(
xs)...);
693 template <
typename... Ts>
696 return core->getConventionalTrafficLights()->setTrafficLightsState(
697 std::forward<decltype(
xs)>(
xs)...);
700 template <
typename... Ts>
703 return core->getConventionalTrafficLights()->setTrafficLightsConfidence(
704 std::forward<decltype(
xs)>(
xs)...);
707 template <
typename... Ts>
710 return core->getConventionalTrafficLights()->getTrafficLightsComposedState(
711 std::forward<decltype(
xs)>(
xs)...);
714 template <
typename... Ts>
717 return core->getConventionalTrafficLights()->compareTrafficLightsState(
718 std::forward<decltype(
xs)>(
xs)...);
721 template <
typename... Ts>
724 return core->getConventionalTrafficLights()->resetUpdate(std::forward<decltype(
xs)>(
xs)...);
727 template <
typename... Ts>
730 return core->getV2ITrafficLights()->setTrafficLightsState(std::forward<decltype(
xs)>(
xs)...);
733 template <
typename... Ts>
736 return core->getV2ITrafficLights()->resetUpdate(std::forward<decltype(
xs)>(
xs)...);
Definition: simulator_core.hpp:291
static auto applyWalkStraightAction(Ts &&... xs)
Definition: simulator_core.hpp:521
static auto applyFollowTrajectoryAction(Ts &&... xs)
Definition: simulator_core.hpp:497
static auto applySpeedAction(Ts &&... xs)
Definition: simulator_core.hpp:509
static auto applyAcquirePositionAction(const std::string &entity_ref, Ts &&... xs)
Definition: simulator_core.hpp:294
static auto applyAssignRouteAction(const std::string &entity_ref, Ts &&... xs)
Definition: simulator_core.hpp:484
static auto applyAssignControllerAction(const std::string &entity_ref, Controller &&controller) -> void
Definition: simulator_core.hpp:342
static auto applyProfileAction(const EntityRef &entity_ref, const DynamicConstraints &dynamic_constraints) -> void
Definition: simulator_core.hpp:307
static auto applyTeleportAction(Ts &&... xs)
Definition: simulator_core.hpp:515
static auto applyDeleteEntityAction(Ts &&... xs)
Definition: simulator_core.hpp:491
static auto applyLaneChangeAction(Ts &&... xs)
Definition: simulator_core.hpp:503
static auto applyAddEntityAction(Ts &&... xs)
Definition: simulator_core.hpp:301
Definition: simulator_core.hpp:529
static auto evaluateTimeHeadway(Ts &&... xs)
Definition: simulator_core.hpp:614
static auto evaluateCollisionCondition(Ts &&... xs) -> bool
Definition: simulator_core.hpp:538
static auto evaluateSimulationTime(Ts &&... xs) -> double
Definition: simulator_core.hpp:583
static auto evaluateBoundingBoxEuclideanDistance(const std::string &from_entity_name, const std::string &to_entity_name)
Definition: simulator_core.hpp:543
static auto evaluateRelativeSpeed(const Entity &from, const Entity &to) -> Eigen::Vector3d
Definition: simulator_core.hpp:560
static auto evaluateStandStill(Ts &&... xs)
Definition: simulator_core.hpp:608
static auto evaluateSpeed(Ts &&... xs)
Definition: simulator_core.hpp:593
static auto evaluateAcceleration(Ts &&... xs)
Definition: simulator_core.hpp:532
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:626
static auto evaluateCurrentState(Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:651
static auto evaluateRelativeHeading(const EntityRef &entity_ref)
Definition: simulator_core.hpp:674
static auto setV2ITrafficLightsState(Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:728
static auto resetV2ITrafficLightPublishRate(Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:734
static auto setConventionalTrafficLightsState(Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:694
static auto compareConventionalTrafficLightsState(Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:715
static auto resetConventionalTrafficLightPublishRate(Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:722
static auto evaluateRelativeHeading(const EntityRef &entity_ref, const OSCLanePosition &osc_lane_position)
Definition: simulator_core.hpp:657
static auto getConventionalTrafficLightsComposedState(Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:708
static auto sendCooperateCommand(Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:686
static auto activatePerformanceAssertion(const std::string &entity_ref, const Performance &performance, const Properties &properties)
Definition: simulator_core.hpp:629
static auto asFieldOperatorApplication(Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:640
static auto setConventionalTrafficLightConfidence(Ts &&... xs) -> decltype(auto)
Definition: simulator_core.hpp:701
static auto activateNonUserDefinedControllers() -> decltype(auto)
Definition: simulator_core.hpp:645
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:27
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:48
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
auto quietNaNPose() -> geometry_msgs::msg::Pose
Definition: pose.cpp:25
auto quietNaNLaneletPose() -> LaneletPose
Definition: pose.cpp:35
auto relativeLaneletPose(const CanonicalizedLaneletPose &from, const CanonicalizedLaneletPose &to, const traffic_simulator::RoutingConfiguration &routing_configuration, const std::shared_ptr< hdmap_utils::HdMapUtils > &hdmap_utils_ptr) -> LaneletPose
Definition: pose.cpp:182
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:162
auto relativePose(const geometry_msgs::msg::Pose &from, const geometry_msgs::msg::Pose &to) -> std::optional< geometry_msgs::msg::Pose >
Definition: pose.cpp:140
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 traffic_simulator::RoutingConfiguration &routing_configuration, const std::shared_ptr< hdmap_utils::HdMapUtils > &hdmap_utils_ptr) -> LaneletPose
Definition: pose.cpp:207
auto toCanonicalizedLaneletPose(const geometry_msgs::msg::Pose &map_pose, const bool include_crosswalk, const std::shared_ptr< hdmap_utils::HdMapUtils > &hdmap_utils_ptr) -> std::optional< CanonicalizedLaneletPose >
Definition: pose.cpp:77
auto toMapPose(const CanonicalizedLaneletPose &lanelet_pose) -> geometry_msgs::msg::Pose
Definition: pose.cpp:63
traffic_simulator_msgs::msg::LaneletPose LaneletPose
Definition: lanelet_pose.hpp:22
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:30
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