Skip to content

Commit

Permalink
refactor(control_validator)!: prefix package and namespace with autow…
Browse files Browse the repository at this point in the history
…are (#7304)

* rename folders

Signed-off-by: Daniel Sanchez <[email protected]>

* rename add prefix

Signed-off-by: Daniel Sanchez <[email protected]>

* change param path

Signed-off-by: Daniel Sanchez <[email protected]>

* fix pluggin problem

Signed-off-by: Daniel Sanchez <[email protected]>

* fix extra prefixes

Signed-off-by: Daniel Sanchez <[email protected]>

* change back launchers

Signed-off-by: Daniel Sanchez <[email protected]>

* add namespace to address conflict

Signed-off-by: Daniel Sanchez <[email protected]>

* delete stubborn file

Signed-off-by: Daniel Sanchez <[email protected]>

---------

Signed-off-by: Daniel Sanchez <[email protected]>
  • Loading branch information
danielsanchezaran authored Jun 10, 2024
1 parent 95d4ae9 commit 7a55d57
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
cmake_minimum_required(VERSION 3.22)
project(control_validator)
project(autoware_control_validator)

find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_library(control_validator_helpers SHARED
ament_auto_add_library(autoware_control_validator_helpers SHARED
src/utils.cpp
src/debug_marker.cpp
)

# control validator
ament_auto_add_library(control_validator_component SHARED
include/control_validator/control_validator.hpp
ament_auto_add_library(autoware_control_validator_component SHARED
include/autoware_control_validator/control_validator.hpp
src/control_validator.cpp
)
target_link_libraries(control_validator_component control_validator_helpers)
rclcpp_components_register_node(control_validator_component
PLUGIN "control_validator::ControlValidator"
EXECUTABLE control_validator_node
target_link_libraries(autoware_control_validator_component autoware_control_validator_helpers)
rclcpp_components_register_node(autoware_control_validator_component
PLUGIN "autoware::control_validator::ControlValidator"
EXECUTABLE autoware_control_validator_node
)

rosidl_generate_interfaces(
Expand All @@ -28,12 +28,12 @@ rosidl_generate_interfaces(

# to use a message defined in the same package
if(${rosidl_cmake_VERSION} VERSION_LESS 2.5.0)
rosidl_target_interfaces(control_validator_component
rosidl_target_interfaces(autoware_control_validator_component
${PROJECT_NAME} "rosidl_typesupport_cpp")
else()
rosidl_get_typesupport_target(
cpp_typesupport_target ${PROJECT_NAME} "rosidl_typesupport_cpp")
target_link_libraries(control_validator_component "${cpp_typesupport_target}")
target_link_libraries(autoware_control_validator_component "${cpp_typesupport_target}")
endif()

# if(BUILD_TESTING)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef CONTROL_VALIDATOR__CONTROL_VALIDATOR_HPP_
#define CONTROL_VALIDATOR__CONTROL_VALIDATOR_HPP_
#ifndef AUTOWARE_CONTROL_VALIDATOR__CONTROL_VALIDATOR_HPP_
#define AUTOWARE_CONTROL_VALIDATOR__CONTROL_VALIDATOR_HPP_

#include "autoware_control_validator/debug_marker.hpp"
#include "autoware_control_validator/msg/control_validator_status.hpp"
#include "autoware_vehicle_info_utils/vehicle_info_utils.hpp"
#include "control_validator/debug_marker.hpp"
#include "control_validator/msg/control_validator_status.hpp"

#include <diagnostic_updater/diagnostic_updater.hpp>
#include <rclcpp/rclcpp.hpp>
Expand All @@ -29,11 +29,11 @@
#include <memory>
#include <string>

namespace control_validator
namespace autoware::control_validator
{
using autoware_control_validator::msg::ControlValidatorStatus;
using autoware_planning_msgs::msg::Trajectory;
using autoware_planning_msgs::msg::TrajectoryPoint;
using control_validator::msg::ControlValidatorStatus;
using diagnostic_updater::DiagnosticStatusWrapper;
using diagnostic_updater::Updater;
using nav_msgs::msg::Odometry;
Expand Down Expand Up @@ -94,6 +94,6 @@ class ControlValidator : public rclcpp::Node

std::shared_ptr<ControlValidatorDebugMarkerPublisher> debug_pose_publisher_;
};
} // namespace control_validator
} // namespace autoware::control_validator

#endif // CONTROL_VALIDATOR__CONTROL_VALIDATOR_HPP_
#endif // AUTOWARE_CONTROL_VALIDATOR__CONTROL_VALIDATOR_HPP_
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 CONTROL_VALIDATOR__DEBUG_MARKER_HPP_
#define CONTROL_VALIDATOR__DEBUG_MARKER_HPP_
#ifndef AUTOWARE_CONTROL_VALIDATOR__DEBUG_MARKER_HPP_
#define AUTOWARE_CONTROL_VALIDATOR__DEBUG_MARKER_HPP_

#include <rclcpp/rclcpp.hpp>

Expand Down Expand Up @@ -57,4 +57,4 @@ class ControlValidatorDebugMarkerPublisher
}
};

#endif // CONTROL_VALIDATOR__DEBUG_MARKER_HPP_
#endif // AUTOWARE_CONTROL_VALIDATOR__DEBUG_MARKER_HPP_
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 CONTROL_VALIDATOR__UTILS_HPP_
#define CONTROL_VALIDATOR__UTILS_HPP_
#ifndef AUTOWARE_CONTROL_VALIDATOR__UTILS_HPP_
#define AUTOWARE_CONTROL_VALIDATOR__UTILS_HPP_

#include <motion_utils/trajectory/conversion.hpp>
#include <rclcpp/rclcpp.hpp>
Expand All @@ -24,7 +24,7 @@
#include <utility>
#include <vector>

namespace control_validator
namespace autoware::control_validator
{
using autoware_planning_msgs::msg::Trajectory;
using autoware_planning_msgs::msg::TrajectoryPoint;
Expand All @@ -50,6 +50,6 @@ Trajectory alignTrajectoryWithReferenceTrajectory(

double calcMaxLateralDistance(
const Trajectory & trajectory, const Trajectory & predicted_trajectory);
} // namespace control_validator
} // namespace autoware::control_validator

#endif // CONTROL_VALIDATOR__UTILS_HPP_
#endif // AUTOWARE_CONTROL_VALIDATOR__UTILS_HPP_
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<launch>
<arg name="control_validator_param_path" default="$(find-pkg-share control_validator)/config/control_validator.param.yaml"/>
<arg name="control_validator_param_path" default="$(find-pkg-share autoware_control_validator)/config/control_validator.param.yaml"/>
<arg name="input_reference_trajectory" default="/planning/scenario_planning/trajectory"/>
<arg name="input_predicted_trajectory" default="/control/trajectory_follower/lateral/predicted_trajectory"/>

<node name="control_validator" exec="control_validator_node" pkg="control_validator" output="screen">
<node name="control_validator" exec="autoware_control_validator_node" pkg="autoware_control_validator" output="screen">
<!-- load config a file -->
<param from="$(var control_validator_param_path)"/>

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>control_validator</name>
<name>autoware_control_validator</name>
<version>0.1.0</version>
<description>ros node for control_validator</description>
<description>ros node for autoware_control_validator</description>
<maintainer email="[email protected]">Kyoichi Sugahara</maintainer>
<maintainer email="[email protected]">Takamasa Horibe</maintainer>
<maintainer email="[email protected]">Makoto Kurihara</maintainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "control_validator/control_validator.hpp"
#include "autoware_control_validator/control_validator.hpp"

#include "control_validator/utils.hpp"
#include "autoware_control_validator/utils.hpp"

#include <memory>
#include <string>
#include <utility>

namespace control_validator
namespace autoware::control_validator
{
using diagnostic_msgs::msg::DiagnosticStatus;

Expand Down Expand Up @@ -61,7 +61,7 @@ void ControlValidator::setupParameters()
}

try {
vehicle_info_ = autoware::vehicle_info_utils::VehicleInfoUtils(*this).getVehicleInfo();
vehicle_info_ = autoware::vehicle_info_utils::VehicleInfoUtil(*this).getVehicleInfo();
} catch (...) {
RCLCPP_ERROR(get_logger(), "failed to get vehicle info. use default value.");
vehicle_info_.front_overhang_m = 0.5;
Expand Down Expand Up @@ -210,7 +210,7 @@ void ControlValidator::displayStatus()
"predicted trajectory is too far from planning trajectory!!");
}

} // namespace control_validator
} // namespace autoware::control_validator

#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(control_validator::ControlValidator)
RCLCPP_COMPONENTS_REGISTER_NODE(autoware::control_validator::ControlValidator)
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 "control_validator/debug_marker.hpp"
#include "autoware_control_validator/debug_marker.hpp"

#include <motion_utils/marker/marker_helper.hpp>
#include <tier4_autoware_utils/ros/marker_helper.hpp>
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 "control_validator/utils.hpp"
#include "autoware_control_validator/utils.hpp"

#include <motion_utils/trajectory/interpolation.hpp>
#include <motion_utils/trajectory/trajectory.hpp>
Expand All @@ -23,7 +23,7 @@
#include <utility>
#include <vector>

namespace control_validator
namespace autoware::control_validator
{

void shiftPose(Pose & pose, double longitudinal)
Expand Down Expand Up @@ -162,4 +162,4 @@ double calcMaxLateralDistance(
return max_dist;
}

} // namespace control_validator
} // namespace autoware::control_validator
4 changes: 2 additions & 2 deletions launch/tier4_control_launch/launch/control.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ def launch_setup(context, *args, **kwargs):

# control validator checker
control_validator_component = ComposableNode(
package="control_validator",
plugin="control_validator::ControlValidator",
package="autoware_control_validator",
plugin="autoware::control_validator::ControlValidator",
name="control_validator",
remappings=[
("~/input/kinematics", "/localization/kinematic_state"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

control_validator:
type: diagnostic_aggregator/GenericAnalyzer
path: control_validator
path: autoware_control_validator
contains: [": control_validation_max_distance_deviation"]
timeout: 1.0

Expand Down

0 comments on commit 7a55d57

Please sign in to comment.