Skip to content

Commit

Permalink
refactor(scenario_selector): prefix package and namespace with autowa…
Browse files Browse the repository at this point in the history
…re_ (#7379)

Signed-off-by: Y.Hisaki <[email protected]>
  • Loading branch information
yhisaki authored and KhalilSelyan committed Jul 22, 2024
1 parent d9d5a97 commit 461db97
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ planning/sampling_based_planner/autoware_bezier_sampler/** maxime.clement@tier4.
planning/sampling_based_planner/autoware_frenet_planner/** [email protected]
planning/sampling_based_planner/autoware_path_sampler/** [email protected]
planning/sampling_based_planner/autoware_sampler_common/** [email protected]
planning/scenario_selector/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/autoware_scenario_selector/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/autoware_surround_obstacle_checker/** [email protected] [email protected]
sensing/gnss_poser/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
sensing/image_diagnostics/** [email protected] [email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<arg name="is_simulation"/>
<!-- scenario selector -->
<group>
<include file="$(find-pkg-share scenario_selector)/launch/scenario_selector.launch.xml">
<include file="$(find-pkg-share autoware_scenario_selector)/launch/scenario_selector.launch.xml">
<arg name="input_lane_driving_trajectory" value="/planning/scenario_planning/lane_driving/trajectory"/>
<arg name="input_parking_trajectory" value="/planning/scenario_planning/parking/trajectory"/>
<arg name="input_lanelet_map" value="/map/vector_map"/>
Expand Down
2 changes: 1 addition & 1 deletion launch/tier4_planning_launch/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<exec_depend>autoware_planning_topic_converter</exec_depend>
<exec_depend>autoware_planning_validator</exec_depend>
<exec_depend>autoware_remaining_distance_time_calculator</exec_depend>
<exec_depend>autoware_scenario_selector</exec_depend>
<exec_depend>autoware_surround_obstacle_checker</exec_depend>
<exec_depend>autoware_velocity_smoother</exec_depend>
<exec_depend>behavior_path_planner</exec_depend>
Expand All @@ -74,7 +75,6 @@
<exec_depend>obstacle_cruise_planner</exec_depend>
<exec_depend>obstacle_stop_planner</exec_depend>
<exec_depend>planning_evaluator</exec_depend>
<exec_depend>scenario_selector</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_lint_common</test_depend>
Expand Down
2 changes: 1 addition & 1 deletion planning/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ nav:
- 'Velocity Smoother':
- 'About Velocity Smoother': planning/autoware_velocity_smoother
- 'About Velocity Smoother (Japanese)': planning/autoware_velocity_smoother/README.ja
- 'Scenario Selector': planning/scenario_selector
- 'Scenario Selector': planning/autoware_scenario_selector
- 'Static Centerline Generator': planning/autoware_static_centerline_generator
- 'API and Library':
- 'Costmap Generator': planning/costmap_generator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
cmake_minimum_required(VERSION 3.14)
project(scenario_selector)
project(autoware_scenario_selector)

find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_library(scenario_selector_node SHARED
src/scenario_selector_node/scenario_selector_node.cpp
ament_auto_add_library(${PROJECT_NAME} SHARED
src/node.cpp
)

rclcpp_components_register_node(scenario_selector_node
PLUGIN "ScenarioSelectorNode"
EXECUTABLE scenario_selector
rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "autoware::scenario_selector::ScenarioSelectorNode"
EXECUTABLE ${PROJECT_NAME}_node
)

if(BUILD_TESTING)
ament_add_ros_isolated_gtest(test_${PROJECT_NAME}
test/test_${PROJECT_NAME}_node_interface.cpp
)
target_link_libraries(test_${PROJECT_NAME}
${PROJECT_NAME}_node
${PROJECT_NAME}
)
endif()


ament_auto_package(INSTALL_TO_SHARE
launch
config
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# scenario_selector
# autoware_scenario_selector

## scenario_selector_node

Expand Down Expand Up @@ -29,12 +29,12 @@ None
### How to launch

1. Write your remapping info in `scenario_selector.launch` or add args when executing `roslaunch`
2. `roslaunch scenario_selector scenario_selector.launch`
- If you would like to use only a single scenario, `roslaunch scenario_selector dummy_scenario_selector_{scenario_name}.launch`
2. `roslaunch autoware_scenario_selector scenario_selector.launch`
- If you would like to use only a single scenario, `roslaunch autoware_scenario_selector dummy_scenario_selector_{scenario_name}.launch`

### Parameters

{{ json_to_markdown("planning/scenario_selector/schema/scenario_selector.schema.json") }}
{{ json_to_markdown("planning/autoware_scenario_selector/schema/scenario_selector.schema.json") }}

### Flowchart

Expand Down
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 SCENARIO_SELECTOR__SCENARIO_SELECTOR_NODE_HPP_
#define SCENARIO_SELECTOR__SCENARIO_SELECTOR_NODE_HPP_
#ifndef AUTOWARE_SCENARIO_SELECTOR__NODE_HPP_
#define AUTOWARE_SCENARIO_SELECTOR__NODE_HPP_

#include <rclcpp/rclcpp.hpp>
#include <tier4_autoware_utils/ros/published_time_publisher.hpp>
Expand Down Expand Up @@ -43,6 +43,8 @@
#include <memory>
#include <string>

namespace autoware::scenario_selector
{
class ScenarioSelectorNode : public rclcpp::Node
{
public:
Expand Down Expand Up @@ -100,5 +102,5 @@ class ScenarioSelectorNode : public rclcpp::Node
double th_stopped_velocity_mps_;
bool is_parking_completed_;
};

#endif // SCENARIO_SELECTOR__SCENARIO_SELECTOR_NODE_HPP_
} // namespace autoware::scenario_selector
#endif // AUTOWARE_SCENARIO_SELECTOR__NODE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<arg name="output_scenario"/>
<arg name="output_trajectory"/>
<!-- Parameter -->
<arg name="config_file" default="$(find-pkg-share scenario_selector)/config/scenario_selector.param.yaml"/>
<arg name="config_file" default="$(find-pkg-share autoware_scenario_selector)/config/scenario_selector.param.yaml"/>

<node pkg="scenario_selector" exec="scenario_selector" name="scenario_selector" output="screen">
<node pkg="autoware_scenario_selector" exec="autoware_scenario_selector_node" name="scenario_selector" output="screen">
<remap from="input/lane_driving/trajectory" to="$(var input_lane_driving_trajectory)"/>
<remap from="input/parking/trajectory" to="$(var input_parking_trajectory)"/>
<remap from="input/lanelet_map" to="$(var input_lanelet_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>scenario_selector</name>
<name>autoware_scenario_selector</name>
<version>0.1.0</version>
<description>The scenario_selector ROS 2 package</description>
<description>The autoware_scenario_selector ROS 2 package</description>
<maintainer email="[email protected]">Taiki Tanaka</maintainer>
<maintainer email="[email protected]">Tomoya Kimura</maintainer>
<maintainer email="[email protected]">Shumpei Wakabayashi</maintainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"title": "Parameters for Scenario Selector Node",
"type": "object",
"definitions": {
"scenario_selector": {
"autoware_scenario_selector": {
"type": "object",
"properties": {
"update_rate": {
Expand Down Expand Up @@ -51,7 +51,7 @@
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/scenario_selector"
"$ref": "#/definitions/autoware_scenario_selector"
}
},
"required": ["ros__parameters"]
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 "scenario_selector/scenario_selector_node.hpp"
#include "autoware_scenario_selector/node.hpp"

#include <lanelet2_extension/utility/message_conversion.hpp>
#include <lanelet2_extension/utility/query.hpp>
Expand All @@ -28,7 +28,8 @@
#include <string>
#include <utility>
#include <vector>

namespace autoware::scenario_selector
{
namespace
{
template <class T>
Expand Down Expand Up @@ -373,6 +374,7 @@ ScenarioSelectorNode::ScenarioSelectorNode(const rclcpp::NodeOptions & node_opti
this, get_clock(), period_ns, std::bind(&ScenarioSelectorNode::onTimer, this));
published_time_publisher_ = std::make_unique<tier4_autoware_utils::PublishedTimePublisher>(this);
}
} // namespace autoware::scenario_selector

#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(ScenarioSelectorNode)
RCLCPP_COMPONENTS_REGISTER_NODE(autoware::scenario_selector::ScenarioSelectorNode)
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 "scenario_selector/scenario_selector_node.hpp"
#include "autoware_scenario_selector/node.hpp"

#include <ament_index_cpp/get_package_share_directory.hpp>
#include <autoware_planning_test_manager/autoware_planning_test_manager.hpp>
Expand All @@ -22,7 +22,8 @@

#include <cmath>
#include <vector>

namespace autoware::scenario_selector
{
using planning_test_utils::PlanningInterfaceTestManager;

std::shared_ptr<PlanningInterfaceTestManager> generateTestManager()
Expand Down Expand Up @@ -121,3 +122,4 @@ TEST(PlanningModuleInterfaceTest, NodeTestWithOffTrackEgoPose)
ASSERT_NO_THROW(test_manager->testTrajectoryWithInvalidEgoPose(test_target_node));
rclcpp::shutdown();
}
} // namespace autoware::scenario_selector

0 comments on commit 461db97

Please sign in to comment.