<commit_before>#include <atomic>
#include <mutex>
#include <tuple>
#include <ros/ros.h>
#include <tf/transform_broadcaster.h>
#include <ros/callback_queue.h>
#include <tf/transform_listener.h>
#include "raw_nmea/gga.h"
#include "raw_nmea/vtg.h"
#include "utilities.hpp"
#include "local_pose_2_5_d.hpp"
#include "origin_acquirer_gga.hpp"

using std::tuple;
using std::get;
using std::atomic;
using std::mutex;
using std::string;

class GlobalToLocalSynchronizer
{
public:
  inline GlobalToLocalSynchronizer(Lla const &origin_in,
                                   ros::NodeHandle *const nh,
                                   std::string GNSS_frame_ID,
                                   string const &output_tf_frame_name)
      : origin(origin_in)
      , outputTFFrameName(output_tf_frame_name)
  {
    this->gnssToBaseLinkTransform =
        get_transform(GNSS_frame_ID, this->outputTFFrameName);
  }

  inline void GgaCallback(raw_nmea::gga const &message)
  {
    auto const xyz =
        get_xyz(this->origin.latitudeDeg, this->origin.longitudeDeg,
                this->origin.altitudeM, message.latitude, message.longitude,
                message.altitude);
    {
      std::lock_guard<mutex> lock(this->stateMx);
      this->state.x = get<0>(xyz);
      this->state.y = get<1>(xyz);
      this->state.z = get<2>(xyz);
    }

    if (raw_nmea::gga::INVALID != message.fix_quality)
    {
      LocalPose2_5D const local_pose(this->GetState());
      auto const world_to_gnss_transform = get_transform(
          local_pose.x, local_pose.y, local_pose.z, local_pose.yaw);
      auto const now = ros::Time::now();
      br.sendTransform(tf::StampedTransform(
          world_to_gnss_transform * this->gnssToBaseLinkTransform, now, "world",
          this->outputTFFrameName));
    }
    else
    {
      ROS_WARN("Not sure how to handle GGA mode INVALID");
    }
  }

  inline void VtgCallback(raw_nmea::vtg const &message)
  {
    this->vtgTrueTrackMadeGood = message.true_track_made_good;
  }

  inline LocalPose2_5D GetState()<commit_msg>removed another raw_<commit_after>#include <atomic>
#include <mutex>
#include <tuple>
#include <ros/ros.h>
#include <tf/transform_broadcaster.h>
#include <ros/callback_queue.h>
#include <tf/transform_listener.h>
#include "nmea/gga.h"
#include "nmea/vtg.h"
#include "utilities.hpp"
#include "local_pose_2_5_d.hpp"
#include "origin_acquirer_gga.hpp"

using std::tuple;
using std::get;
using std::atomic;
using std::mutex;
using std::string;

class GlobalToLocalSynchronizer
{
public:
  inline GlobalToLocalSynchronizer(Lla const &origin_in,
                                   ros::NodeHandle *const nh,
                                   std::string GNSS_frame_ID,
                                   string const &output_tf_frame_name)
      : origin(origin_in)
      , outputTFFrameName(output_tf_frame_name)
  {
    this->gnssToBaseLinkTransform =
        get_transform(GNSS_frame_ID, this->outputTFFrameName);
  }

  inline void GgaCallback(nmea::gga const &message)
  {
    auto const xyz =
        get_xyz(this->origin.latitudeDeg, this->origin.longitudeDeg,
                this->origin.altitudeM, message.latitude, message.longitude,
                message.altitude);
    {
      std::lock_guard<mutex> lock(this->stateMx);
      this->state.x = get<0>(xyz);
      this->state.y = get<1>(xyz);
      this->state.z = get<2>(xyz);
    }

    if (nmea::gga::INVALID != message.fix_quality)
    {
      LocalPose2_5D const local_pose(this->GetState());
      auto const world_to_gnss_transform = get_transform(
          local_pose.x, local_pose.y, local_pose.z, local_pose.yaw);
      auto const now = ros::Time::now();
      br.sendTransform(tf::StampedTransform(
          world_to_gnss_transform * this->gnssToBaseLinkTransform, now, "world",
          this->outputTFFrameName));
    }
    else
    {
      ROS_WARN("Not sure how to handle GGA mode INVALID");
    }
  }

  inline void VtgCallback(nmea::vtg const &message)
  {
    this->vtgTrueTrackMadeGood = message.true_track_made_good;
  }

  inline LocalPose2_5D GetState()
{'fraction_non_alphanumeric': 0.11859838274932614, 'fraction_numerical': 0.0044106836559666745, 'mean_word_length': 3.0216748768472907, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1650722', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1378, 'n_words': 239}