Skip to content

Commit

Permalink
refactor(map_loader)!: prefix package and namespace with autoware (#8927
Browse files Browse the repository at this point in the history
)

* make lanelet2_map_visualization independent

Signed-off-by: a-maumau <[email protected]>

* remove unused files

Signed-off-by: a-maumau <[email protected]>

* remove unused package

Signed-off-by: a-maumau <[email protected]>

* fix package name

Signed-off-by: a-maumau <[email protected]>

* add autoware_ prefix

Signed-off-by: a-maumau <[email protected]>

* add autoware to exec name

Signed-off-by: a-maumau <[email protected]>

* add autoware prefix

Signed-off-by: a-maumau <[email protected]>

* removed unnecessary dependency

Signed-off-by: a-maumau <[email protected]>

---------

Signed-off-by: a-maumau <[email protected]>
  • Loading branch information
a-maumau authored Nov 18, 2024
1 parent 9b0ba2d commit 24652f8
Show file tree
Hide file tree
Showing 50 changed files with 215 additions and 114 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ void TrafficLightPublishPanel::onTimer()
void TrafficLightPublishPanel::onVectorMap(const LaneletMapBin::ConstSharedPtr msg)
{
if (received_vector_map_) return;
// NOTE: examples from map_loader/lanelet2_map_visualization_node.cpp
// NOTE: examples from autoware_lanelet2_map_visualizer/lanelet2_map_visualization_node.cpp
lanelet::LaneletMapPtr lanelet_map(new lanelet::LaneletMap);
lanelet::utils::conversion::fromBinMsg(*msg, lanelet_map);
lanelet::ConstLanelets all_lanelets = lanelet::utils::query::laneletLayer(lanelet_map);
Expand Down
8 changes: 4 additions & 4 deletions launch/tier4_map_launch/launch/map.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<push-ros-namespace namespace="map"/>

<node_container pkg="rclcpp_components" exec="$(var container_type)" name="map_container" namespace="" output="both">
<composable_node pkg="map_loader" plugin="PointCloudMapLoaderNode" name="pointcloud_map_loader">
<composable_node pkg="autoware_map_loader" plugin="autoware::map_loader::PointCloudMapLoaderNode" name="pointcloud_map_loader">
<param from="$(var pointcloud_map_loader_param_path)"/>
<param name="pcd_paths_or_directory" value="[$(var pointcloud_map_path)]"/>
<param name="pcd_metadata_path" value="$(var pointcloud_map_metadata_path)"/>
Expand All @@ -31,13 +31,13 @@
<remap from="service/get_selected_pcd_map" to="/map/get_selected_pointcloud_map"/>
</composable_node>

<composable_node pkg="map_loader" plugin="Lanelet2MapLoaderNode" name="lanelet2_map_loader">
<composable_node pkg="autoware_map_loader" plugin="autoware::map_loader::Lanelet2MapLoaderNode" name="lanelet2_map_loader">
<param from="$(var lanelet2_map_loader_param_path)"/>
<param name="lanelet2_map_path" value="$(var lanelet2_map_path)"/>
<remap from="output/lanelet2_map" to="vector_map"/>
</composable_node>

<composable_node pkg="map_loader" plugin="Lanelet2MapVisualizationNode" name="lanelet2_map_visualization">
<composable_node pkg="autoware_lanelet2_map_visualizer" plugin="autoware::lanelet2_map_visualizer::Lanelet2MapVisualizationNode" name="lanelet2_map_visualization">
<remap from="input/lanelet2_map" to="vector_map"/>
<remap from="output/lanelet2_map_marker" to="vector_map_marker"/>
</composable_node>
Expand All @@ -47,7 +47,7 @@
</composable_node>
</node_container>

<node pkg="map_loader" exec="map_hash_generator" name="map_hash_generator">
<node pkg="autoware_map_loader" exec="map_hash_generator" name="map_hash_generator">
<param name="lanelet2_map_path" value="$(var lanelet2_map_path)"/>
<param name="pointcloud_map_path" value="$(var pointcloud_map_path)"/>
</node>
Expand Down
2 changes: 1 addition & 1 deletion launch/tier4_map_launch/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<exec_depend>autoware_map_loader</exec_depend>
<exec_depend>autoware_map_projection_loader</exec_depend>
<exec_depend>autoware_map_tf_generator</exec_depend>
<exec_depend>map_loader</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>
Expand Down
18 changes: 18 additions & 0 deletions map/autoware_lanelet2_map_visualizer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cmake_minimum_required(VERSION 3.14)
project(autoware_lanelet2_map_visualizer)

find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_library(lanelet2_map_visualization_node SHARED
src/lanelet2_map_visualization_node.cpp
)

rclcpp_components_register_node(lanelet2_map_visualization_node
PLUGIN "autoware::lanelet2_map_visualizer::Lanelet2MapVisualizationNode"
EXECUTABLE lanelet2_map_visualization
)

ament_auto_package(INSTALL_TO_SHARE
launch
)
21 changes: 21 additions & 0 deletions map/autoware_lanelet2_map_visualizer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# autoware_lanelet2_map_visualizer package

This package provides the features of visualizing the lanelet2 maps.

## lanelet2_map_visualization

### Feature

lanelet2_map_visualization visualizes autoware_map_msgs/LaneletMapBin messages into visualization_msgs/MarkerArray.

### How to Run

`ros2 run autoware_lanelet2_map_visualizer lanelet2_map_visualization`

### Subscribed Topics

- ~input/lanelet2_map (autoware_map_msgs/LaneletMapBin) : binary data of Lanelet2 Map

### Published Topics

- ~output/lanelet2_map_marker (visualization_msgs/MarkerArray) : visualization messages for RViz
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<launch>
<arg name="lanelet2_map_topic" default="vector_map"/>
<arg name="lanelet2_map_marker_topic" default="vector_map_marker"/>

<node pkg="autoware_lanelet2_map_visualizer" exec="lanelet2_map_visualization" name="lanelet2_map_visualization" output="both">
<remap from="input/lanelet2_map" to="$(var lanelet2_map_topic)"/>
<remap from="output/lanelet2_map_marker" to="$(var lanelet2_map_marker_topic)"/>
</node>
</launch>
36 changes: 36 additions & 0 deletions map/autoware_lanelet2_map_visualizer/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?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>autoware_lanelet2_map_visualizer</name>
<version>0.1.0</version>
<description>The autoware_lanelet2_map_visualizer package</description>
<maintainer email="[email protected]">Yamato Ando</maintainer>
<maintainer email="[email protected]">Ryu Yamamoto</maintainer>
<maintainer email="[email protected]">Masahiro Sakamoto</maintainer>
<maintainer email="[email protected]">Kento Yabuuchi</maintainer>
<maintainer email="[email protected]">NGUYEN Viet Anh</maintainer>
<maintainer email="[email protected]">Taiki Yamada</maintainer>
<maintainer email="[email protected]">Shintaro Sakoda</maintainer>
<maintainer email="[email protected]">Mamoru Sobue</maintainer>

<license>Apache License 2.0</license>
<author email="[email protected]">Ryohsuke Mitsudome</author>
<author email="[email protected]">Koji Minoda</author>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>autoware_lanelet2_extension</depend>
<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>
<test_depend>autoware_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*
*/

#include "map_loader/lanelet2_map_visualization_node.hpp"
#include "lanelet2_map_visualization_node.hpp"

#include <autoware_lanelet2_extension/regulatory_elements/autoware_traffic_light.hpp>
#include <autoware_lanelet2_extension/utility/message_conversion.hpp>
Expand All @@ -49,7 +49,7 @@
#include <memory>
#include <vector>

namespace
namespace autoware::lanelet2_map_visualizer
{
void insert_marker_array(
visualization_msgs::msg::MarkerArray * a1, const visualization_msgs::msg::MarkerArray & a2)
Expand All @@ -64,7 +64,6 @@ void set_color(std_msgs::msg::ColorRGBA * cl, double r, double g, double b, doub
cl->b = static_cast<float>(b);
cl->a = static_cast<float>(a);
}
} // namespace

Lanelet2MapVisualizationNode::Lanelet2MapVisualizationNode(const rclcpp::NodeOptions & options)
: Node("lanelet2_map_visualization", options)
Expand Down Expand Up @@ -314,6 +313,7 @@ void Lanelet2MapVisualizationNode::on_map_bin(

pub_marker_->publish(map_marker_array);
}
} // namespace autoware::lanelet2_map_visualizer

#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(Lanelet2MapVisualizationNode)
RCLCPP_COMPONENTS_REGISTER_NODE(autoware::lanelet2_map_visualizer::Lanelet2MapVisualizationNode)
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef MAP_LOADER__LANELET2_MAP_VISUALIZATION_NODE_HPP_
#define MAP_LOADER__LANELET2_MAP_VISUALIZATION_NODE_HPP_
#ifndef LANELET2_MAP_VISUALIZATION_NODE_HPP_
#define LANELET2_MAP_VISUALIZATION_NODE_HPP_

#include <rclcpp/rclcpp.hpp>

Expand All @@ -23,6 +23,8 @@
#include <string>
#include <vector>

namespace autoware::lanelet2_map_visualizer
{
class Lanelet2MapVisualizationNode : public rclcpp::Node
{
public:
Expand All @@ -36,5 +38,6 @@ class Lanelet2MapVisualizationNode : public rclcpp::Node

void on_map_bin(const autoware_map_msgs::msg::LaneletMapBin::ConstSharedPtr msg);
};
} // namespace autoware::lanelet2_map_visualizer

#endif // MAP_LOADER__LANELET2_MAP_VISUALIZATION_NODE_HPP_
#endif // LANELET2_MAP_VISUALIZATION_NODE_HPP_
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(map_loader)
project(autoware_map_loader)

find_package(autoware_cmake REQUIRED)
autoware_package()
Expand All @@ -23,26 +23,17 @@ target_include_directories(pointcloud_map_loader_node
)

rclcpp_components_register_node(pointcloud_map_loader_node
PLUGIN "PointCloudMapLoaderNode"
EXECUTABLE pointcloud_map_loader
PLUGIN "autoware::map_loader::PointCloudMapLoaderNode"
EXECUTABLE autoware_pointcloud_map_loader
)

ament_auto_add_library(lanelet2_map_loader_node SHARED
src/lanelet2_map_loader/lanelet2_map_loader_node.cpp
)

rclcpp_components_register_node(lanelet2_map_loader_node
PLUGIN "Lanelet2MapLoaderNode"
EXECUTABLE lanelet2_map_loader
)

ament_auto_add_library(lanelet2_map_visualization_node SHARED
src/lanelet2_map_loader/lanelet2_map_visualization_node.cpp
)

rclcpp_components_register_node(lanelet2_map_visualization_node
PLUGIN "Lanelet2MapVisualizationNode"
EXECUTABLE lanelet2_map_visualization
PLUGIN "autoware::map_loader::Lanelet2MapLoaderNode"
EXECUTABLE autoware_lanelet2_map_loader
)

if(BUILD_TESTING)
Expand Down
28 changes: 4 additions & 24 deletions map/map_loader/README.md → map/autoware_map_loader/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# map_loader package
# autoware_map_loader package

This package provides the features of loading various maps.

Expand Down Expand Up @@ -111,7 +111,7 @@ Please see [the description of `GetSelectedPointCloudMap.srv`](https://github.co

### Parameters

{{ json_to_markdown("map/map_loader/schema/pointcloud_map_loader.schema.json") }}
{{ json_to_markdown("map/autoware_map_loader/schema/pointcloud_map_loader.schema.json") }}

### Interfaces

Expand All @@ -136,7 +136,7 @@ Please see [tier4_autoware_msgs/msg/MapProjectorInfo.msg](https://github.com/tie

### How to run

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

### Subscribed Topics

Expand All @@ -148,27 +148,7 @@ Please see [tier4_autoware_msgs/msg/MapProjectorInfo.msg](https://github.com/tie

### Parameters

{{ json_to_markdown("map/map_loader/schema/lanelet2_map_loader.schema.json") }}
{{ json_to_markdown("map/autoware_map_loader/schema/lanelet2_map_loader.schema.json") }}

`use_waypoints` decides how to handle a centerline.
This flag enables to use the `overwriteLaneletsCenterlineWithWaypoints` function instead of `overwriteLaneletsCenterline`. Please see [the document of the autoware_lanelet2_extension package](https://github.com/autowarefoundation/autoware_lanelet2_extension/blob/main/autoware_lanelet2_extension/docs/lanelet2_format_extension.md#centerline) in detail.

---

## lanelet2_map_visualization

### Feature

lanelet2_map_visualization visualizes autoware_map_msgs/LaneletMapBin messages into visualization_msgs/MarkerArray.

### How to Run

`ros2 run map_loader lanelet2_map_visualization`

### Subscribed Topics

- ~input/lanelet2_map (autoware_map_msgs/LaneletMapBin) : binary data of Lanelet2 Map

### Published Topics

- ~output/lanelet2_map_marker (visualization_msgs/MarkerArray) : visualization messages for RViz
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef MAP_LOADER__LANELET2_MAP_LOADER_NODE_HPP_
#define MAP_LOADER__LANELET2_MAP_LOADER_NODE_HPP_
#ifndef AUTOWARE__MAP_LOADER__LANELET2_MAP_LOADER_NODE_HPP_
#define AUTOWARE__MAP_LOADER__LANELET2_MAP_LOADER_NODE_HPP_

#include <autoware/component_interface_specs/map.hpp>
#include <autoware/component_interface_utils/rclcpp.hpp>
Expand All @@ -28,6 +28,8 @@
#include <memory>
#include <string>

namespace autoware::map_loader
{
class Lanelet2MapLoaderNode : public rclcpp::Node
{
public:
Expand All @@ -52,5 +54,6 @@ class Lanelet2MapLoaderNode : public rclcpp::Node
sub_map_projector_info_;
rclcpp::Publisher<autoware_map_msgs::msg::LaneletMapBin>::SharedPtr pub_map_bin_;
};
} // namespace autoware::map_loader

#endif // MAP_LOADER__LANELET2_MAP_LOADER_NODE_HPP_
#endif // AUTOWARE__MAP_LOADER__LANELET2_MAP_LOADER_NODE_HPP_
15 changes: 15 additions & 0 deletions map/autoware_map_loader/launch/lanelet2_map_loader.launch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<launch>
<arg name="lanelet2_map_loader_param_path" default="$(find-pkg-share autoware_map_loader)/config/lanelet2_map_loader.param.yaml"/>
<arg name="lanelet2_map_path"/>
<arg name="lanelet2_map_topic" default="vector_map"/>
<arg name="lanelet2_map_marker_topic" default="vector_map_marker"/>

<node pkg="autoware_map_loader" exec="map_hash_generator" name="map_hash_generator" output="both">
<param from="$(var lanelet2_map_loader_param_path)" allow_substs="true"/>
</node>

<node pkg="autoware_map_loader" exec="lanelet2_map_loader" name="lanelet2_map_loader" output="both">
<remap from="output/lanelet2_map" to="$(var lanelet2_map_topic)"/>
<param from="$(var lanelet2_map_loader_param_path)" allow_substs="true"/>
</node>
</launch>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<launch>
<arg name="pointcloud_map_path"/>
<arg name="pointcloud_map_metadata_path"/>
<arg name="pointcloud_map_loader_param_path" default="$(find-pkg-share map_loader)/config/pointcloud_map_loader.param.yaml"/>
<arg name="pointcloud_map_loader_param_path" default="$(find-pkg-share autoware_map_loader)/config/pointcloud_map_loader.param.yaml"/>

<node pkg="map_loader" exec="pointcloud_map_loader" name="pointcloud_map_loader" output="both">
<node pkg="autoware_map_loader" exec="pointcloud_map_loader" name="pointcloud_map_loader" output="both">
<remap from="output/pointcloud_map" to="/map/pointcloud_map"/>
<remap from="service/get_partial_pcd_map" to="/map/get_partial_pointcloud_map"/>
<remap from="service/get_selected_pcd_map" to="/map/get_selected_pointcloud_map"/>
Expand Down
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>map_loader</name>
<name>autoware_map_loader</name>
<version>0.38.0</version>
<description>The map_loader package</description>
<description>The autoware_map_loader package</description>
<maintainer email="[email protected]">Yamato Ando</maintainer>
<maintainer email="[email protected]">Ryu Yamamoto</maintainer>
<maintainer email="[email protected]">Masahiro Sakamoto</maintainer>
Expand Down
File renamed without changes.
Loading

0 comments on commit 24652f8

Please sign in to comment.