Commit cabb15d 1 parent c3270d2 commit cabb15d Copy full SHA for cabb15d
File tree 2 files changed +5
-3
lines changed
planning/obstacle_cruise_planner
include/obstacle_cruise_planner
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ class ObstacleCruisePlannerNode : public rclcpp::Node
145
145
AccelWithCovarianceStamped::ConstSharedPtr ego_accel_ptr_{nullptr };
146
146
HADMapBin::ConstSharedPtr vector_map_ptr_{nullptr };
147
147
148
- std::shared_ptr <route_handler::RouteHandler> route_handler_;
148
+ std::unique_ptr <route_handler::RouteHandler> route_handler_;
149
149
150
150
// Vehicle Parameters
151
151
VehicleInfo vehicle_info_;
Original file line number Diff line number Diff line change @@ -515,16 +515,18 @@ rcl_interfaces::msg::SetParametersResult ObstacleCruisePlannerNode::onParam(
515
515
516
516
void ObstacleCruisePlannerNode::onTrajectory (const Trajectory::ConstSharedPtr msg)
517
517
{
518
+ stop_watch_.tic (__func__);
518
519
const auto traj_points = motion_utils::convertToTrajectoryPointArray (*msg);
519
520
520
521
// check if subscribed variables are ready
521
522
if (
522
523
traj_points.empty () || !ego_odom_ptr_ || !ego_accel_ptr_ || !objects_ptr_ || !vector_map_ptr_) {
523
524
return ;
524
525
}
525
- route_handler_ = std::make_shared<route_handler::RouteHandler>(*vector_map_ptr_);
526
+ if (route_handler_ == nullptr ) {
527
+ route_handler_ = std::make_unique<route_handler::RouteHandler>(*vector_map_ptr_);
528
+ }
526
529
527
- stop_watch_.tic (__func__);
528
530
*debug_data_ptr_ = DebugData ();
529
531
530
532
const auto is_driving_forward = motion_utils::isDrivingForwardWithTwist (traj_points);
You can’t perform that action at this time.
0 commit comments