Skip to content

Commit

Permalink
dependency added.
Browse files Browse the repository at this point in the history
Signed-off-by: Zhe Shen <[email protected]>
  • Loading branch information
HansOersted committed May 27, 2024
1 parent 689f7ad commit 91f78d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions control/mpc_lateral_controller/src/mpc_lateral_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ void MpcLateralController::setStatus(
void MpcLateralController::setupDiag()
{
auto & d = diag_updater_;
d.setHardwareID("mpc_lateral_controller");
d->setHardwareID("mpc_lateral_controller");

d.add("MPC_solve_checker", [&](auto & stat) {
d->add("MPC_solve_checker", [&](auto & stat) {
setStatus(
stat, m_is_mpc_solved);
});
Expand Down Expand Up @@ -283,7 +283,7 @@ trajectory_follower::LateralOutput MpcLateralController::run(

m_is_mpc_solved = is_mpc_solved; // for diagnostic updater

diag_updater_.force_update();
diag_updater_->force_update();

// reset previous MPC result
// Note: When a large deviation from the trajectory occurs, the optimization stops and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <tier4_autoware_utils/ros/published_time_publisher.hpp>
#include <diagnostic_updater/diagnostic_updater.hpp>

#include "autoware_auto_control_msgs/msg/ackermann_control_command.hpp"
#include "autoware_auto_control_msgs/msg/longitudinal_command.hpp"
Expand Down Expand Up @@ -73,7 +74,7 @@ class TRAJECTORY_FOLLOWER_PUBLIC Controller : public rclcpp::Node
double timeout_thr_sec_;
boost::optional<LongitudinalOutput> longitudinal_output_{boost::none};

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

std::shared_ptr<trajectory_follower::LongitudinalControllerBase> longitudinal_controller_;
std::shared_ptr<trajectory_follower::LateralControllerBase> lateral_controller_;
Expand Down

0 comments on commit 91f78d1

Please sign in to comment.