Skip to content

Commit

Permalink
feat: apply autoware_ prefix for scenario_simulator_v2_adapter (#…
Browse files Browse the repository at this point in the history
…9957)

* feat(autoware_scenario_simulator_v2_adapter): apply `autoware_` prefix (see below):

  * In this commit, I did not organize a folder structure.
    The folder structure will be organized in the next some commits.
  * The changes will follow the Autoware's guideline as below:
      - https://autowarefoundation.github.io/autoware-documentation/main/contributing/coding-guidelines/ros-nodes/directory-structure/#package-folder

Signed-off-by: Junya Sasaki <[email protected]>

* rename(scenario_simulator_v2_adapter): move headers under `include/autoware`:

  * Fixes due to this changes for .hpp/.cpp files will be applied in the next commit

Signed-off-by: Junya Sasaki <[email protected]>

* fix(scenario_simulator_v2_adapter): fix include paths

  * To follow the previous commit

Signed-off-by: Junya Sasaki <[email protected]>

* rename: `scenario_simulator_v2_adapter` => `autoware_scenario_simulator_v2_adapter`

Signed-off-by: Junya Sasaki <[email protected]>

* bug(autoware_scenario_simulator_v2_adapter): revert wrongly updated copyrights

Signed-off-by: Junya Sasaki <[email protected]>

* bug(autoware_scenario_simulator_v2_adapter): `autoware_` prefix is not needed here

Signed-off-by: Junya Sasaki <[email protected]>

* bug(autoware_scenario_simulator_v2_adapter): wrong package name in launch side

Signed-off-by: Junya Sasaki <[email protected]>

---------

Signed-off-by: Junya Sasaki <[email protected]>
  • Loading branch information
sasakisasaki authored Jan 23, 2025
1 parent 47d55f4 commit f0c8170
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.16.3) # Ubuntu 20.04 default CMake version

project(scenario_simulator_v2_adapter)
project(autoware_scenario_simulator_v2_adapter)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
Expand All @@ -16,24 +16,24 @@ find_package(pluginlib REQUIRED)
ament_auto_find_build_dependencies()


ament_auto_add_library(${PROJECT_NAME}_node SHARED
ament_auto_add_library(${PROJECT_NAME} SHARED
src/converter_node.cpp
)

rclcpp_components_register_node(${PROJECT_NAME}_node
PLUGIN "scenario_simulator_v2_adapter::MetricConverter"
EXECUTABLE ${PROJECT_NAME}
rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "autoware::scenario_simulator_v2_adapter::MetricConverter"
EXECUTABLE ${PROJECT_NAME}_node
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()

ament_add_gtest(test_${PROJECT_NAME}
ament_add_gtest(test_scenario_simulator_v2_adapter
test/test_converter_node.cpp
)
target_link_libraries(test_${PROJECT_NAME}
${PROJECT_NAME}_node
target_link_libraries(test_scenario_simulator_v2_adapter
${PROJECT_NAME}
)
endif()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Tier IV, Inc.
// Copyright 2023 TIER IV, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef SCENARIO_SIMULATOR_V2_ADAPTER__CONVERTER_NODE_HPP_
#define SCENARIO_SIMULATOR_V2_ADAPTER__CONVERTER_NODE_HPP_
#ifndef AUTOWARE__SCENARIO_SIMULATOR_V2_ADAPTER__CONVERTER_NODE_HPP_
#define AUTOWARE__SCENARIO_SIMULATOR_V2_ADAPTER__CONVERTER_NODE_HPP_

#include <rclcpp/rclcpp.hpp>

Expand All @@ -27,7 +27,7 @@
#include <unordered_map>
#include <vector>

namespace scenario_simulator_v2_adapter
namespace autoware::scenario_simulator_v2_adapter
{
using tier4_metric_msgs::msg::Metric;
using tier4_metric_msgs::msg::MetricArray;
Expand Down Expand Up @@ -61,6 +61,6 @@ class MetricConverter : public rclcpp::Node
std::vector<std::unordered_map<std::string, rclcpp::Publisher<UserDefinedValue>::SharedPtr>>
params_pub_;
};
} // namespace scenario_simulator_v2_adapter
} // namespace autoware::scenario_simulator_v2_adapter

#endif // SCENARIO_SIMULATOR_V2_ADAPTER__CONVERTER_NODE_HPP_
#endif // AUTOWARE__SCENARIO_SIMULATOR_V2_ADAPTER__CONVERTER_NODE_HPP_
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?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>scenario_simulator_v2_adapter</name>
<name>autoware_scenario_simulator_v2_adapter</name>
<version>0.40.0</version>
<description>Node for converting autoware's messages into UserDefinedValue messages</description>
<maintainer email="[email protected]">Kyoichi Sugahara</maintainer>
<maintainer email="[email protected]">Maxime CLEMENT</maintainer>
<maintainer email="[email protected]">Takamasa Horibe</maintainer>
<maintainer email="[email protected]">Takamasa Horibe</maintainer>
<maintainer email="[email protected]">Junya Sasaki</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Tier IV, Inc.
// Copyright 2023 TIER IV, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "scenario_simulator_v2_adapter/converter_node.hpp"
#include "autoware/scenario_simulator_v2_adapter/converter_node.hpp"

#include <regex>
#include <string>
#include <vector>

namespace
namespace autoware::scenario_simulator_v2_adapter
{
std::string removeInvalidTopicString(const std::string & input_string)
{
Expand All @@ -31,10 +31,7 @@ std::string removeInvalidTopicString(const std::string & input_string)
}
return result;
}
} // namespace

namespace scenario_simulator_v2_adapter
{
MetricConverter::MetricConverter(const rclcpp::NodeOptions & node_options)
: Node("scenario_simulator_v2_adapter", node_options)
{
Expand Down Expand Up @@ -81,7 +78,7 @@ rclcpp::Publisher<UserDefinedValue>::SharedPtr MetricConverter::getPublisher(
}
return pubs.at(topic_name);
}
} // namespace scenario_simulator_v2_adapter
} // namespace autoware::scenario_simulator_v2_adapter

#include "rclcpp_components/register_node_macro.hpp"
RCLCPP_COMPONENTS_REGISTER_NODE(scenario_simulator_v2_adapter::MetricConverter)
RCLCPP_COMPONENTS_REGISTER_NODE(autoware::scenario_simulator_v2_adapter::MetricConverter)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Tier IV, Inc.
// Copyright 2023 TIER IV, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "scenario_simulator_v2_adapter/converter_node.hpp"
#include "autoware/scenario_simulator_v2_adapter/converter_node.hpp"

#include <rclcpp/rclcpp.hpp>

Expand All @@ -28,7 +28,7 @@
#include <unordered_map>
#include <vector>

using ConverterNode = scenario_simulator_v2_adapter::MetricConverter;
using ConverterNode = autoware::scenario_simulator_v2_adapter::MetricConverter;
using tier4_metric_msgs::msg::Metric;
using tier4_metric_msgs::msg::MetricArray;
using tier4_simulation_msgs::msg::UserDefinedValue;
Expand Down
2 changes: 1 addition & 1 deletion launch/tier4_simulator_launch/launch/simulator.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@

<!-- Simulator Adapter -->
<group if="$(var launch_scenario_simulator_v2_adapter)">
<node name="scenario_simulator_v2_adapter" exec="scenario_simulator_v2_adapter" pkg="scenario_simulator_v2_adapter" output="screen">
<node exec="autoware_scenario_simulator_v2_adapter_node" pkg="autoware_scenario_simulator_v2_adapter" output="screen">
<param name="metric_topic_list" value="[/planning/planning_evaluator/metrics, /control/control_evaluator/metrics, /system/processing_time_checker/metrics]"/>
</node>
</group>
Expand Down

0 comments on commit f0c8170

Please sign in to comment.