Add geohash to monitor_pvt and remove it from logs

This commit is contained in:
Carles Fernandez 2023-10-05 12:52:14 +02:00
parent 3474c9d8ac
commit 757414dc9e
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
4 changed files with 42 additions and 37 deletions

View File

@ -48,7 +48,8 @@ double vel_e = 31; // Velocity East component in the local frame, in m/s
double vel_n = 32; // Velocity North component in the local frame, in m/s
double vel_u = 33; // Velocity Up component in the local frame, in m/s
double cog = 34; // Course Over Ground (cog) [deg]
double cog = 34; // Course Over Ground, in deg
uint32 galhas_status = 35; // Galileo HAS status: 1- HAS messages decoded and applied, 0 - HAS not avaliable
uint32 galhas_status = 35; // Galileo HAS status: 1- HAS messages decoded and applied, 0 - HAS not available
string geohash = 36; // Encoded geographic location. See https://en.wikipedia.org/wiki/Geohash
}

View File

@ -2430,7 +2430,6 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
LOG(INFO) << "Position at " << boost::posix_time::to_simple_string(d_user_pvt_solver->get_position_UTC_time())
<< " UTC using " << d_user_pvt_solver->get_num_valid_observations() << " observations is Lat = " << d_user_pvt_solver->get_latitude() << " [deg], Long = " << d_user_pvt_solver->get_longitude()
<< " [deg], Height = " << d_user_pvt_solver->get_height() << " [m]";
LOG(INFO) << "geohash=" << d_geohash->encode(d_user_pvt_solver->get_latitude(), d_user_pvt_solver->get_longitude());
/* std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_user_pvt_solver->get_position_UTC_time())
<< " UTC using "<< d_user_pvt_solver->get_num_valid_observations() <<" observations is HDOP = " << d_user_pvt_solver->get_hdop() << " VDOP = "
<< d_user_pvt_solver->get_vdop()
@ -2441,7 +2440,7 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
if (d_user_pvt_solver->is_valid_position() && flag_compute_pvt_output == true)
{
const std::shared_ptr<Monitor_Pvt> monitor_pvt = std::make_shared<Monitor_Pvt>(d_user_pvt_solver->get_monitor_pvt());
monitor_pvt->geohash = d_geohash->encode(d_user_pvt_solver->get_latitude(), d_user_pvt_solver->get_longitude());
// publish new position to the gnss_flowgraph channel status monitor
if (current_RX_time_ms % d_report_rate_ms == 0)
{

View File

@ -98,6 +98,7 @@ public:
// PVT UTC Time (rfc 3339 datetime string)
std::string utc_time;
std::string geohash; // See https://en.wikipedia.org/wiki/Geohash
/*!
* \brief This member function serializes and restores
@ -153,6 +154,7 @@ public:
ar& BOOST_SERIALIZATION_NVP(vel_u);
ar& BOOST_SERIALIZATION_NVP(cog);
ar& BOOST_SERIALIZATION_NVP(geohash);
}
};

View File

@ -118,6 +118,8 @@ public:
monitor_.set_vel_u(monitor->vel_u);
monitor_.set_cog(monitor->cog);
monitor_.set_galhas_status(monitor->galhas_status);
monitor_.set_geohash(monitor->geohash);
monitor_.SerializeToString(&data);
return data;
}
@ -161,6 +163,7 @@ public:
monitor.vel_u = mon.vel_u();
monitor.cog = mon.cog();
monitor.galhas_status = mon.galhas_status();
monitor.geohash = mon.geohash();
return monitor;
}