Skip to content

Commit e667b26

Browse files
committed
dependency added.
Signed-off-by: Zhe Shen <lucidshenzhe@gmail.com>
1 parent 745af6a commit e667b26

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

control/autoware_mpc_lateral_controller/src/mpc_lateral_controller.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ void MpcLateralController::setStatus(
245245
void MpcLateralController::setupDiag()
246246
{
247247
auto & d = diag_updater_;
248-
d.setHardwareID("mpc_lateral_controller");
248+
d->setHardwareID("mpc_lateral_controller");
249249

250-
d.add("MPC_solve_checker", [&](auto & stat) {
250+
d->add("MPC_solve_checker", [&](auto & stat) {
251251
setStatus(
252252
stat, m_is_mpc_solved);
253253
});
@@ -283,7 +283,7 @@ trajectory_follower::LateralOutput MpcLateralController::run(
283283

284284
m_is_mpc_solved = is_mpc_solved; // for diagnostic updater
285285

286-
diag_updater_.force_update();
286+
diag_updater_->force_update();
287287

288288
// reset previous MPC result
289289
// Note: When a large deviation from the trajectory occurs, the optimization stops and

control/autoware_trajectory_follower_node/include/autoware_trajectory_follower_node/controller_node.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <Eigen/Core>
3131
#include <Eigen/Geometry>
3232
#include <tier4_autoware_utils/ros/published_time_publisher.hpp>
33+
#include <diagnostic_updater/diagnostic_updater.hpp>
3334

3435
#include "autoware_control_msgs/msg/control.hpp"
3536
#include "autoware_control_msgs/msg/longitudinal.hpp"
@@ -73,7 +74,7 @@ class TRAJECTORY_FOLLOWER_PUBLIC Controller : public rclcpp::Node
7374
double timeout_thr_sec_;
7475
boost::optional<LongitudinalOutput> longitudinal_output_{boost::none};
7576

76-
std::shared_ptr<diagnostic_updater::Updater> diag_updater_{this}; // Diagnostic updater for publishing diagnostic data.
77+
std::shared_ptr<diagnostic_updater::Updater> diag_updater_ = std::make_shared<diagnostic_updater::Updater>(this); // Diagnostic updater for publishing diagnostic data.
7778

7879
std::shared_ptr<trajectory_follower::LongitudinalControllerBase> longitudinal_controller_;
7980
std::shared_ptr<trajectory_follower::LateralControllerBase> lateral_controller_;

0 commit comments

Comments
 (0)