Skip to content

Commit

Permalink
Added the warning messages back into the estimator.
Browse files Browse the repository at this point in the history
  • Loading branch information
iandareid committed Nov 28, 2023
1 parent 583dc7f commit a109542
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions rosplane/src/estimator_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,15 @@ void estimator_example::estimate(const params_s &params, const input_s &input, o
}

bool problem = false;
// int prob_index;
int prob_index;
for (int i = 0; i < 7; i++)
{
if (!std::isfinite(xhat_p_(i)))
{
if (!problem)
{
problem = true;
// prob_index = i;
prob_index = i;
}
switch (i)
{
Expand Down Expand Up @@ -380,7 +380,7 @@ void estimator_example::estimate(const params_s &params, const input_s &input, o
}
if (problem)
{
// RCLCPP_WARN(this->get_logger(), "position estimator reinitialized due to non-finite state %d", prob_index); TODO come back and track down why pn is going infinite.
RCLCPP_WARN(this->get_logger(), "position estimator reinitialized due to non-finite state %d", prob_index);
}
if (xhat_p_(6) - xhat_p_(3) > radians(360.0f) || xhat_p_(6) - xhat_p_(3) < radians(-360.0f))
{
Expand All @@ -396,9 +396,6 @@ void estimator_example::estimate(const params_s &params, const input_s &input, o
float wehat = xhat_p_(5);
float psihat = xhat_p_(6);


// RCLCPP_INFO_STREAM(this->get_logger(), "chihat: " << chihat);

output.pn = pnhat;
output.pe = pehat;
output.h = hhat;
Expand Down

0 comments on commit a109542

Please sign in to comment.