geodesy tender -> gnss

This commit is contained in:
emanuel 2024-03-11 13:03:50 +00:00
parent 4047fb21fc
commit 7bf4d92379
5 changed files with 7 additions and 10 deletions

View File

@ -97,7 +97,7 @@ static void path_history_update(pos_point_t* pn) {
if (ls->concise_points_len == 3) {
double actual_error;
double actual_chord_length = itss_haversine(
double actual_chord_length = it2s_geodesy_haversine(
ls->concise_points[2].lat / 1.0e7,
ls->concise_points[2].lon / 1.0e7,
ls->concise_points[0].lat / 1.0e7,
@ -140,7 +140,7 @@ static void path_history_update(pos_point_t* pn) {
if (ls->path_history_len >= 2) {
double distance = 0.0;
for (int i = 0; i < ls->path_history_len - 1; ++i) {
distance += itss_haversine(
distance += it2s_geodesy_haversine(
ls->path_history[i]->lat / 1.0e7,
ls->path_history[i]->lon / 1.0e7,
ls->path_history[i+1]->lat / 1.0e7,
@ -1180,7 +1180,7 @@ static int check_pz() {
pthread_mutex_lock(&lightship->lock);
for (int i = 0; i < lightship->protected_zones.pz_len; ++i) {
double d = itss_haversine(lat, lon, (double) lightship->protected_zones.pz[i]->protectedZoneLatitude/10000000.0, (double) lightship->protected_zones.pz[i]->protectedZoneLongitude/10000000.0);
double d = it2s_geodesy_haversine(lat, lon, (double) lightship->protected_zones.pz[i]->protectedZoneLatitude/10000000.0, (double) lightship->protected_zones.pz[i]->protectedZoneLongitude/10000000.0);
int pz_radius = 50;
if (lightship->protected_zones.pz[i]->protectedZoneRadius) {

View File

@ -4,7 +4,6 @@
#include "tpm.h"
#include <it2s-tender/time.h>
#include <it2s-tender/geodesy.h>
#include <it2s-tender/space.h>
#include <it2s-tender/recorder.h>
#include <it2s-tender/packet.h>

View File

@ -9,7 +9,6 @@
#include <it2s-tender/time.h>
#include <it2s-asn/etsi-its-sdu/itss-networking/EIS_NetworkingRequest.h>
#include <it2s-tender/space.h>
#include <it2s-tender/geodesy.h>
#include <it2s-tender/recorder.h>
#include <it2s-tender/packet.h>
#include <stdint.h>

View File

@ -44,6 +44,7 @@ static int do_paths_intersect(
};
if (it2s_geodesy_segments_intersect(&A, &B)) {
log_warn("HEY");
*index = a;
return 1;
}
@ -472,11 +473,11 @@ static int vcm_check_handle_request(EI1_VCM_t* vcm, mc_neighbour_s* neighbour) {
memcpy(dpA, epv.space.data.ptraj, dpA_len * sizeof(GNSSDeltaPosition));
itss_space_unlock();
double dreq = itss_haversine(
double dreq = it2s_geodesy_haversine(
trj[h].latitude / 1.0e7, trj[h].longitude / 1.0e7,
vcm->vcm.currentPosition.latitude / 1.0e7, vcm->vcm.currentPosition.longitude / 1.0e7
);
double dego = itss_haversine(
double dego = it2s_geodesy_haversine(
trj[h].latitude / 1.0e7, trj[h].longitude / 1.0e7,
lat / 1.0e7, lon / 1.0e7
);
@ -1162,7 +1163,7 @@ static bool vcm_timer_check(coordination_t* coordination, uint64_t now) {
double c_sum = 0;
for (int i = 0; i < epv.space.data.ptraj_len - 2; ++i) {
double d1 = itss_haversine(
double d1 = it2s_geodesy_haversine(
epv.space.data.ptraj[i].deltaLatitude._0 / 1.0e7,
epv.space.data.ptraj[i].deltaLongitude._0 / 1.0e7,
0.0,

View File

@ -3,7 +3,6 @@
#include <stdbool.h>
#include <it2s-asn/etsi-its-v1/vcm/EI1_VCM.h>
#include <it2s-tender/geodesy.h>
#include <it2s-tender/epv.h>
#define MC_MAX_NEIGHBOURS 256
@ -87,7 +86,6 @@ typedef struct coordination {
uint64_t id;
uint8_t links[MC_AFF_STATIONS_N_MAX + 1][MC_HASH_LINK_LEN];
uint8_t n_links;
itss_region_t region;
} chain;
} coordination_t;