Skip to content

Commit 7122ba0

Browse files
authored
Merge branch 'autowarefoundation:main' into main
2 parents 64b34c9 + 38bbc67 commit 7122ba0

File tree

541 files changed

+12447
-4551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

541 files changed

+12447
-4551
lines changed

.cspell-partial.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
2-
"ignorePaths": ["**/perception/**", "**/sensing/**", "perception/bytetrack/lib/**"],
2+
"ignorePaths": [
3+
"**/perception/**",
4+
"sensing/tier4_pcl_extensions/include/**",
5+
"perception/bytetrack/lib/**"
6+
],
37
"ignoreRegExpList": [],
48
"words": []
59
}

.github/CODEOWNERS

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ common/component_interface_tools/** isamu.takagi@tier4.jp kahhooi.tan@tier4.jp m
1414
common/component_interface_utils/** isamu.takagi@tier4.jp kahhooi.tan@tier4.jp makoto.yabuta@tier4.jp yukihiro.saito@tier4.jp
1515
common/cuda_utils/** daisuke.nishimatsu@tier4.jp manato.hirabayashi@tier4.jp
1616
common/fake_test_node/** opensource@apex.ai satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp
17+
common/geography_utils/** koji.minoda@tier4.jp
1718
common/global_parameter_loader/** ryohsuke.mitsudome@tier4.jp
1819
common/glog_component/** takamasa.horibe@tier4.jp
1920
common/goal_distance_calculator/** taiki.tanaka@tier4.jp
@@ -117,7 +118,7 @@ perception/lidar_apollo_segmentation_tvm/** ambroise.vincent@arm.com xinyu.wang@
117118
perception/lidar_apollo_segmentation_tvm_nodes/** ambroise.vincent@arm.com xinyu.wang@tier4.jp
118119
perception/lidar_centerpoint/** kenzo.lobos@tier4.jp yusuke.muramatsu@tier4.jp
119120
perception/lidar_centerpoint_tvm/** carl.liu@autocore.ai xinyu.wang@tier4.jp
120-
perception/map_based_prediction/** shunsuke.miura@tier4.jp tomoya.kimura@tier4.jp yoshi.ri@tier4.jp yutaka.shimizu@tier4.jp
121+
perception/map_based_prediction/** kyoichi.sugahara@tier4.jp shunsuke.miura@tier4.jp takayuki.murooka@tier4.jp tomoya.kimura@tier4.jp yoshi.ri@tier4.jp yutaka.shimizu@tier4.jp
121122
perception/multi_object_tracker/** yoshi.ri@tier4.jp yukihiro.saito@tier4.jp
122123
perception/object_merger/** yoshi.ri@tier4.jp yukihiro.saito@tier4.jp
123124
perception/object_range_splitter/** yukihiro.saito@tier4.jp
@@ -166,7 +167,7 @@ planning/freespace_planning_algorithms/** kosuke.takeuchi@tier4.jp takamasa.hori
166167
planning/mission_planner/** isamu.takagi@tier4.jp kosuke.takeuchi@tier4.jp ryohsuke.mitsudome@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp yutaka.shimizu@tier4.jp
167168
planning/motion_velocity_smoother/** fumiya.watanabe@tier4.jp makoto.kurihara@tier4.jp takamasa.horibe@tier4.jp yutaka.shimizu@tier4.jp
168169
planning/obstacle_avoidance_planner/** kosuke.takeuchi@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp
169-
planning/obstacle_cruise_planner/** takayuki.murooka@tier4.jp yutaka.shimizu@tier4.jp
170+
planning/obstacle_cruise_planner/** kosuke.takeuchi@tier4.jp satoshi.ota@tier4.jp takayuki.murooka@tier4.jp yutaka.shimizu@tier4.jp
170171
planning/obstacle_stop_planner/** berkay@leodrive.ai satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp taiki.tanaka@tier4.jp tomoya.kimura@tier4.jp
171172
planning/obstacle_velocity_limiter/** maxime.clement@tier4.jp
172173
planning/path_smoother/** maxime.clement@tier4.jp takayuki.murooka@tier4.jp

common/geography_utils/CMakeLists.txt

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
cmake_minimum_required(VERSION 3.14)
2+
project(geography_utils)
3+
4+
find_package(autoware_cmake REQUIRED)
5+
autoware_package()
6+
7+
# GeographicLib
8+
find_package(PkgConfig)
9+
find_path(GeographicLib_INCLUDE_DIR GeographicLib/Config.h
10+
PATH_SUFFIXES GeographicLib
11+
)
12+
set(GeographicLib_INCLUDE_DIRS ${GeographicLib_INCLUDE_DIR})
13+
find_library(GeographicLib_LIBRARIES NAMES Geographic)
14+
15+
ament_auto_add_library(geography_utils SHARED
16+
src/height.cpp
17+
src/projection.cpp
18+
src/lanelet2_projector.cpp
19+
)
20+
21+
target_link_libraries(geography_utils
22+
${GeographicLib_LIBRARIES}
23+
)
24+
25+
if(BUILD_TESTING)
26+
find_package(ament_cmake_ros REQUIRED)
27+
28+
file(GLOB_RECURSE test_files test/*.cpp)
29+
30+
ament_add_ros_isolated_gtest(test_geography_utils ${test_files})
31+
32+
target_link_libraries(test_geography_utils
33+
geography_utils
34+
)
35+
endif()
36+
37+
ament_auto_package()

common/geography_utils/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# geography_utils
2+
3+
## Purpose
4+
5+
This package contains geography-related functions used by other packages, so please refer to them as needed.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright 2023 TIER IV, Inc.
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 GEOGRAPHY_UTILS__HEIGHT_HPP_
16+
#define GEOGRAPHY_UTILS__HEIGHT_HPP_
17+
18+
#include <string>
19+
20+
namespace geography_utils
21+
{
22+
23+
typedef double (*HeightConversionFunction)(
24+
const double height, const double latitude, const double longitude);
25+
double convert_wgs84_to_egm2008(const double height, const double latitude, const double longitude);
26+
double convert_egm2008_to_wgs84(const double height, const double latitude, const double longitude);
27+
double convert_height(
28+
const double height, const double latitude, const double longitude,
29+
const std::string & source_vertical_datum, const std::string & target_vertical_datum);
30+
31+
} // namespace geography_utils
32+
33+
#endif // GEOGRAPHY_UTILS__HEIGHT_HPP_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright 2023 TIER IV, Inc.
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 GEOGRAPHY_UTILS__LANELET2_PROJECTOR_HPP_
16+
#define GEOGRAPHY_UTILS__LANELET2_PROJECTOR_HPP_
17+
18+
#include <tier4_map_msgs/msg/map_projector_info.hpp>
19+
20+
#include <lanelet2_io/Projection.h>
21+
22+
#include <memory>
23+
24+
namespace geography_utils
25+
{
26+
using MapProjectorInfo = tier4_map_msgs::msg::MapProjectorInfo;
27+
28+
std::unique_ptr<lanelet::Projector> get_lanelet2_projector(const MapProjectorInfo & projector_info);
29+
30+
} // namespace geography_utils
31+
32+
#endif // GEOGRAPHY_UTILS__LANELET2_PROJECTOR_HPP_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright 2023 TIER IV, Inc.
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 GEOGRAPHY_UTILS__PROJECTION_HPP_
16+
#define GEOGRAPHY_UTILS__PROJECTION_HPP_
17+
18+
#include <geographic_msgs/msg/geo_point.hpp>
19+
#include <geometry_msgs/msg/point.hpp>
20+
#include <tier4_map_msgs/msg/map_projector_info.hpp>
21+
22+
namespace geography_utils
23+
{
24+
using MapProjectorInfo = tier4_map_msgs::msg::MapProjectorInfo;
25+
using GeoPoint = geographic_msgs::msg::GeoPoint;
26+
using LocalPoint = geometry_msgs::msg::Point;
27+
28+
LocalPoint project_forward(const GeoPoint & geo_point, const MapProjectorInfo & projector_info);
29+
GeoPoint project_reverse(const LocalPoint & local_point, const MapProjectorInfo & projector_info);
30+
31+
} // namespace geography_utils
32+
33+
#endif // GEOGRAPHY_UTILS__PROJECTION_HPP_

common/geography_utils/package.xml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0"?>
2+
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
3+
<package format="3">
4+
<name>geography_utils</name>
5+
<version>0.1.0</version>
6+
<description>The geography_utils package</description>
7+
<maintainer email="koji.minoda@tier4.jp">Koji Minoda</maintainer>
8+
<license>Apache License 2.0</license>
9+
10+
<buildtool_depend>ament_cmake_auto</buildtool_depend>
11+
<buildtool_depend>autoware_cmake</buildtool_depend>
12+
13+
<depend>geographic_msgs</depend>
14+
<depend>geographiclib</depend>
15+
<depend>geometry_msgs</depend>
16+
<depend>lanelet2_extension</depend>
17+
<depend>lanelet2_io</depend>
18+
<depend>tier4_map_msgs</depend>
19+
20+
<test_depend>ament_cmake_ros</test_depend>
21+
<test_depend>ament_lint_auto</test_depend>
22+
<test_depend>autoware_lint_common</test_depend>
23+
24+
<export>
25+
<build_type>ament_cmake</build_type>
26+
</export>
27+
</package>

common/geography_utils/src/height.cpp

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// Copyright 2023 TIER IV, Inc.
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+
#include <GeographicLib/Geoid.hpp>
16+
#include <geography_utils/height.hpp>
17+
18+
#include <map>
19+
#include <stdexcept>
20+
#include <string>
21+
#include <utility>
22+
23+
namespace geography_utils
24+
{
25+
26+
double convert_wgs84_to_egm2008(const double height, const double latitude, const double longitude)
27+
{
28+
GeographicLib::Geoid egm2008("egm2008-1");
29+
// cSpell: ignore ELLIPSOIDTOGEOID
30+
return egm2008.ConvertHeight(latitude, longitude, height, GeographicLib::Geoid::ELLIPSOIDTOGEOID);
31+
}
32+
33+
double convert_egm2008_to_wgs84(const double height, const double latitude, const double longitude)
34+
{
35+
GeographicLib::Geoid egm2008("egm2008-1");
36+
// cSpell: ignore GEOIDTOELLIPSOID
37+
return egm2008.ConvertHeight(latitude, longitude, height, GeographicLib::Geoid::GEOIDTOELLIPSOID);
38+
}
39+
40+
double convert_height(
41+
const double height, const double latitude, const double longitude,
42+
const std::string & source_vertical_datum, const std::string & target_vertical_datum)
43+
{
44+
if (source_vertical_datum == target_vertical_datum) {
45+
return height;
46+
}
47+
std::map<std::pair<std::string, std::string>, HeightConversionFunction> conversion_map;
48+
conversion_map[{"WGS84", "EGM2008"}] = convert_wgs84_to_egm2008;
49+
conversion_map[{"EGM2008", "WGS84"}] = convert_egm2008_to_wgs84;
50+
51+
auto key = std::make_pair(source_vertical_datum, target_vertical_datum);
52+
if (conversion_map.find(key) != conversion_map.end()) {
53+
return conversion_map[key](height, latitude, longitude);
54+
} else {
55+
std::string error_message =
56+
"Invalid conversion types: " + std::string(source_vertical_datum.c_str()) + " to " +
57+
std::string(target_vertical_datum.c_str());
58+
59+
throw std::invalid_argument(error_message);
60+
}
61+
}
62+
63+
} // namespace geography_utils
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// Copyright 2023 TIER IV, Inc.
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+
#include <GeographicLib/Geoid.hpp>
16+
#include <geography_utils/lanelet2_projector.hpp>
17+
#include <lanelet2_extension/projection/mgrs_projector.hpp>
18+
#include <lanelet2_extension/projection/transverse_mercator_projector.hpp>
19+
20+
#include <lanelet2_projection/UTM.h>
21+
22+
namespace geography_utils
23+
{
24+
25+
std::unique_ptr<lanelet::Projector> get_lanelet2_projector(const MapProjectorInfo & projector_info)
26+
{
27+
if (projector_info.projector_type == MapProjectorInfo::LOCAL_CARTESIAN_UTM) {
28+
lanelet::GPSPoint position{
29+
projector_info.map_origin.latitude, projector_info.map_origin.longitude,
30+
projector_info.map_origin.altitude};
31+
lanelet::Origin origin{position};
32+
lanelet::projection::UtmProjector projector{origin};
33+
return std::make_unique<lanelet::projection::UtmProjector>(projector);
34+
35+
} else if (projector_info.projector_type == MapProjectorInfo::MGRS) {
36+
lanelet::projection::MGRSProjector projector{};
37+
return std::make_unique<lanelet::projection::MGRSProjector>(projector);
38+
39+
} else if (projector_info.projector_type == MapProjectorInfo::TRANSVERSE_MERCATOR) {
40+
lanelet::GPSPoint position{
41+
projector_info.map_origin.latitude, projector_info.map_origin.longitude,
42+
projector_info.map_origin.altitude};
43+
lanelet::Origin origin{position};
44+
lanelet::projection::TransverseMercatorProjector projector{origin};
45+
return std::make_unique<lanelet::projection::TransverseMercatorProjector>(projector);
46+
47+
} else {
48+
const std::string error_msg =
49+
"Invalid map projector type: " + projector_info.projector_type +
50+
". Currently supported types: MGRS, LocalCartesianUTM, and TransverseMercator";
51+
throw std::invalid_argument(error_msg);
52+
}
53+
}
54+
55+
} // namespace geography_utils

0 commit comments

Comments
 (0)