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 bool allow_lane_change, const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr)
84  -> 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, const bool allow_lane_change,
91  const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr) -> LaneletPose;
92 
93 // Others
94 auto isInLanelet(
95  const CanonicalizedLaneletPose & canonicalized_lanelet_pose, const lanelet::Id lanelet_id,
96  const double tolerance, const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr) -> bool;
97 
99  const CanonicalizedLaneletPose & canonicalized_lanelet_pose,
100  const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr) -> bool;
101 
102 // it will be moved to "lanelet" namespace
103 auto laneletLength(
104  const lanelet::Id lanelet_id, const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr)
105  -> double;
106 
107 namespace pedestrian
108 {
110  const geometry_msgs::msg::Pose & map_pose,
111  const traffic_simulator_msgs::msg::BoundingBox & bounding_box,
112  const lanelet::Ids & unique_route_lanelets, const bool include_crosswalk,
113  const double matching_distance, const std::shared_ptr<hdmap_utils::HdMapUtils> & hdmap_utils_ptr)
114  -> std::optional<CanonicalizedLaneletPose>;
115 } // namespace pedestrian
116 } // namespace pose
117 } // namespace traffic_simulator
118 #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:285
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 bool allow_lane_change, const std::shared_ptr< hdmap_utils::HdMapUtils > &hdmap_utils_ptr) -> LaneletPose
Definition: pose.cpp:201
auto laneletLength(const lanelet::Id lanelet_id, const std::shared_ptr< hdmap_utils::HdMapUtils > &hdmap_utils_ptr) -> double
Definition: pose.cpp:271
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 bool allow_lane_change, 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:262
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:228
auto toMapPose(const CanonicalizedLaneletPose &lanelet_pose) -> geometry_msgs::msg::Pose
Definition: pose.cpp:59
Definition: api.hpp:49
traffic_simulator_msgs::msg::LaneletPose LaneletPose
Definition: lanelet_pose.hpp:22