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(external_cmd_selector): prefix package and namespace with au… #7384

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
19 changes: 19 additions & 0 deletions control/autoware_external_cmd_selector/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.14)
project(autoware_external_cmd_selector)

find_package(autoware_cmake REQUIRED)
autoware_package()

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

rclcpp_components_register_node(${PROJECT_NAME}_node
PLUGIN "autoware::external_cmd_selector::ExternalCmdSelector"
EXECUTABLE autoware_external_cmd_selector
)

ament_auto_package(INSTALL_TO_SHARE
launch
config
)
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# external_cmd_selector
# autoware_external_cmd_selector

## Purpose

`external_cmd_selector` is the package to publish `external_control_cmd`, `gear_cmd`, `hazard_lights_cmd`, `heartbeat` and `turn_indicators_cmd`, according to the current mode, which is `remote` or `local`.
`autoware_external_cmd_selector` is the package to publish `external_control_cmd`, `gear_cmd`, `hazard_lights_cmd`, `heartbeat` and `turn_indicators_cmd`, according to the current mode, which is `remote` or `local`.

The current mode is set via service, `remote` is remotely operated, `local` is to use the values calculated by Autoware.

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 EXTERNAL_CMD_SELECTOR__EXTERNAL_CMD_SELECTOR_NODE_HPP_
#define EXTERNAL_CMD_SELECTOR__EXTERNAL_CMD_SELECTOR_NODE_HPP_
#ifndef AUTOWARE_EXTERNAL_CMD_SELECTOR__EXTERNAL_CMD_SELECTOR_NODE_HPP_
#define AUTOWARE_EXTERNAL_CMD_SELECTOR__EXTERNAL_CMD_SELECTOR_NODE_HPP_

#include <diagnostic_updater/diagnostic_updater.hpp>
#include <diagnostic_updater/update_functions.hpp>
Expand All @@ -30,7 +30,8 @@
#include <tier4_external_api_msgs/msg/turn_signal_stamped.hpp>

#include <memory>

namespace autoware::external_cmd_selector
{
class ExternalCmdSelector : public rclcpp::Node
{
public:
Expand Down Expand Up @@ -101,5 +102,5 @@ class ExternalCmdSelector : public rclcpp::Node
// Diagnostics Updater
diagnostic_updater::Updater updater_{this};
};

#endif // EXTERNAL_CMD_SELECTOR__EXTERNAL_CMD_SELECTOR_NODE_HPP_
} // namespace autoware::external_cmd_selector
#endif // AUTOWARE_EXTERNAL_CMD_SELECTOR__EXTERNAL_CMD_SELECTOR_NODE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def launch_setup(context, *args, **kwargs):
external_cmd_selector_param = yaml.safe_load(f)["/**"]["ros__parameters"]

component = ComposableNode(
package="external_cmd_selector",
plugin="ExternalCmdSelector",
package="autoware_external_cmd_selector",
plugin="autoware::external_cmd_selector::ExternalCmdSelector",
name="external_cmd_selector",
remappings=[
_create_mapping_tuple("service/select_external_command"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<arg name="output/current_selector_mode" default="~/current_selector_mode"/>

<!-- node -->
<node pkg="external_cmd_selector" exec="external_cmd_selector" name="external_cmd_selector" output="screen">
<node pkg="autoware_external_cmd_selector" exec="autoware_external_cmd_selector" name="external_cmd_selector" output="screen">
<remap from="~/service/select_external_command" to="$(var service/select_external_command)"/>
<remap from="~/input/local/control_cmd" to="$(var input/local/control_cmd)"/>
<remap from="~/input/local/shift_cmd" to="$(var input/local/shift_cmd)"/>
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>external_cmd_selector</name>
<name>autoware_external_cmd_selector</name>
<version>0.1.0</version>
<description>The external_cmd_selector package</description>
<description>The autoware_external_cmd_selector 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 @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "external_cmd_selector/external_cmd_selector_node.hpp"
#include "autoware_external_cmd_selector/external_cmd_selector_node.hpp"

#include <tier4_auto_msgs_converter/tier4_auto_msgs_converter.hpp>

Expand All @@ -21,6 +21,8 @@
#include <string>
#include <utility>

namespace autoware::external_cmd_selector
{
ExternalCmdSelector::ExternalCmdSelector(const rclcpp::NodeOptions & node_options)
: Node("external_cmd_selector", node_options)
{
Expand Down Expand Up @@ -202,6 +204,7 @@ ExternalCmdSelector::InternalHeartbeat ExternalCmdSelector::convert(
{
return command;
}
} // namespace autoware::external_cmd_selector

#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(ExternalCmdSelector)
RCLCPP_COMPONENTS_REGISTER_NODE(autoware::external_cmd_selector::ExternalCmdSelector)
19 changes: 0 additions & 19 deletions control/external_cmd_selector/CMakeLists.txt

This file was deleted.

5 changes: 4 additions & 1 deletion launch/tier4_control_launch/launch/control.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,10 @@
# external cmd selector
external_cmd_selector_loader = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[FindPackageShare("external_cmd_selector"), "/launch/external_cmd_selector.launch.py"]
[
FindPackageShare("autoware_external_cmd_selector"),
"/launch/external_cmd_selector.launch.py",
]

Check warning on line 278 in launch/tier4_control_launch/launch/control.launch.py

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Large Method

launch_setup increases from 370 to 373 lines of code, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.
),
launch_arguments=[
("use_intra_process", LaunchConfiguration("use_intra_process")),
Expand Down
2 changes: 1 addition & 1 deletion launch/tier4_control_launch/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<exec_depend>autoware_external_cmd_selector</exec_depend>
<exec_depend>autoware_lane_departure_checker</exec_depend>
<exec_depend>control_evaluator</exec_depend>
<exec_depend>external_cmd_converter</exec_depend>
<exec_depend>external_cmd_selector</exec_depend>
<exec_depend>shift_decider</exec_depend>
<exec_depend>trajectory_follower_node</exec_depend>
<exec_depend>vehicle_cmd_gate</exec_depend>
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 @@ -59,6 +59,7 @@

<exec_depend>autoware_behavior_velocity_planner</exec_depend>
<exec_depend>autoware_costmap_generator</exec_depend>
<exec_depend>autoware_external_cmd_selector</exec_depend>
<exec_depend>autoware_external_velocity_limit_selector</exec_depend>
<exec_depend>autoware_path_optimizer</exec_depend>
<exec_depend>autoware_planning_topic_converter</exec_depend>
Expand All @@ -67,7 +68,6 @@
<exec_depend>autoware_surround_obstacle_checker</exec_depend>
<exec_depend>autoware_velocity_smoother</exec_depend>
<exec_depend>behavior_path_planner</exec_depend>
<exec_depend>external_cmd_selector</exec_depend>
<exec_depend>freespace_planner</exec_depend>
<exec_depend>glog_component</exec_depend>
<exec_depend>mission_planner</exec_depend>
Expand Down
Loading