Skip to content

Commit

Permalink
Rounding fix for GPS dec degrees
Browse files Browse the repository at this point in the history
  • Loading branch information
twdragon authored Aug 9, 2023
1 parent 4ca490a commit 60978ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/witmotion_ros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,8 @@ void ROSWitmotionSensorController::gps_process(const witmotion_datapacket &packe
msg.header.stamp = ros::Time::now();
msg.status.service = sensor_msgs::NavSatStatus::SERVICE_GPS;
msg.status.status = sensor_msgs::NavSatStatus::STATUS_FIX;
msg.latitude = latitude_deg + (latitude_min / 60.f);
msg.longitude = longitude_deg + (longitude_min / 60.f);
msg.latitude = std::floor(latitude_deg) + (latitude_min / 60.f);
msg.longitude = std::floor(longitude_deg) + (longitude_min / 60.f);
msg.altitude = have_ground_speed ? gps_altitude : NAN;
msg.position_covariance_type = have_accuracy ? sensor_msgs::NavSatFix::COVARIANCE_TYPE_DIAGONAL_KNOWN :
sensor_msgs::NavSatFix::COVARIANCE_TYPE_UNKNOWN;
Expand Down

0 comments on commit 60978ed

Please sign in to comment.