Skip to content

Commit 7ea700d

Browse files
authored
Merge branch 'autowarefoundation:main' into feat/add_perception_objects_pointcloud_publisher
2 parents 7d88491 + 06a71f6 commit 7ea700d

File tree

27 files changed

+614
-104
lines changed

27 files changed

+614
-104
lines changed

control/trajectory_follower_node/package.xml

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<test_depend>autoware_lint_common</test_depend>
4343
<test_depend>autoware_testing</test_depend>
4444
<test_depend>fake_test_node</test_depend>
45+
<test_depend>ros_testing</test_depend>
4546

4647
<export>
4748
<build_type>ament_cmake</build_type>

launch/tier4_autoware_api_launch/launch/autoware_api.launch.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<!-- RTC controller -->
2424
<group>
2525
<push-ros-namespace namespace="autoware_api/external/rtc_controller"/>
26-
<node_container pkg="rclcpp_components" exec="component_container_mt" name="container" namespace="">
26+
<node_container pkg="rclcpp_components" exec="component_container_mt" name="container" namespace="" ros_args="--log-level autoware_api.external.rtc_controller.container:=warn">
2727
<composable_node pkg="autoware_iv_external_api_adaptor" plugin="external_api::RTCController" name="node"/>
2828
</node_container>
2929
</group>

launch/tier4_planning_launch/launch/planning.launch.xml

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
<arg name="nearest_search_param_path"/>
1717
<!-- rtc -->
1818
<arg name="rtc_auto_mode_manager_param_path"/>
19+
<!-- mission planner -->
20+
<arg name="mission_planner_param_path"/>
1921
<!-- behavior path planner -->
2022
<arg name="side_shift_param_path"/>
2123
<arg name="avoidance_param_path"/>
@@ -58,7 +60,9 @@
5860
<!-- mission planning module -->
5961
<group>
6062
<push-ros-namespace namespace="mission_planning"/>
61-
<include file="$(find-pkg-share tier4_planning_launch)/launch/mission_planning/mission_planning.launch.xml"/>
63+
<include file="$(find-pkg-share tier4_planning_launch)/launch/mission_planning/mission_planning.launch.xml">
64+
<arg name="mission_planner_param_path" value="$(var mission_planner_param_path)"/>
65+
</include>
6266
</group>
6367

6468
<!-- scenario planning module -->

planning/behavior_path_planner/CMakeLists.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ set(common_src
1515
src/steering_factor_interface.cpp
1616
src/behavior_path_planner_node.cpp
1717
src/scene_module/scene_module_visitor.cpp
18+
src/scene_module/pull_out/pull_out_module.cpp
19+
src/scene_module/side_shift/side_shift_module.cpp
1820
src/turn_signal_decider.cpp
1921
src/util/avoidance/util.cpp
2022
src/util/lane_change/util.cpp
@@ -43,13 +45,11 @@ if(COMPILE_WITH_OLD_ARCHITECTURE)
4345
ament_auto_add_library(behavior_path_planner_node SHARED
4446
src/behavior_tree_manager.cpp
4547
src/scene_module/scene_module_bt_node_interface.cpp
46-
src/scene_module/side_shift/side_shift_module.cpp
4748
src/scene_module/avoidance/avoidance_module.cpp
4849
src/scene_module/lane_following/lane_following_module.cpp
4950
src/scene_module/lane_change/external_request_lane_change_module.cpp
5051
src/scene_module/lane_change/lane_change_module.cpp
5152
src/scene_module/pull_over/pull_over_module.cpp
52-
src/scene_module/pull_out/pull_out_module.cpp
5353
${common_src}
5454
)
5555

@@ -60,6 +60,8 @@ if(COMPILE_WITH_OLD_ARCHITECTURE)
6060
else()
6161
ament_auto_add_library(behavior_path_planner_node SHARED
6262
src/planner_manager.cpp
63+
src/scene_module/pull_out/manager.cpp
64+
src/scene_module/side_shift/manager.cpp
6365
${common_src}
6466
)
6567

planning/behavior_path_planner/include/behavior_path_planner/behavior_path_planner_node.hpp

+7
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#include "behavior_path_planner/scene_module/side_shift/side_shift_module.hpp"
3030
#else
3131
#include "behavior_path_planner/planner_manager.hpp"
32+
#include "behavior_path_planner/scene_module/pull_out/manager.hpp"
33+
#include "behavior_path_planner/scene_module/side_shift/manager.hpp"
3234
#endif
3335

3436
#include "behavior_path_planner/steering_factor_interface.hpp"
@@ -95,6 +97,7 @@ using rcl_interfaces::msg::SetParametersResult;
9597
using steering_factor_interface::SteeringFactorInterface;
9698
using tier4_planning_msgs::msg::AvoidanceDebugMsgArray;
9799
using tier4_planning_msgs::msg::LaneChangeDebugMsgArray;
100+
using tier4_planning_msgs::msg::LateralOffset;
98101
using tier4_planning_msgs::msg::Scenario;
99102
using visualization_msgs::msg::Marker;
100103
using visualization_msgs::msg::MarkerArray;
@@ -113,6 +116,7 @@ class BehaviorPathPlannerNode : public rclcpp::Node
113116
rclcpp::Subscription<PredictedObjects>::SharedPtr perception_subscriber_;
114117
rclcpp::Subscription<OccupancyGrid>::SharedPtr occupancy_grid_subscriber_;
115118
rclcpp::Subscription<OccupancyGrid>::SharedPtr costmap_subscriber_;
119+
rclcpp::Subscription<LateralOffset>::SharedPtr lateral_offset_subscriber_;
116120
rclcpp::Subscription<OperationModeState>::SharedPtr operation_mode_subscriber_;
117121
rclcpp::Publisher<PathWithLaneId>::SharedPtr path_publisher_;
118122
rclcpp::Publisher<TurnIndicatorsCommand>::SharedPtr turn_signal_publisher_;
@@ -153,8 +157,10 @@ class BehaviorPathPlannerNode : public rclcpp::Node
153157

154158
// parameters
155159
std::shared_ptr<AvoidanceParameters> avoidance_param_ptr_;
160+
std::shared_ptr<SideShiftParameters> side_shift_param_ptr_;
156161
std::shared_ptr<LaneChangeParameters> lane_change_param_ptr_;
157162
std::shared_ptr<LaneFollowingParameters> lane_following_param_ptr_;
163+
std::shared_ptr<PullOutParameters> pull_out_param_ptr_;
158164

159165
BehaviorPathPlannerParameters getCommonParam();
160166

@@ -178,6 +184,7 @@ class BehaviorPathPlannerNode : public rclcpp::Node
178184
void onMap(const HADMapBin::ConstSharedPtr map_msg);
179185
void onRoute(const LaneletRoute::ConstSharedPtr route_msg);
180186
void onOperationMode(const OperationModeState::ConstSharedPtr msg);
187+
void onLateralOffset(const LateralOffset::ConstSharedPtr msg);
181188
SetParametersResult onSetParam(const std::vector<rclcpp::Parameter> & parameters);
182189

183190
/**

planning/behavior_path_planner/include/behavior_path_planner/data_manager.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <geometry_msgs/msg/pose_stamped.hpp>
3232
#include <nav_msgs/msg/occupancy_grid.hpp>
3333
#include <nav_msgs/msg/odometry.hpp>
34+
#include <tier4_planning_msgs/msg/lateral_offset.hpp>
3435

3536
#include <lanelet2_core/geometry/Lanelet.h>
3637

@@ -52,6 +53,7 @@ using geometry_msgs::msg::PoseStamped;
5253
using nav_msgs::msg::OccupancyGrid;
5354
using nav_msgs::msg::Odometry;
5455
using route_handler::RouteHandler;
56+
using tier4_planning_msgs::msg::LateralOffset;
5557
using PlanResult = PathWithLaneId::SharedPtr;
5658

5759
struct BoolStamped
@@ -124,6 +126,7 @@ struct PlannerData
124126
PredictedObjects::ConstSharedPtr dynamic_object{};
125127
OccupancyGrid::ConstSharedPtr occupancy_grid{};
126128
OccupancyGrid::ConstSharedPtr costmap{};
129+
LateralOffset::ConstSharedPtr lateral_offset{};
127130
OperationModeState::ConstSharedPtr operation_mode{};
128131
PathWithLaneId::SharedPtr reference_path{std::make_shared<PathWithLaneId>()};
129132
PathWithLaneId::SharedPtr prev_output_path{std::make_shared<PathWithLaneId>()};

planning/behavior_path_planner/include/behavior_path_planner/parameters.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ struct BehaviorPathPlannerParameters
3030
bool verbose;
3131

3232
ModuleConfigParameters config_avoidance;
33+
ModuleConfigParameters config_pull_out;
34+
ModuleConfigParameters config_side_shift;
3335

3436
double backward_path_length;
3537
double forward_path_length;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// Copyright 2023 TIER IV, Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef BEHAVIOR_PATH_PLANNER__SCENE_MODULE__PULL_OUT__MANAGER_HPP_
16+
#define BEHAVIOR_PATH_PLANNER__SCENE_MODULE__PULL_OUT__MANAGER_HPP_
17+
18+
#include "behavior_path_planner/scene_module/pull_out/pull_out_module.hpp"
19+
#include "behavior_path_planner/scene_module/scene_module_manager_interface.hpp"
20+
21+
#include <rclcpp/rclcpp.hpp>
22+
23+
#include <memory>
24+
#include <string>
25+
#include <vector>
26+
27+
namespace behavior_path_planner
28+
{
29+
30+
class PullOutModuleManager : public SceneModuleManagerInterface
31+
{
32+
public:
33+
PullOutModuleManager(
34+
rclcpp::Node * node, const std::string & name, const ModuleConfigParameters & config,
35+
const std::shared_ptr<PullOutParameters> & parameters);
36+
37+
std::shared_ptr<SceneModuleInterface> createNewSceneModuleInstance() override
38+
{
39+
return std::make_shared<PullOutModule>(name_, *node_, parameters_, rtc_interface_);
40+
}
41+
42+
void updateModuleParams(const std::vector<rclcpp::Parameter> & parameters) override;
43+
44+
private:
45+
std::shared_ptr<PullOutParameters> parameters_;
46+
47+
std::shared_ptr<RTCInterface> rtc_interface_;
48+
49+
std::vector<std::shared_ptr<PullOutModule>> registered_modules_;
50+
};
51+
52+
} // namespace behavior_path_planner
53+
54+
#endif // BEHAVIOR_PATH_PLANNER__SCENE_MODULE__PULL_OUT__MANAGER_HPP_

planning/behavior_path_planner/include/behavior_path_planner/scene_module/pull_out/pull_out_module.hpp

+21-8
Original file line numberDiff line numberDiff line change
@@ -63,25 +63,38 @@ struct PullOutStatus
6363
class PullOutModule : public SceneModuleInterface
6464
{
6565
public:
66+
#ifdef USE_OLD_ARCHITECTURE
6667
PullOutModule(
67-
const std::string & name, rclcpp::Node & node, const PullOutParameters & parameters);
68+
const std::string & name, rclcpp::Node & node,
69+
const std::shared_ptr<PullOutParameters> & parameters);
70+
#else
71+
PullOutModule(
72+
const std::string & name, rclcpp::Node & node,
73+
const std::shared_ptr<PullOutParameters> & parameters,
74+
const std::shared_ptr<RTCInterface> & rtc_interface);
75+
76+
void updateModuleParams(const std::shared_ptr<PullOutParameters> & parameters)
77+
{
78+
parameters_ = parameters;
79+
}
80+
#endif
6881

6982
BehaviorModuleOutput run() override;
7083

7184
bool isExecutionRequested() const override;
7285
bool isExecutionReady() const override;
73-
BT::NodeStatus updateState() override;
74-
BT::NodeStatus getNodeStatusWhileWaitingApproval() const override
75-
{
76-
return BT::NodeStatus::SUCCESS;
77-
}
86+
ModuleStatus updateState() override;
87+
ModuleStatus getNodeStatusWhileWaitingApproval() const override { return ModuleStatus::SUCCESS; }
7888
BehaviorModuleOutput plan() override;
7989
BehaviorModuleOutput planWaitingApproval() override;
8090
CandidateOutput planCandidate() const override;
8191
void onEntry() override;
8292
void onExit() override;
8393

84-
void setParameters(const PullOutParameters & parameters) { parameters_ = parameters; }
94+
void setParameters(const std::shared_ptr<PullOutParameters> & parameters)
95+
{
96+
parameters_ = parameters;
97+
}
8598
void resetStatus();
8699

87100
void acceptVisitor(
@@ -90,7 +103,7 @@ class PullOutModule : public SceneModuleInterface
90103
}
91104

92105
private:
93-
PullOutParameters parameters_;
106+
std::shared_ptr<PullOutParameters> parameters_;
94107
vehicle_info_util::VehicleInfo vehicle_info_;
95108

96109
std::vector<std::shared_ptr<PullOutPlannerBase>> pull_out_planners_;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Copyright 2023 TIER IV, Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef BEHAVIOR_PATH_PLANNER__SCENE_MODULE__SIDE_SHIFT__MANAGER_HPP_
16+
#define BEHAVIOR_PATH_PLANNER__SCENE_MODULE__SIDE_SHIFT__MANAGER_HPP_
17+
18+
#include "behavior_path_planner/scene_module/scene_module_manager_interface.hpp"
19+
#include "behavior_path_planner/scene_module/side_shift/side_shift_module.hpp"
20+
21+
#include <rclcpp/rclcpp.hpp>
22+
23+
#include <memory>
24+
#include <string>
25+
#include <unordered_map>
26+
#include <vector>
27+
28+
namespace behavior_path_planner
29+
{
30+
31+
class SideShiftModuleManager : public SceneModuleManagerInterface
32+
{
33+
public:
34+
SideShiftModuleManager(
35+
rclcpp::Node * node, const std::string & name, const ModuleConfigParameters & config,
36+
const std::shared_ptr<SideShiftParameters> & parameters);
37+
38+
std::shared_ptr<SceneModuleInterface> createNewSceneModuleInstance() override
39+
{
40+
return std::make_shared<SideShiftModule>(name_, *node_, parameters_);
41+
}
42+
43+
void updateModuleParams(const std::vector<rclcpp::Parameter> & parameters) override;
44+
45+
private:
46+
std::shared_ptr<SideShiftParameters> parameters_;
47+
48+
std::vector<std::shared_ptr<SideShiftModule>> registered_modules_;
49+
};
50+
51+
} // namespace behavior_path_planner
52+
53+
#endif // BEHAVIOR_PATH_PLANNER__SCENE_MODULE__SIDE_SHIFT__MANAGER_HPP_

planning/behavior_path_planner/include/behavior_path_planner/scene_module/side_shift/side_shift_module.hpp

+15-5
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,27 @@ class SideShiftModule : public SceneModuleInterface
4040
{
4141
public:
4242
SideShiftModule(
43-
const std::string & name, rclcpp::Node & node, const SideShiftParameters & parameters);
43+
const std::string & name, rclcpp::Node & node,
44+
const std::shared_ptr<SideShiftParameters> & parameters);
4445

4546
bool isExecutionRequested() const override;
4647
bool isExecutionReady() const override;
4748
bool isReadyForNextRequest(
4849
const double & min_request_time_sec, bool override_requests = false) const noexcept;
49-
BT::NodeStatus updateState() override;
50+
ModuleStatus updateState() override;
5051
void updateData() override;
5152
BehaviorModuleOutput plan() override;
5253
BehaviorModuleOutput planWaitingApproval() override;
5354
CandidateOutput planCandidate() const override;
5455
void onEntry() override;
5556
void onExit() override;
5657

57-
void setParameters(const SideShiftParameters & parameters);
58+
void setParameters(const std::shared_ptr<SideShiftParameters> & parameters);
59+
60+
void updateModuleParams(const std::shared_ptr<SideShiftParameters> & parameters)
61+
{
62+
parameters_ = parameters;
63+
}
5864

5965
void acceptVisitor(
6066
[[maybe_unused]] const std::shared_ptr<SceneModuleVisitor> & visitor) const override
@@ -66,7 +72,9 @@ class SideShiftModule : public SceneModuleInterface
6672

6773
void initVariables();
6874

75+
#ifdef USE_OLD_ARCHITECTURE
6976
void onLateralOffset(const LateralOffset::ConstSharedPtr lateral_offset_msg);
77+
#endif
7078

7179
// non-const methods
7280
void adjustDrivableArea(ShiftedPath * path) const;
@@ -82,9 +90,10 @@ class SideShiftModule : public SceneModuleInterface
8290

8391
// member
8492
PathWithLaneId refined_path_{};
85-
std::shared_ptr<PathWithLaneId> reference_path_{std::make_shared<PathWithLaneId>()};
93+
PathWithLaneId reference_path_{};
94+
PathWithLaneId prev_reference_{};
8695
lanelet::ConstLanelets current_lanelets_;
87-
SideShiftParameters parameters_;
96+
std::shared_ptr<SideShiftParameters> parameters_;
8897

8998
// Requested lateral offset to shift the reference path.
9099
double requested_lateral_offset_{0.0};
@@ -112,6 +121,7 @@ class SideShiftModule : public SceneModuleInterface
112121
// NOTE: this function is ported from avoidance.
113122
Pose getUnshiftedEgoPose(const ShiftedPath & prev_path) const;
114123
inline Pose getEgoPose() const { return planner_data_->self_odometry->pose.pose; }
124+
PathWithLaneId extendBackwardLength(const PathWithLaneId & original_path) const;
115125
PathWithLaneId calcCenterLinePath(
116126
const std::shared_ptr<const PlannerData> & planner_data, const Pose & pose) const;
117127

planning/behavior_path_planner/package.xml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<maintainer email="kosuke.takeuchi@tier4.jp">Kosuke Takeuchi</maintainer>
1414
<!-- side shift module -->
1515
<maintainer email="fumiya.watanabe@tier4.jp">Fumiya Watanabe</maintainer>
16+
<maintainer email="kyoichi.sugahara@tier4.jp">Kyoichi Sugahara</maintainer>
1617
<!-- avoidance module -->
1718
<maintainer email="takamasa.horibe@tier4.jp">Takamasa Horibe</maintainer>
1819
<maintainer email="satoshi.ota@tier4.jp">Satoshi Ota</maintainer>

0 commit comments

Comments
 (0)