Skip to content

Commit

Permalink
ControlManager: updated the innovation check
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Jan 17, 2024
1 parent 40755e6 commit e3bc967
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/control_manager/control_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2624,12 +2624,22 @@ void ControlManager::timerSafety(const ros::TimerEvent& event) {
// --------------------------------------------------------------

if (_odometry_innovation_check_enabled_) {
{
auto [x, y, z] = mrs_lib::getPosition(sh_odometry_innovation_.getMsg());

std::optional<nav_msgs::Odometry::ConstPtr> innovation;

if (sh_odometry_innovation_.hasMsg()) {
innovation = {sh_odometry_innovation_.getMsg()};
} else {
ROS_WARN_THROTTLE(1.0, "[ControlManager]: missing estimator innnovation but the innovation check is enabled!");
}

if (innovation) {

auto [x, y, z] = mrs_lib::getPosition(innovation.value());

double heading = 0;
try {
heading = mrs_lib::getHeading(sh_odometry_innovation_.getMsg());
heading = mrs_lib::getHeading(innovation.value());
}
catch (mrs_lib::AttitudeConverter::GetHeadingException& e) {
ROS_ERROR_THROTTLE(1.0, "[ControlManager]: exception caught: '%s'", e.what());
Expand Down

0 comments on commit e3bc967

Please sign in to comment.