Skip to content

Commit

Permalink
refactor(autoware_behavior_velocity_planner): move code to autoware::…
Browse files Browse the repository at this point in the history
…behavior_velocity_planner namespace

Signed-off-by: Esteve Fernandez <[email protected]>
  • Loading branch information
esteve committed May 24, 2024
1 parent 490eb12 commit b272b87
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
<extra_arg name="use_intra_process_comms" value="false"/>
</composable_node>

<composable_node pkg="autoware_behavior_velocity_planner" plugin="behavior_velocity_planner::BehaviorVelocityPlannerNode" name="behavior_velocity_planner" namespace="">
<composable_node pkg="autoware_behavior_velocity_planner" plugin="autoware::behavior_velocity_planner::BehaviorVelocityPlannerNode" name="behavior_velocity_planner" namespace="">
<!-- topic remap -->
<remap from="~/input/path_with_lane_id" to="path_with_lane_id"/>
<remap from="~/input/vector_map" to="$(var input_vector_map_topic_name)"/>
Expand Down
2 changes: 1 addition & 1 deletion planning/autoware_behavior_velocity_planner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ament_auto_add_library(${PROJECT_NAME}_lib SHARED
)

rclcpp_components_register_node(${PROJECT_NAME}_lib
PLUGIN "behavior_velocity_planner::BehaviorVelocityPlannerNode"
PLUGIN "autoware::behavior_velocity_planner::BehaviorVelocityPlannerNode"
EXECUTABLE ${PROJECT_NAME}_node
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<!-- <arg name="behavior_velocity_planner_template_module_param_path"/> -->
<arg name="behavior_velocity_planner_param_file" default="$(find-pkg-share behavior_velocity_planner)/config/behavior_velocity_planner.param.yaml"/>

<node pkg="behavior_velocity_planner" exec="behavior_velocity_planner_node" name="behavior_velocity_planner" output="screen">
<node pkg="autoware_behavior_velocity_planner" exec="behavior_velocity_planner_node" name="behavior_velocity_planner" output="screen">
<!-- topic remap -->
<remap from="~/input/path_with_lane_id" to="path_with_lane_id"/>
<remap from="~/input/vector_map" to="/map/vector_map"/>
Expand Down
12 changes: 6 additions & 6 deletions planning/autoware_behavior_velocity_planner/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ rclcpp::SubscriptionOptions createSubscriptionOptions(rclcpp::Node * node_ptr)
}
} // namespace

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
namespace
{
Expand Down Expand Up @@ -436,14 +436,14 @@ autoware_auto_planning_msgs::msg::Path BehaviorVelocityPlannerNode::generatePath
std::make_shared<const PlannerData>(planner_data), *input_path_msg);

// screening
const auto filtered_path = filterLitterPathPoint(to_path(velocity_planned_path));
const auto filtered_path = ::behavior_velocity_planner::filterLitterPathPoint(to_path(velocity_planned_path));

// interpolation
const auto interpolated_path_msg =
interpolatePath(filtered_path, forward_path_length_, behavior_output_path_interval_);
::behavior_velocity_planner::interpolatePath(filtered_path, forward_path_length_, behavior_output_path_interval_);

// check stop point
output_path_msg = filterStopPathPoint(interpolated_path_msg);
output_path_msg = ::behavior_velocity_planner::filterStopPathPoint(interpolated_path_msg);

output_path_msg.header.frame_id = "map";
output_path_msg.header.stamp = this->now();
Expand Down Expand Up @@ -477,7 +477,7 @@ void BehaviorVelocityPlannerNode::publishDebugMarker(
}
debug_viz_pub_->publish(output_msg);
}
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner

#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(behavior_velocity_planner::BehaviorVelocityPlannerNode)
RCLCPP_COMPONENTS_REGISTER_NODE(autoware::behavior_velocity_planner::BehaviorVelocityPlannerNode)
5 changes: 3 additions & 2 deletions planning/autoware_behavior_velocity_planner/src/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@
#include <string>
#include <vector>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using autoware_auto_mapping_msgs::msg::HADMapBin;
using autoware_behavior_velocity_planner::srv::LoadPlugin;
using autoware_behavior_velocity_planner::srv::UnloadPlugin;
using tier4_planning_msgs::msg::VelocityLimit;
using ::behavior_velocity_planner::TrafficSignalStamped;

class BehaviorVelocityPlannerNode : public rclcpp::Node
{
Expand Down Expand Up @@ -134,6 +135,6 @@ class BehaviorVelocityPlannerNode : public rclcpp::Node

std::unique_ptr<tier4_autoware_utils::PublishedTimePublisher> published_time_publisher_;
};
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner

#endif // NODE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <memory>
#include <string>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
namespace
{
Expand Down Expand Up @@ -128,4 +128,4 @@ diagnostic_msgs::msg::DiagnosticStatus BehaviorVelocityPlannerManager::getStopRe
{
return stop_reason_diag_;
}
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@
#include <string>
#include <vector>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using ::behavior_velocity_planner::PlannerData;
using ::behavior_velocity_planner::PluginInterface;

class BehaviorVelocityPlannerManager
{
public:
Expand All @@ -56,6 +59,6 @@ class BehaviorVelocityPlannerManager
pluginlib::ClassLoader<PluginInterface> plugin_loader_;
std::vector<std::shared_ptr<PluginInterface>> scene_manager_plugins_;
};
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner

#endif // PLANNER_MANAGER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <cmath>
#include <vector>

using behavior_velocity_planner::BehaviorVelocityPlannerNode;
using autoware::behavior_velocity_planner::BehaviorVelocityPlannerNode;
using planning_test_utils::PlanningInterfaceTestManager;

std::shared_ptr<PlanningInterfaceTestManager> generateTestManager()
Expand All @@ -50,7 +50,7 @@ std::shared_ptr<BehaviorVelocityPlannerNode> generateNode()
const auto planning_test_utils_dir =
ament_index_cpp::get_package_share_directory("planning_test_utils");
const auto behavior_velocity_planner_dir =
ament_index_cpp::get_package_share_directory("behavior_velocity_planner");
ament_index_cpp::get_package_share_directory("autoware_behavior_velocity_planner");
const auto motion_velocity_smoother_dir =
ament_index_cpp::get_package_share_directory("motion_velocity_smoother");

Expand Down

0 comments on commit b272b87

Please sign in to comment.