Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning in gnss_converter(main ROS2) #314

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions eagleye_util/gnss_converter/src/gnss_converter_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,21 @@ void navsatfix_callback(const sensor_msgs::msg::NavSatFix::ConstSharedPtr msg) {

void navpvt_callback(const ublox_msgs::msg::NavPVT::ConstSharedPtr msg)
{
if(msg->s_acc > ublox_vacc_thresh) return;
if(msg->s_acc > ublox_vacc_thresh)
{
RCLCPP_WARN(rclcpp::get_logger(node_name),"s_acc is too large");
return;
}
if (nav_msg_ptr == nullptr)
{
RCLCPP_WARN(rclcpp::get_logger(node_name),"nav_msg_ptr is nullptr");
return;
}
rtklib_msgs::msg::RtklibNav r;
r.header.frame_id = "gps";
r.header.stamp.sec = msg->sec;
r.header.stamp.nanosec = msg->nano;
if (nav_msg_ptr != nullptr)
r.status = *nav_msg_ptr;
r.status = *nav_msg_ptr;
r.tow = msg->i_tow;

double llh[3];
Expand All @@ -101,8 +109,16 @@ void navpvt_callback(const ublox_msgs::msg::NavPVT::ConstSharedPtr msg)

void gnss_velocity_callback(const geometry_msgs::msg::TwistWithCovarianceStamped::ConstSharedPtr msg)
{
if(msg->twist.covariance[0] > twist_covariance_thresh) return;
if (nav_msg_ptr == nullptr) return;
if(msg->twist.covariance[0] > twist_covariance_thresh)
{
RCLCPP_WARN(rclcpp::get_logger(node_name),"twist.covariance[0] is too large");
return;
}
if (nav_msg_ptr == nullptr)
{
RCLCPP_WARN(rclcpp::get_logger(node_name),"nav_msg_ptr is nullptr");
return;
}
rtklib_msgs::msg::RtklibNav r;
r.header.frame_id = "gps";
r.header.stamp = msg->header.stamp;
Expand Down