scenario_simulator_v2 C++ API
pose.hpp
Go to the documentation of this file.
1 // Copyright 2015 TIER IV, Inc. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef TRAFFIC_SIMULATOR__UTILS__POSE_HPP_
16 #define TRAFFIC_SIMULATOR__UTILS__POSE_HPP_
17 
19 
20 namespace traffic_simulator
21 {
22 inline namespace pose
23 {
24 // Useful constructors
25 auto quietNaNPose() -> geometry_msgs::msg::Pose;
26 
28 
29 // Conversions
30 auto canonicalize(
31  const LaneletPose & lanelet_pose,
32  const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr)
33  -> std::optional<CanonicalizedLaneletPose>;
34 
35 auto toMapPose(const CanonicalizedLaneletPose & lanelet_pose) -> geometry_msgs::msg::Pose;
36 
37 auto toMapPose(
38  const LaneletPose & lanelet_pose,
39  const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr) -> geometry_msgs::msg::Pose;
40 
42  const geometry_msgs::msg::Pose & map_pose, const bool include_crosswalk,
43  const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr)
44  -> std::optional<CanonicalizedLaneletPose>;
45 
47  const geometry_msgs::msg::Pose & map_pose,
48  const traffic_simulator_msgs::msg::BoundingBox & bounding_box, const bool include_crosswalk,
49  const double matching_distance, const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr)
50  -> std::optional<CanonicalizedLaneletPose>;
51 
53  const geometry_msgs::msg::Pose & map_pose,
54  const traffic_simulator_msgs::msg::BoundingBox & bounding_box,
55  const lanelet::Ids & unique_route_lanelets, const bool include_crosswalk,
56  const double matching_distance, const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr)
57  -> std::optional<CanonicalizedLaneletPose>;
58 
60  const geometry_msgs::msg::Pose & global_pose, const geometry_msgs::msg::Pose & relative_pose)
61  -> geometry_msgs::msg::Pose;
62 
63 // Relative msg::Pose
64 auto relativePose(const geometry_msgs::msg::Pose & from, const geometry_msgs::msg::Pose & to)
65  -> std::optional<geometry_msgs::msg::Pose>;
66 
67 auto relativePose(const geometry_msgs::msg::Pose & from, const CanonicalizedLaneletPose & to)
68  -> std::optional<geometry_msgs::msg::Pose>;
69 
70 auto relativePose(const CanonicalizedLaneletPose & from, const geometry_msgs::msg::Pose & to)
71  -> std::optional<geometry_msgs::msg::Pose>;
72 
74  const geometry_msgs::msg::Pose & from,
75  const traffic_simulator_msgs::msg::BoundingBox & from_bounding_box,
76  const geometry_msgs::msg::Pose & to,
77  const traffic_simulator_msgs::msg::BoundingBox & to_bounding_box)
78  -> std::optional<geometry_msgs::msg::Pose>;
79 
80 // Relative LaneletPose
82  const CanonicalizedLaneletPose & from, const CanonicalizedLaneletPose & to,
83  const traffic_simulator::RoutingConfiguration & routing_configuration,
84  const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr) -> LaneletPose;
85 
87  const CanonicalizedLaneletPose & from,
88  const traffic_simulator_msgs::msg::BoundingBox & from_bounding_box,
89  const CanonicalizedLaneletPose & to,
90  const traffic_simulator_msgs::msg::BoundingBox & to_bounding_box,
91  const traffic_simulator::RoutingConfiguration & routing_configuration,
92  const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr) -> LaneletPose;
93 
94 // Others
95 auto isInLanelet(
96  const CanonicalizedLaneletPose & canonicalized_lanelet_pose, const lanelet::Id lanelet_id,
97  const double tolerance, const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr) -> bool;
98 
100  const CanonicalizedLaneletPose & canonicalized_lanelet_pose,
101  const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr) -> bool;
102 
103 // it will be moved to "lanelet" namespace
104 auto laneletLength(
105  const lanelet::Id lanelet_id, const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr)
106  -> double;
107 
108 namespace pedestrian
109 {
111  const geometry_msgs::msg::Pose & map_pose,
112  const traffic_simulator_msgs::msg::BoundingBox & bounding_box,
113  const lanelet::Ids & unique_route_lanelets, const bool include_crosswalk,
114  const double matching_distance, const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr)
115  -> std::optional<CanonicalizedLaneletPose>;
116 } // namespace pedestrian
117 } // namespace pose
118 } // namespace traffic_simulator
119 #endif // TRAFFIC_SIMULATOR__UTILS__POSE_HPP_
Definition: lanelet_pose.hpp:27
auto transformToCanonicalizedLaneletPose(const geometry_msgs::msg::Pose &map_pose, const traffic_simulator_msgs::msg::BoundingBox &bounding_box, const lanelet::Ids &unique_route_lanelets, const bool include_crosswalk, const double matching_distance, const std::shared_ptr< hdmap_utils::HdMapUtils > &hdmap_utils_ptr) -> std::optional< CanonicalizedLaneletPose >
Definition: pose.cpp:288
auto laneletLength(const lanelet::Id lanelet_id, const std::shared_ptr< hdmap_utils::HdMapUtils > &hdmap_utils_ptr) -> double
Definition: pose.cpp:274
auto quietNaNPose() -> geometry_msgs::msg::Pose
Definition: pose.cpp:25
auto canonicalize(const LaneletPose &lanelet_pose, const std::shared_ptr< hdmap_utils::HdMapUtils > &hdmap_utils_ptr) -> std::optional< CanonicalizedLaneletPose >
Definition: pose.cpp:47
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:178
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:158
auto relativePose(const geometry_msgs::msg::Pose &from, const geometry_msgs::msg::Pose &to) -> std::optional< geometry_msgs::msg::Pose >
Definition: pose.cpp:136
auto isAtEndOfLanelets(const CanonicalizedLaneletPose &canonicalized_lanelet_pose, const std::shared_ptr< hdmap_utils::HdMapUtils > &hdmap_utils_ptr) -> bool
Definition: pose.cpp:265
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:203
auto transformRelativePoseToGlobal(const geometry_msgs::msg::Pose &global_pose, const geometry_msgs::msg::Pose &relative_pose) -> geometry_msgs::msg::Pose
Definition: pose.cpp:124
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:73
auto isInLanelet(const CanonicalizedLaneletPose &canonicalized_lanelet_pose, const lanelet::Id lanelet_id, const double tolerance, const std::shared_ptr< hdmap_utils::HdMapUtils > &hdmap_utils_ptr) -> bool
Definition: pose.cpp:231
auto toMapPose(const CanonicalizedLaneletPose &lanelet_pose) -> geometry_msgs::msg::Pose
Definition: pose.cpp:59
Definition: api.hpp:48
traffic_simulator_msgs::msg::LaneletPose LaneletPose
Definition: lanelet_pose.hpp:22
Definition: routing_configuration.hpp:24