Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(geography_utils): prefix package and namespace with autoware #7790

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### Automatically generated from package.xml ###
common/autoware_ad_api_specs/** isamu.takagi@tier4.jp ryohsuke.mitsudome@tier4.jp
common/autoware_auto_common/** opensource@apex.ai satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp
common/autoware_geography_utils/** koji.minoda@tier4.jp
common/autoware_grid_map_utils/** maxime.clement@tier4.jp
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
common/autoware_overlay_rviz_plugin/autoware_mission_details_overlay_rviz_plugin/** ahmed.ebrahim@leodrive.ai
Expand All @@ -17,7 +18,6 @@ common/component_interface_tools/** isamu.takagi@tier4.jp
common/component_interface_utils/** isamu.takagi@tier4.jp yukihiro.saito@tier4.jp
common/cuda_utils/** daisuke.nishimatsu@tier4.jp manato.hirabayashi@tier4.jp
common/fake_test_node/** opensource@apex.ai satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp
common/geography_utils/** koji.minoda@tier4.jp
common/global_parameter_loader/** ryohsuke.mitsudome@tier4.jp
common/glog_component/** takamasa.horibe@tier4.jp
common/goal_distance_calculator/** taiki.tanaka@tier4.jp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(geography_utils)
project(autoware_geography_utils)

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

ament_auto_add_library(geography_utils SHARED
ament_auto_add_library(${PROJECT_NAME} SHARED
src/height.cpp
src/projection.cpp
src/lanelet2_projector.cpp
)

target_link_libraries(geography_utils
target_link_libraries(${PROJECT_NAME}
${GeographicLib_LIBRARIES}
)

Expand All @@ -27,10 +27,10 @@ if(BUILD_TESTING)

file(GLOB_RECURSE test_files test/*.cpp)

ament_add_ros_isolated_gtest(test_geography_utils ${test_files})
ament_add_ros_isolated_gtest(test_${PROJECT_NAME} ${test_files})

target_link_libraries(test_geography_utils
geography_utils
target_link_libraries(test_${PROJECT_NAME}
${PROJECT_NAME}
)
endif()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef GEOGRAPHY_UTILS__HEIGHT_HPP_
#define GEOGRAPHY_UTILS__HEIGHT_HPP_
#ifndef AUTOWARE__GEOGRAPHY_UTILS__HEIGHT_HPP_
#define AUTOWARE__GEOGRAPHY_UTILS__HEIGHT_HPP_

#include <string>

namespace geography_utils
namespace autoware::geography_utils
{

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

} // namespace geography_utils
} // namespace autoware::geography_utils

#endif // GEOGRAPHY_UTILS__HEIGHT_HPP_
#endif // AUTOWARE__GEOGRAPHY_UTILS__HEIGHT_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef GEOGRAPHY_UTILS__LANELET2_PROJECTOR_HPP_
#define GEOGRAPHY_UTILS__LANELET2_PROJECTOR_HPP_
#ifndef AUTOWARE__GEOGRAPHY_UTILS__LANELET2_PROJECTOR_HPP_
#define AUTOWARE__GEOGRAPHY_UTILS__LANELET2_PROJECTOR_HPP_

#include <tier4_map_msgs/msg/map_projector_info.hpp>

#include <lanelet2_io/Projection.h>

#include <memory>

namespace geography_utils
namespace autoware::geography_utils
{
using MapProjectorInfo = tier4_map_msgs::msg::MapProjectorInfo;

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

} // namespace geography_utils
} // namespace autoware::geography_utils

#endif // GEOGRAPHY_UTILS__LANELET2_PROJECTOR_HPP_
#endif // AUTOWARE__GEOGRAPHY_UTILS__LANELET2_PROJECTOR_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef GEOGRAPHY_UTILS__PROJECTION_HPP_
#define GEOGRAPHY_UTILS__PROJECTION_HPP_
#ifndef AUTOWARE__GEOGRAPHY_UTILS__PROJECTION_HPP_
#define AUTOWARE__GEOGRAPHY_UTILS__PROJECTION_HPP_

#include <geographic_msgs/msg/geo_point.hpp>
#include <geometry_msgs/msg/point.hpp>
#include <tier4_map_msgs/msg/map_projector_info.hpp>

namespace geography_utils
namespace autoware::geography_utils
{
using MapProjectorInfo = tier4_map_msgs::msg::MapProjectorInfo;
using GeoPoint = geographic_msgs::msg::GeoPoint;
Expand All @@ -28,6 +28,6 @@ using LocalPoint = geometry_msgs::msg::Point;
LocalPoint project_forward(const GeoPoint & geo_point, const MapProjectorInfo & projector_info);
GeoPoint project_reverse(const LocalPoint & local_point, const MapProjectorInfo & projector_info);

} // namespace geography_utils
} // namespace autoware::geography_utils

#endif // GEOGRAPHY_UTILS__PROJECTION_HPP_
#endif // AUTOWARE__GEOGRAPHY_UTILS__PROJECTION_HPP_
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>geography_utils</name>
<name>autoware_geography_utils</name>
<version>0.1.0</version>
<description>The geography_utils package</description>
<description>The autoware_geography_utils package</description>
<maintainer email="koji.minoda@tier4.jp">Koji Minoda</maintainer>
<license>Apache License 2.0</license>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
// limitations under the License.

#include <GeographicLib/Geoid.hpp>
#include <geography_utils/height.hpp>
#include <autoware/geography_utils/height.hpp>

#include <map>
#include <stdexcept>
#include <string>
#include <utility>

namespace geography_utils
namespace autoware::geography_utils
{

double convert_wgs84_to_egm2008(const double height, const double latitude, const double longitude)
Expand Down Expand Up @@ -60,4 +60,4 @@ double convert_height(
}
}

} // namespace geography_utils
} // namespace autoware::geography_utils
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
// limitations under the License.

#include <GeographicLib/Geoid.hpp>
#include <autoware/geography_utils/lanelet2_projector.hpp>
#include <autoware_lanelet2_extension/projection/mgrs_projector.hpp>
#include <autoware_lanelet2_extension/projection/transverse_mercator_projector.hpp>
#include <geography_utils/lanelet2_projector.hpp>

#include <lanelet2_projection/UTM.h>

namespace geography_utils
namespace autoware::geography_utils
{

std::unique_ptr<lanelet::Projector> get_lanelet2_projector(const MapProjectorInfo & projector_info)
Expand Down Expand Up @@ -51,4 +51,4 @@ std::unique_ptr<lanelet::Projector> get_lanelet2_projector(const MapProjectorInf
throw std::invalid_argument(error_msg);
}

} // namespace geography_utils
} // namespace autoware::geography_utils
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
// limitations under the License.

#include <GeographicLib/Geoid.hpp>
#include <autoware/geography_utils/lanelet2_projector.hpp>
#include <autoware/geography_utils/projection.hpp>
#include <autoware_lanelet2_extension/projection/mgrs_projector.hpp>
#include <geography_utils/lanelet2_projector.hpp>
#include <geography_utils/projection.hpp>

namespace geography_utils
namespace autoware::geography_utils
{

Eigen::Vector3d to_basic_point_3d_pt(const LocalPoint src)
Expand Down Expand Up @@ -92,4 +92,4 @@ GeoPoint project_reverse(const LocalPoint & local_point, const MapProjectorInfo
return geo_point;
}

} // namespace geography_utils
} // namespace autoware::geography_utils
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "geography_utils/height.hpp"
#include "geography_utils/lanelet2_projector.hpp"
#include "geography_utils/projection.hpp"
#include "autoware/geography_utils/height.hpp"
#include "autoware/geography_utils/lanelet2_projector.hpp"
#include "autoware/geography_utils/projection.hpp"

#include <gtest/gtest.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <geography_utils/height.hpp>
#include <autoware/geography_utils/height.hpp>

#include <gtest/gtest.h>

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

double converted_height =
geography_utils::convert_height(height, latitude, longitude, datum, datum);
autoware::geography_utils::convert_height(height, latitude, longitude, datum, datum);

EXPECT_DOUBLE_EQ(height, converted_height);
}
Expand All @@ -44,7 +44,7 @@ TEST(GeographyUtils, ValidSourceTargetDatum)
const double target_height = -30.18;

double converted_height =
geography_utils::convert_height(height, latitude, longitude, "WGS84", "EGM2008");
autoware::geography_utils::convert_height(height, latitude, longitude, "WGS84", "EGM2008");

EXPECT_NEAR(target_height, converted_height, 0.1);
}
Expand All @@ -57,7 +57,7 @@ TEST(GeographyUtils, InvalidSourceTargetDatum)
const double longitude = 139.0;

EXPECT_THROW(
geography_utils::convert_height(height, latitude, longitude, "INVALID1", "INVALID2"),
autoware::geography_utils::convert_height(height, latitude, longitude, "INVALID1", "INVALID2"),
std::invalid_argument);
}

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

EXPECT_THROW(
geography_utils::convert_height(height, latitude, longitude, "INVALID1", "WGS84"),
autoware::geography_utils::convert_height(height, latitude, longitude, "INVALID1", "WGS84"),
std::invalid_argument);
}

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

EXPECT_THROW(
geography_utils::convert_height(height, latitude, longitude, "WGS84", "INVALID2"),
autoware::geography_utils::convert_height(height, latitude, longitude, "WGS84", "INVALID2"),
std::invalid_argument);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <geography_utils/projection.hpp>
#include <autoware/geography_utils/projection.hpp>

#include <gtest/gtest.h>

Expand Down Expand Up @@ -41,7 +41,7 @@ TEST(GeographyUtilsProjection, ProjectForwardToMGRS)

// conversion
const geometry_msgs::msg::Point converted_point =
geography_utils::project_forward(geo_point, projector_info);
autoware::geography_utils::project_forward(geo_point, projector_info);

EXPECT_NEAR(converted_point.x, local_point.x, 1.0);
EXPECT_NEAR(converted_point.y, local_point.y, 1.0);
Expand Down Expand Up @@ -70,7 +70,7 @@ TEST(GeographyUtilsProjection, ProjectReverseFromMGRS)

// conversion
const geographic_msgs::msg::GeoPoint converted_point =
geography_utils::project_reverse(local_point, projector_info);
autoware::geography_utils::project_reverse(local_point, projector_info);

EXPECT_NEAR(converted_point.latitude, geo_point.latitude, 0.0001);
EXPECT_NEAR(converted_point.longitude, geo_point.longitude, 0.0001);
Expand All @@ -93,9 +93,9 @@ TEST(GeographyUtilsProjection, ProjectForwardAndReverseMGRS)

// conversion
const geometry_msgs::msg::Point converted_local_point =
geography_utils::project_forward(geo_point, projector_info);
autoware::geography_utils::project_forward(geo_point, projector_info);
const geographic_msgs::msg::GeoPoint converted_geo_point =
geography_utils::project_reverse(converted_local_point, projector_info);
autoware::geography_utils::project_reverse(converted_local_point, projector_info);

EXPECT_NEAR(converted_geo_point.latitude, geo_point.latitude, 0.0001);
EXPECT_NEAR(converted_geo_point.longitude, geo_point.longitude, 0.0001);
Expand Down Expand Up @@ -126,7 +126,7 @@ TEST(GeographyUtilsProjection, ProjectForwardToLocalCartesianUTMOrigin)

// conversion
const geometry_msgs::msg::Point converted_point =
geography_utils::project_forward(geo_point, projector_info);
autoware::geography_utils::project_forward(geo_point, projector_info);

EXPECT_NEAR(converted_point.x, local_point.x, 1.0);
EXPECT_NEAR(converted_point.y, local_point.y, 1.0);
Expand All @@ -151,9 +151,9 @@ TEST(GeographyUtilsProjection, ProjectForwardAndReverseLocalCartesianUTMOrigin)

// conversion
const geometry_msgs::msg::Point converted_local_point =
geography_utils::project_forward(geo_point, projector_info);
autoware::geography_utils::project_forward(geo_point, projector_info);
const geographic_msgs::msg::GeoPoint converted_geo_point =
geography_utils::project_reverse(converted_local_point, projector_info);
autoware::geography_utils::project_reverse(converted_local_point, projector_info);

EXPECT_NEAR(converted_geo_point.latitude, geo_point.latitude, 0.0001);
EXPECT_NEAR(converted_geo_point.longitude, geo_point.longitude, 0.0001);
Expand Down
2 changes: 1 addition & 1 deletion localization/autoware_geo_pose_projector/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>autoware_geography_utils</depend>
<depend>component_interface_specs</depend>
<depend>component_interface_utils</depend>
<depend>geographic_msgs</depend>
<depend>geography_utils</depend>
<depend>geometry_msgs</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

#include "geo_pose_projector.hpp"

#include <geography_utils/height.hpp>
#include <geography_utils/projection.hpp>
#include <autoware/geography_utils/height.hpp>
#include <autoware/geography_utils/projection.hpp>

#ifdef ROS_DISTRO_GALACTIC
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
Expand Down Expand Up @@ -66,8 +66,8 @@
gps_point.longitude = msg->pose.pose.position.longitude;
gps_point.altitude = msg->pose.pose.position.altitude;
geometry_msgs::msg::Point position =
geography_utils::project_forward(gps_point, projector_info_.value());
position.z = geography_utils::convert_height(
autoware::geography_utils::project_forward(gps_point, projector_info_.value());
position.z = autoware::geography_utils::convert_height(

Check warning on line 70 in localization/autoware_geo_pose_projector/src/geo_pose_projector.cpp

View check run for this annotation

Codecov / codecov/patch

localization/autoware_geo_pose_projector/src/geo_pose_projector.cpp#L69-L70

Added lines #L69 - L70 were not covered by tests
position.z, gps_point.latitude, gps_point.longitude, MapProjectorInfo::Message::WGS84,
projector_info_.value().vertical_datum);

Expand Down
2 changes: 1 addition & 1 deletion map/map_loader/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>autoware_geography_utils</depend>
<depend>autoware_lanelet2_extension</depend>
<depend>autoware_map_msgs</depend>
<depend>component_interface_specs</depend>
<depend>component_interface_utils</depend>
<depend>fmt</depend>
<depend>geography_utils</depend>
<depend>geometry_msgs</depend>
<depend>libpcl-all-dev</depend>
<depend>pcl_conversions</depend>
Expand Down
Loading
Loading