Skip to content

Commit

Permalink
feat!: replace tier4_map_msgs with autoware_map_msgs for MapProjector…
Browse files Browse the repository at this point in the history
…Info (autowarefoundation#9392)

Signed-off-by: Ryohsuke Mitsudome <[email protected]>
  • Loading branch information
mitsudome-r authored Dec 3, 2024
1 parent e511605 commit 282a01d
Show file tree
Hide file tree
Showing 29 changed files with 75 additions and 69 deletions.
2 changes: 1 addition & 1 deletion build_depends.repos
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repositories:
core/autoware_msgs:
type: git
url: https://github.com/autowarefoundation/autoware_msgs.git
version: 1.1.0
version: 1.3.0
core/autoware_adapi_msgs:
type: git
url: https://github.com/autowarefoundation/autoware_adapi_msgs.git
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

#include <rclcpp/qos.hpp>

#include <tier4_map_msgs/msg/map_projector_info.hpp>
#include <autoware_map_msgs/msg/map_projector_info.hpp>

namespace autoware::component_interface_specs::map
{

struct MapProjectorInfo
{
using Message = tier4_map_msgs::msg::MapProjectorInfo;
using Message = autoware_map_msgs::msg::MapProjectorInfo;
static constexpr char name[] = "/map/map_projector_info";
static constexpr size_t depth = 1;
static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE;
Expand Down
2 changes: 1 addition & 1 deletion common/autoware_component_interface_specs/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>autoware_adapi_v1_msgs</depend>
<depend>autoware_map_msgs</depend>
<depend>autoware_perception_msgs</depend>
<depend>autoware_planning_msgs</depend>
<depend>autoware_vehicle_msgs</depend>
Expand All @@ -21,7 +22,6 @@
<depend>rosidl_runtime_cpp</depend>
<depend>tier4_control_msgs</depend>
<depend>tier4_localization_msgs</depend>
<depend>tier4_map_msgs</depend>
<depend>tier4_planning_msgs</depend>
<depend>tier4_system_msgs</depend>
<depend>tier4_vehicle_msgs</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
#ifndef AUTOWARE__GEOGRAPHY_UTILS__LANELET2_PROJECTOR_HPP_
#define AUTOWARE__GEOGRAPHY_UTILS__LANELET2_PROJECTOR_HPP_

#include <tier4_map_msgs/msg/map_projector_info.hpp>
#include <autoware_map_msgs/msg/map_projector_info.hpp>

#include <lanelet2_io/Projection.h>

#include <memory>

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
#ifndef AUTOWARE__GEOGRAPHY_UTILS__PROJECTION_HPP_
#define AUTOWARE__GEOGRAPHY_UTILS__PROJECTION_HPP_

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

namespace autoware::geography_utils
{
using MapProjectorInfo = tier4_map_msgs::msg::MapProjectorInfo;
using MapProjectorInfo = autoware_map_msgs::msg::MapProjectorInfo;
using GeoPoint = geographic_msgs::msg::GeoPoint;
using LocalPoint = geometry_msgs::msg::Point;

Expand Down
2 changes: 1 addition & 1 deletion common/autoware_geography_utils/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>autoware_lanelet2_extension</depend>
<depend>autoware_map_msgs</depend>
<depend>geographic_msgs</depend>
<depend>geographiclib</depend>
<depend>geometry_msgs</depend>
<depend>lanelet2_io</depend>
<depend>tier4_map_msgs</depend>

<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
Expand Down
30 changes: 15 additions & 15 deletions common/autoware_geography_utils/test/test_projection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ TEST(GeographyUtilsProjection, ProjectForwardToMGRS)
local_point.z = 10.0;

// projector info
tier4_map_msgs::msg::MapProjectorInfo projector_info;
projector_info.projector_type = tier4_map_msgs::msg::MapProjectorInfo::MGRS;
autoware_map_msgs::msg::MapProjectorInfo projector_info;
projector_info.projector_type = autoware_map_msgs::msg::MapProjectorInfo::MGRS;
projector_info.mgrs_grid = "54SUE";
projector_info.vertical_datum = tier4_map_msgs::msg::MapProjectorInfo::WGS84;
projector_info.vertical_datum = autoware_map_msgs::msg::MapProjectorInfo::WGS84;

// conversion
const geometry_msgs::msg::Point converted_point =
Expand All @@ -63,10 +63,10 @@ TEST(GeographyUtilsProjection, ProjectReverseFromMGRS)
geo_point.altitude = 10.0;

// projector info
tier4_map_msgs::msg::MapProjectorInfo projector_info;
projector_info.projector_type = tier4_map_msgs::msg::MapProjectorInfo::MGRS;
autoware_map_msgs::msg::MapProjectorInfo projector_info;
projector_info.projector_type = autoware_map_msgs::msg::MapProjectorInfo::MGRS;
projector_info.mgrs_grid = "54SUE";
projector_info.vertical_datum = tier4_map_msgs::msg::MapProjectorInfo::WGS84;
projector_info.vertical_datum = autoware_map_msgs::msg::MapProjectorInfo::WGS84;

// conversion
const geographic_msgs::msg::GeoPoint converted_point =
Expand All @@ -86,10 +86,10 @@ TEST(GeographyUtilsProjection, ProjectForwardAndReverseMGRS)
geo_point.altitude = 10.0;

// projector info
tier4_map_msgs::msg::MapProjectorInfo projector_info;
projector_info.projector_type = tier4_map_msgs::msg::MapProjectorInfo::MGRS;
autoware_map_msgs::msg::MapProjectorInfo projector_info;
projector_info.projector_type = autoware_map_msgs::msg::MapProjectorInfo::MGRS;
projector_info.mgrs_grid = "54SUE";
projector_info.vertical_datum = tier4_map_msgs::msg::MapProjectorInfo::WGS84;
projector_info.vertical_datum = autoware_map_msgs::msg::MapProjectorInfo::WGS84;

// conversion
const geometry_msgs::msg::Point converted_local_point =
Expand Down Expand Up @@ -117,9 +117,9 @@ TEST(GeographyUtilsProjection, ProjectForwardToLocalCartesianUTMOrigin)
local_point.z = 20.0;

// projector info
tier4_map_msgs::msg::MapProjectorInfo projector_info;
projector_info.projector_type = tier4_map_msgs::msg::MapProjectorInfo::LOCAL_CARTESIAN_UTM;
projector_info.vertical_datum = tier4_map_msgs::msg::MapProjectorInfo::WGS84;
autoware_map_msgs::msg::MapProjectorInfo projector_info;
projector_info.projector_type = autoware_map_msgs::msg::MapProjectorInfo::LOCAL_CARTESIAN_UTM;
projector_info.vertical_datum = autoware_map_msgs::msg::MapProjectorInfo::WGS84;
projector_info.map_origin.latitude = 35.62426;
projector_info.map_origin.longitude = 139.74252;
projector_info.map_origin.altitude = -10.0;
Expand All @@ -142,9 +142,9 @@ TEST(GeographyUtilsProjection, ProjectForwardAndReverseLocalCartesianUTMOrigin)
geo_point.altitude = 10.0;

// projector info
tier4_map_msgs::msg::MapProjectorInfo projector_info;
projector_info.projector_type = tier4_map_msgs::msg::MapProjectorInfo::LOCAL_CARTESIAN_UTM;
projector_info.vertical_datum = tier4_map_msgs::msg::MapProjectorInfo::WGS84;
autoware_map_msgs::msg::MapProjectorInfo projector_info;
projector_info.projector_type = autoware_map_msgs::msg::MapProjectorInfo::LOCAL_CARTESIAN_UTM;
projector_info.vertical_datum = autoware_map_msgs::msg::MapProjectorInfo::WGS84;
projector_info.map_origin.latitude = 35.0;
projector_info.map_origin.longitude = 139.0;
projector_info.map_origin.altitude = 0.0;
Expand Down
2 changes: 1 addition & 1 deletion localization/autoware_geo_pose_projector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This node is a simple node that subscribes to the geo-referenced pose topic and
| Name | Type | Description |
| ------------------------- | ---------------------------------------------------- | ------------------- |
| `input_geo_pose` | `geographic_msgs::msg::GeoPoseWithCovarianceStamped` | geo-referenced pose |
| `/map/map_projector_info` | `tier4_map_msgs::msg::MapProjectedObjectInfo` | map projector info |
| `/map/map_projector_info` | `autoware_map_msgs::msg::MapProjectedObjectInfo` | map projector info |

## Published Topics

Expand Down
1 change: 0 additions & 1 deletion map/autoware_lanelet2_map_visualizer/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
<depend>autoware_map_msgs</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>tier4_map_msgs</depend>
<depend>visualization_msgs</depend>

<test_depend>ament_lint_auto</test_depend>
Expand Down
4 changes: 2 additions & 2 deletions map/autoware_map_loader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ Please see [the description of `GetSelectedPointCloudMap.srv`](https://github.co

lanelet2_map_loader loads Lanelet2 file and publishes the map data as autoware_map_msgs/LaneletMapBin message.
The node projects lan/lon coordinates into arbitrary coordinates defined in `/map/map_projector_info` from `map_projection_loader`.
Please see [tier4_autoware_msgs/msg/MapProjectorInfo.msg](https://github.com/tier4/tier4_autoware_msgs/blob/tier4/universe/tier4_map_msgs/msg/MapProjectorInfo.msg) for supported projector types.
Please see [autoware_map_msgs/msg/MapProjectorInfo.msg](https://github.com/autowarefoundation/autoware_msgs/blob/main/autoware_map_msgs/msg/MapProjectorInfo.msg) for supported projector types.

### How to run

`ros2 run autoware_map_loader lanelet2_map_loader --ros-args -p lanelet2_map_path:=path/to/map.osm`

### Subscribed Topics

- ~input/map_projector_info (tier4_map_msgs/MapProjectorInfo) : Projection type for Autoware
- ~input/map_projector_info (autoware_map_msgs/MapProjectorInfo) : Projection type for Autoware

### Published Topics

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <rclcpp/rclcpp.hpp>

#include <autoware_map_msgs/msg/lanelet_map_bin.hpp>
#include <tier4_map_msgs/msg/map_projector_info.hpp>
#include <autoware_map_msgs/msg/map_projector_info.hpp>

#include <lanelet2_projection/UTM.h>

Expand All @@ -40,7 +40,7 @@ class Lanelet2MapLoaderNode : public rclcpp::Node

static lanelet::LaneletMapPtr load_map(
const std::string & lanelet2_filename,
const tier4_map_msgs::msg::MapProjectorInfo & projector_info);
const autoware_map_msgs::msg::MapProjectorInfo & projector_info);
static autoware_map_msgs::msg::LaneletMapBin create_map_bin_msg(
const lanelet::LaneletMapPtr map, const std::string & lanelet2_filename,
const rclcpp::Time & now);
Expand Down
1 change: 0 additions & 1 deletion map/autoware_map_loader/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<depend>pcl_conversions</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>tier4_map_msgs</depend>
<depend>visualization_msgs</depend>
<depend>yaml-cpp</depend>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
namespace autoware::map_loader
{
using autoware_map_msgs::msg::LaneletMapBin;
using tier4_map_msgs::msg::MapProjectorInfo;
using autoware_map_msgs::msg::MapProjectorInfo;

Lanelet2MapLoaderNode::Lanelet2MapLoaderNode(const rclcpp::NodeOptions & options)
: Node("lanelet2_map_loader", options)
Expand Down Expand Up @@ -136,10 +136,10 @@ void Lanelet2MapLoaderNode::on_map_projector_info(

lanelet::LaneletMapPtr Lanelet2MapLoaderNode::load_map(
const std::string & lanelet2_filename,
const tier4_map_msgs::msg::MapProjectorInfo & projector_info)
const autoware_map_msgs::msg::MapProjectorInfo & projector_info)
{
lanelet::ErrorMessages errors{};
if (projector_info.projector_type != tier4_map_msgs::msg::MapProjectorInfo::LOCAL) {
if (projector_info.projector_type != autoware_map_msgs::msg::MapProjectorInfo::LOCAL) {
std::unique_ptr<lanelet::Projector> projector =
autoware::geography_utils::get_lanelet2_projector(projector_info);
lanelet::LaneletMapPtr map = lanelet::load(lanelet2_filename, *projector, &errors);
Expand Down
4 changes: 2 additions & 2 deletions map/autoware_map_projection_loader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ There are three types of transformations from latitude and longitude to XYZ coor

```yaml
# map_projector_info.yaml
projector_type: local
projector_type: Local
```
#### Limitation
Expand Down Expand Up @@ -86,7 +86,7 @@ map_origin:
## Published Topics
- `~/map_projector_info` (tier4_map_msgs/MapProjectorInfo) : This topic shows the definition of map projector information
- `~/map_projector_info` (autoware_map_msgs/MapProjectorInfo) : This topic shows the definition of map projector information

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
#include <autoware_lanelet2_extension/utility/message_conversion.hpp>
#include <autoware_lanelet2_extension/utility/utilities.hpp>

#include "tier4_map_msgs/msg/map_projector_info.hpp"
#include "autoware_map_msgs/msg/map_projector_info.hpp"

#include <string>

namespace autoware::map_projection_loader
{
tier4_map_msgs::msg::MapProjectorInfo load_info_from_lanelet2_map(const std::string & filename);
autoware_map_msgs::msg::MapProjectorInfo load_info_from_lanelet2_map(const std::string & filename);
} // namespace autoware::map_projection_loader

#endif // AUTOWARE__MAP_PROJECTION_LOADER__LOAD_INFO_FROM_LANELET2_MAP_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

namespace autoware::map_projection_loader
{
tier4_map_msgs::msg::MapProjectorInfo load_info_from_yaml(const std::string & filename);
tier4_map_msgs::msg::MapProjectorInfo load_map_projector_info(
autoware_map_msgs::msg::MapProjectorInfo load_info_from_yaml(const std::string & filename);
autoware_map_msgs::msg::MapProjectorInfo load_map_projector_info(
const std::string & yaml_filename, const std::string & lanelet2_map_filename);

class MapProjectionLoader : public rclcpp::Node
Expand Down
2 changes: 1 addition & 1 deletion map/autoware_map_projection_loader/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<depend>autoware_component_interface_specs</depend>
<depend>autoware_component_interface_utils</depend>
<depend>autoware_lanelet2_extension</depend>
<depend>autoware_map_msgs</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>tier4_map_msgs</depend>
<depend>yaml-cpp</depend>

<test_depend>ament_cmake_gmock</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "autoware/map_projection_loader/load_info_from_lanelet2_map.hpp"

#include "tier4_map_msgs/msg/map_projector_info.hpp"
#include "autoware_map_msgs/msg/map_projector_info.hpp"

#include <lanelet2_core/LaneletMap.h>
#include <lanelet2_core/geometry/LineString.h>
Expand All @@ -25,7 +25,7 @@

namespace autoware::map_projection_loader
{
tier4_map_msgs::msg::MapProjectorInfo load_info_from_lanelet2_map(const std::string & filename)
autoware_map_msgs::msg::MapProjectorInfo load_info_from_lanelet2_map(const std::string & filename)
{
lanelet::ErrorMessages errors{};
lanelet::projection::MGRSProjector projector{};
Expand All @@ -46,18 +46,18 @@ tier4_map_msgs::msg::MapProjectorInfo load_info_from_lanelet2_map(const std::str
}
}

tier4_map_msgs::msg::MapProjectorInfo msg;
autoware_map_msgs::msg::MapProjectorInfo msg;
if (is_local) {
msg.projector_type = tier4_map_msgs::msg::MapProjectorInfo::LOCAL;
msg.projector_type = autoware_map_msgs::msg::MapProjectorInfo::LOCAL;
} else {
msg.projector_type = tier4_map_msgs::msg::MapProjectorInfo::MGRS;
msg.projector_type = autoware_map_msgs::msg::MapProjectorInfo::MGRS;
msg.mgrs_grid = projector.getProjectedMGRSGrid();
}

// We assume that the vertical datum of the map is WGS84 when using lanelet2 map.
// However, do note that this is not always true, and may cause problems in the future.
// Thus, please consider using the map_projector_info.yaml instead of this deprecated function.
msg.vertical_datum = tier4_map_msgs::msg::MapProjectorInfo::WGS84;
msg.vertical_datum = autoware_map_msgs::msg::MapProjectorInfo::WGS84;
return msg;
}
} // namespace autoware::map_projection_loader
Loading

0 comments on commit 282a01d

Please sign in to comment.