Skip to content

Commit

Permalink
fix: don't publish twist flu if it has nan values
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleJewiss committed Oct 22, 2024
1 parent f188cfc commit 7196f38
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/septentrio_gnss_driver/communication/message_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,14 @@ namespace io {
twist_flu_msg.header = msg.header;
twist_flu_msg.header.frame_id = settings_->frame_id;
twist_flu_msg.twist = msg.twist.twist;
publish<TwistStampedMsg>("twist_flu", twist_flu_msg);

if (!(std::isnan(twist_flu_msg.twist.linear.x) ||
std::isnan(twist_flu_msg.twist.linear.y) ||
std::isnan(twist_flu_msg.twist.linear.z)))
{
publish<TwistStampedMsg>("twist_flu", twist_flu_msg);
}

}

if (settings_->publish_localization)
Expand Down

0 comments on commit 7196f38

Please sign in to comment.