Skip to content

Commit b45cae9

Browse files
committed
refactor(geography_utils): prefix package and namespace with autoware
Signed-off-by: Esteve Fernandez <esteve.fernandez@tier4.jp>
1 parent a742e82 commit b45cae9

File tree

23 files changed

+79
-75
lines changed

23 files changed

+79
-75
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
### Automatically generated from package.xml ###
22
common/autoware_ad_api_specs/** isamu.takagi@tier4.jp ryohsuke.mitsudome@tier4.jp
33
common/autoware_auto_common/** opensource@apex.ai satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp
4+
common/autoware_geography_utils/** koji.minoda@tier4.jp
45
common/autoware_grid_map_utils/** maxime.clement@tier4.jp
56
common/autoware_motion_utils/** fumiya.watanabe@tier4.jp kosuke.takeuchi@tier4.jp mamoru.sobue@tier4.jp satoshi.ota@tier4.jp taiki.tanaka@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp tomoya.kimura@tier4.jp
67
common/autoware_overlay_rviz_plugin/autoware_mission_details_overlay_rviz_plugin/** ahmed.ebrahim@leodrive.ai
@@ -17,7 +18,6 @@ common/component_interface_tools/** isamu.takagi@tier4.jp
1718
common/component_interface_utils/** isamu.takagi@tier4.jp yukihiro.saito@tier4.jp
1819
common/cuda_utils/** daisuke.nishimatsu@tier4.jp manato.hirabayashi@tier4.jp
1920
common/fake_test_node/** opensource@apex.ai satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp
20-
common/geography_utils/** koji.minoda@tier4.jp
2121
common/global_parameter_loader/** ryohsuke.mitsudome@tier4.jp
2222
common/glog_component/** takamasa.horibe@tier4.jp
2323
common/goal_distance_calculator/** taiki.tanaka@tier4.jp

common/geography_utils/CMakeLists.txt common/autoware_geography_utils/CMakeLists.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.14)
2-
project(geography_utils)
2+
project(autoware_geography_utils)
33

44
find_package(autoware_cmake REQUIRED)
55
autoware_package()
@@ -12,13 +12,13 @@ find_path(GeographicLib_INCLUDE_DIR GeographicLib/Config.h
1212
set(GeographicLib_INCLUDE_DIRS ${GeographicLib_INCLUDE_DIR})
1313
find_library(GeographicLib_LIBRARIES NAMES Geographic)
1414

15-
ament_auto_add_library(geography_utils SHARED
15+
ament_auto_add_library(${PROJECT_NAME} SHARED
1616
src/height.cpp
1717
src/projection.cpp
1818
src/lanelet2_projector.cpp
1919
)
2020

21-
target_link_libraries(geography_utils
21+
target_link_libraries(${PROJECT_NAME}
2222
${GeographicLib_LIBRARIES}
2323
)
2424

@@ -27,10 +27,10 @@ if(BUILD_TESTING)
2727

2828
file(GLOB_RECURSE test_files test/*.cpp)
2929

30-
ament_add_ros_isolated_gtest(test_geography_utils ${test_files})
30+
ament_add_ros_isolated_gtest(test_${PROJECT_NAME} ${test_files})
3131

32-
target_link_libraries(test_geography_utils
33-
geography_utils
32+
target_link_libraries(test_${PROJECT_NAME}
33+
${PROJECT_NAME}
3434
)
3535
endif()
3636

File renamed without changes.

common/geography_utils/include/geography_utils/height.hpp common/autoware_geography_utils/include/autoware/geography_utils/height.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef GEOGRAPHY_UTILS__HEIGHT_HPP_
16-
#define GEOGRAPHY_UTILS__HEIGHT_HPP_
15+
#ifndef AUTOWARE__GEOGRAPHY_UTILS__HEIGHT_HPP_
16+
#define AUTOWARE__GEOGRAPHY_UTILS__HEIGHT_HPP_
1717

1818
#include <string>
1919

20-
namespace geography_utils
20+
namespace autoware::geography_utils
2121
{
2222

2323
typedef double (*HeightConversionFunction)(
@@ -28,6 +28,6 @@ double convert_height(
2828
const double height, const double latitude, const double longitude,
2929
const std::string & source_vertical_datum, const std::string & target_vertical_datum);
3030

31-
} // namespace geography_utils
31+
} // namespace autoware::geography_utils
3232

33-
#endif // GEOGRAPHY_UTILS__HEIGHT_HPP_
33+
#endif // AUTOWARE__GEOGRAPHY_UTILS__HEIGHT_HPP_

common/geography_utils/include/geography_utils/lanelet2_projector.hpp common/autoware_geography_utils/include/autoware/geography_utils/lanelet2_projector.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef GEOGRAPHY_UTILS__LANELET2_PROJECTOR_HPP_
16-
#define GEOGRAPHY_UTILS__LANELET2_PROJECTOR_HPP_
15+
#ifndef AUTOWARE__GEOGRAPHY_UTILS__LANELET2_PROJECTOR_HPP_
16+
#define AUTOWARE__GEOGRAPHY_UTILS__LANELET2_PROJECTOR_HPP_
1717

1818
#include <tier4_map_msgs/msg/map_projector_info.hpp>
1919

2020
#include <lanelet2_io/Projection.h>
2121

2222
#include <memory>
2323

24-
namespace geography_utils
24+
namespace autoware::geography_utils
2525
{
2626
using MapProjectorInfo = tier4_map_msgs::msg::MapProjectorInfo;
2727

2828
std::unique_ptr<lanelet::Projector> get_lanelet2_projector(const MapProjectorInfo & projector_info);
2929

30-
} // namespace geography_utils
30+
} // namespace autoware::geography_utils
3131

32-
#endif // GEOGRAPHY_UTILS__LANELET2_PROJECTOR_HPP_
32+
#endif // AUTOWARE__GEOGRAPHY_UTILS__LANELET2_PROJECTOR_HPP_

common/geography_utils/include/geography_utils/projection.hpp common/autoware_geography_utils/include/autoware/geography_utils/projection.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef GEOGRAPHY_UTILS__PROJECTION_HPP_
16-
#define GEOGRAPHY_UTILS__PROJECTION_HPP_
15+
#ifndef AUTOWARE__GEOGRAPHY_UTILS__PROJECTION_HPP_
16+
#define AUTOWARE__GEOGRAPHY_UTILS__PROJECTION_HPP_
1717

1818
#include <geographic_msgs/msg/geo_point.hpp>
1919
#include <geometry_msgs/msg/point.hpp>
2020
#include <tier4_map_msgs/msg/map_projector_info.hpp>
2121

22-
namespace geography_utils
22+
namespace autoware::geography_utils
2323
{
2424
using MapProjectorInfo = tier4_map_msgs::msg::MapProjectorInfo;
2525
using GeoPoint = geographic_msgs::msg::GeoPoint;
@@ -28,6 +28,6 @@ using LocalPoint = geometry_msgs::msg::Point;
2828
LocalPoint project_forward(const GeoPoint & geo_point, const MapProjectorInfo & projector_info);
2929
GeoPoint project_reverse(const LocalPoint & local_point, const MapProjectorInfo & projector_info);
3030

31-
} // namespace geography_utils
31+
} // namespace autoware::geography_utils
3232

33-
#endif // GEOGRAPHY_UTILS__PROJECTION_HPP_
33+
#endif // AUTOWARE__GEOGRAPHY_UTILS__PROJECTION_HPP_

common/geography_utils/package.xml common/autoware_geography_utils/package.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0"?>
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
4-
<name>geography_utils</name>
4+
<name>autoware_geography_utils</name>
55
<version>0.1.0</version>
6-
<description>The geography_utils package</description>
6+
<description>The autoware_geography_utils package</description>
77
<maintainer email="koji.minoda@tier4.jp">Koji Minoda</maintainer>
88
<license>Apache License 2.0</license>
99

common/geography_utils/src/height.cpp common/autoware_geography_utils/src/height.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
// limitations under the License.
1414

1515
#include <GeographicLib/Geoid.hpp>
16-
#include <geography_utils/height.hpp>
16+
#include <autoware/geography_utils/height.hpp>
1717

1818
#include <map>
1919
#include <stdexcept>
2020
#include <string>
2121
#include <utility>
2222

23-
namespace geography_utils
23+
namespace autoware::geography_utils
2424
{
2525

2626
double convert_wgs84_to_egm2008(const double height, const double latitude, const double longitude)
@@ -60,4 +60,4 @@ double convert_height(
6060
}
6161
}
6262

63-
} // namespace geography_utils
63+
} // namespace autoware::geography_utils

common/geography_utils/src/lanelet2_projector.cpp common/autoware_geography_utils/src/lanelet2_projector.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
// limitations under the License.
1414

1515
#include <GeographicLib/Geoid.hpp>
16+
#include <autoware/geography_utils/lanelet2_projector.hpp>
1617
#include <autoware_lanelet2_extension/projection/mgrs_projector.hpp>
1718
#include <autoware_lanelet2_extension/projection/transverse_mercator_projector.hpp>
18-
#include <geography_utils/lanelet2_projector.hpp>
1919

2020
#include <lanelet2_projection/UTM.h>
2121

22-
namespace geography_utils
22+
namespace autoware::geography_utils
2323
{
2424

2525
std::unique_ptr<lanelet::Projector> get_lanelet2_projector(const MapProjectorInfo & projector_info)
@@ -51,4 +51,4 @@ std::unique_ptr<lanelet::Projector> get_lanelet2_projector(const MapProjectorInf
5151
throw std::invalid_argument(error_msg);
5252
}
5353

54-
} // namespace geography_utils
54+
} // namespace autoware::geography_utils

common/geography_utils/src/projection.cpp common/autoware_geography_utils/src/projection.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
// limitations under the License.
1414

1515
#include <GeographicLib/Geoid.hpp>
16+
#include <autoware/geography_utils/lanelet2_projector.hpp>
17+
#include <autoware/geography_utils/projection.hpp>
1618
#include <autoware_lanelet2_extension/projection/mgrs_projector.hpp>
17-
#include <geography_utils/lanelet2_projector.hpp>
18-
#include <geography_utils/projection.hpp>
1919

20-
namespace geography_utils
20+
namespace autoware::geography_utils
2121
{
2222

2323
Eigen::Vector3d to_basic_point_3d_pt(const LocalPoint src)
@@ -92,4 +92,4 @@ GeoPoint project_reverse(const LocalPoint & local_point, const MapProjectorInfo
9292
return geo_point;
9393
}
9494

95-
} // namespace geography_utils
95+
} // namespace autoware::geography_utils

common/geography_utils/test/test_geography_utils.cpp common/autoware_geography_utils/test/test_geography_utils.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include "geography_utils/height.hpp"
16-
#include "geography_utils/lanelet2_projector.hpp"
17-
#include "geography_utils/projection.hpp"
15+
#include "autoware/geography_utils/height.hpp"
16+
#include "autoware/geography_utils/lanelet2_projector.hpp"
17+
#include "autoware/geography_utils/projection.hpp"
1818

1919
#include <gtest/gtest.h>
2020

common/geography_utils/test/test_height.cpp common/autoware_geography_utils/test/test_height.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include <geography_utils/height.hpp>
15+
#include <autoware/geography_utils/height.hpp>
1616

1717
#include <gtest/gtest.h>
1818

@@ -28,7 +28,7 @@ TEST(GeographyUtils, SameSourceTargetDatum)
2828
const std::string datum = "WGS84";
2929

3030
double converted_height =
31-
geography_utils::convert_height(height, latitude, longitude, datum, datum);
31+
autoware::geography_utils::convert_height(height, latitude, longitude, datum, datum);
3232

3333
EXPECT_DOUBLE_EQ(height, converted_height);
3434
}
@@ -44,7 +44,7 @@ TEST(GeographyUtils, ValidSourceTargetDatum)
4444
const double target_height = -30.18;
4545

4646
double converted_height =
47-
geography_utils::convert_height(height, latitude, longitude, "WGS84", "EGM2008");
47+
autoware::geography_utils::convert_height(height, latitude, longitude, "WGS84", "EGM2008");
4848

4949
EXPECT_NEAR(target_height, converted_height, 0.1);
5050
}
@@ -57,7 +57,7 @@ TEST(GeographyUtils, InvalidSourceTargetDatum)
5757
const double longitude = 139.0;
5858

5959
EXPECT_THROW(
60-
geography_utils::convert_height(height, latitude, longitude, "INVALID1", "INVALID2"),
60+
autoware::geography_utils::convert_height(height, latitude, longitude, "INVALID1", "INVALID2"),
6161
std::invalid_argument);
6262
}
6363

@@ -69,7 +69,7 @@ TEST(GeographyUtils, InvalidSourceDatum)
6969
const double longitude = 139.0;
7070

7171
EXPECT_THROW(
72-
geography_utils::convert_height(height, latitude, longitude, "INVALID1", "WGS84"),
72+
autoware::geography_utils::convert_height(height, latitude, longitude, "INVALID1", "WGS84"),
7373
std::invalid_argument);
7474
}
7575

@@ -81,6 +81,6 @@ TEST(GeographyUtils, InvalidTargetDatum)
8181
const double longitude = 139.0;
8282

8383
EXPECT_THROW(
84-
geography_utils::convert_height(height, latitude, longitude, "WGS84", "INVALID2"),
84+
autoware::geography_utils::convert_height(height, latitude, longitude, "WGS84", "INVALID2"),
8585
std::invalid_argument);
8686
}

common/geography_utils/test/test_projection.cpp common/autoware_geography_utils/test/test_projection.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include <geography_utils/projection.hpp>
15+
#include <autoware/geography_utils/projection.hpp>
1616

1717
#include <gtest/gtest.h>
1818

@@ -41,7 +41,7 @@ TEST(GeographyUtilsProjection, ProjectForwardToMGRS)
4141

4242
// conversion
4343
const geometry_msgs::msg::Point converted_point =
44-
geography_utils::project_forward(geo_point, projector_info);
44+
autoware::geography_utils::project_forward(geo_point, projector_info);
4545

4646
EXPECT_NEAR(converted_point.x, local_point.x, 1.0);
4747
EXPECT_NEAR(converted_point.y, local_point.y, 1.0);
@@ -70,7 +70,7 @@ TEST(GeographyUtilsProjection, ProjectReverseFromMGRS)
7070

7171
// conversion
7272
const geographic_msgs::msg::GeoPoint converted_point =
73-
geography_utils::project_reverse(local_point, projector_info);
73+
autoware::geography_utils::project_reverse(local_point, projector_info);
7474

7575
EXPECT_NEAR(converted_point.latitude, geo_point.latitude, 0.0001);
7676
EXPECT_NEAR(converted_point.longitude, geo_point.longitude, 0.0001);
@@ -93,9 +93,9 @@ TEST(GeographyUtilsProjection, ProjectForwardAndReverseMGRS)
9393

9494
// conversion
9595
const geometry_msgs::msg::Point converted_local_point =
96-
geography_utils::project_forward(geo_point, projector_info);
96+
autoware::geography_utils::project_forward(geo_point, projector_info);
9797
const geographic_msgs::msg::GeoPoint converted_geo_point =
98-
geography_utils::project_reverse(converted_local_point, projector_info);
98+
autoware::geography_utils::project_reverse(converted_local_point, projector_info);
9999

100100
EXPECT_NEAR(converted_geo_point.latitude, geo_point.latitude, 0.0001);
101101
EXPECT_NEAR(converted_geo_point.longitude, geo_point.longitude, 0.0001);
@@ -126,7 +126,7 @@ TEST(GeographyUtilsProjection, ProjectForwardToLocalCartesianUTMOrigin)
126126

127127
// conversion
128128
const geometry_msgs::msg::Point converted_point =
129-
geography_utils::project_forward(geo_point, projector_info);
129+
autoware::geography_utils::project_forward(geo_point, projector_info);
130130

131131
EXPECT_NEAR(converted_point.x, local_point.x, 1.0);
132132
EXPECT_NEAR(converted_point.y, local_point.y, 1.0);
@@ -151,9 +151,9 @@ TEST(GeographyUtilsProjection, ProjectForwardAndReverseLocalCartesianUTMOrigin)
151151

152152
// conversion
153153
const geometry_msgs::msg::Point converted_local_point =
154-
geography_utils::project_forward(geo_point, projector_info);
154+
autoware::geography_utils::project_forward(geo_point, projector_info);
155155
const geographic_msgs::msg::GeoPoint converted_geo_point =
156-
geography_utils::project_reverse(converted_local_point, projector_info);
156+
autoware::geography_utils::project_reverse(converted_local_point, projector_info);
157157

158158
EXPECT_NEAR(converted_geo_point.latitude, geo_point.latitude, 0.0001);
159159
EXPECT_NEAR(converted_geo_point.longitude, geo_point.longitude, 0.0001);

localization/autoware_geo_pose_projector/package.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
<buildtool_depend>ament_cmake_auto</buildtool_depend>
1818
<buildtool_depend>autoware_cmake</buildtool_depend>
1919

20+
<depend>autoware_geography_utils</depend>
2021
<depend>component_interface_specs</depend>
2122
<depend>component_interface_utils</depend>
2223
<depend>geographic_msgs</depend>
23-
<depend>geography_utils</depend>
2424
<depend>geometry_msgs</depend>
2525
<depend>rclcpp</depend>
2626
<depend>rclcpp_components</depend>

localization/autoware_geo_pose_projector/src/geo_pose_projector.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
#include "geo_pose_projector.hpp"
1616

17-
#include <geography_utils/height.hpp>
18-
#include <geography_utils/projection.hpp>
17+
#include <autoware/geography_utils/height.hpp>
18+
#include <autoware/geography_utils/projection.hpp>
1919

2020
#ifdef ROS_DISTRO_GALACTIC
2121
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
@@ -66,8 +66,8 @@ void GeoPoseProjector::on_geo_pose(const GeoPoseWithCovariance::ConstSharedPtr m
6666
gps_point.longitude = msg->pose.pose.position.longitude;
6767
gps_point.altitude = msg->pose.pose.position.altitude;
6868
geometry_msgs::msg::Point position =
69-
geography_utils::project_forward(gps_point, projector_info_.value());
70-
position.z = geography_utils::convert_height(
69+
autoware::geography_utils::project_forward(gps_point, projector_info_.value());
70+
position.z = autoware::geography_utils::convert_height(
7171
position.z, gps_point.latitude, gps_point.longitude, MapProjectorInfo::Message::WGS84,
7272
projector_info_.value().vertical_datum);
7373

map/map_loader/package.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
<buildtool_depend>ament_cmake_auto</buildtool_depend>
2020
<buildtool_depend>autoware_cmake</buildtool_depend>
2121

22+
<depend>autoware_geography_utils</depend>
2223
<depend>autoware_lanelet2_extension</depend>
2324
<depend>autoware_map_msgs</depend>
2425
<depend>component_interface_specs</depend>
2526
<depend>component_interface_utils</depend>
2627
<depend>fmt</depend>
27-
<depend>geography_utils</depend>
2828
<depend>geometry_msgs</depend>
2929
<depend>libpcl-all-dev</depend>
3030
<depend>pcl_conversions</depend>

0 commit comments

Comments
 (0)