Skip to content

Commit f00dbf9

Browse files
committed
removed gnss_full message
1 parent 995cc5c commit f00dbf9

File tree

12 files changed

+21
-117
lines changed

12 files changed

+21
-117
lines changed

comms/mavlink/mavlink.cpp

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -146,45 +146,9 @@ void Mavlink::send_gnss(uint8_t system_id, const GNSSData & data)
146146
{
147147
mavlink_message_t msg;
148148
mavlink_msg_rosflight_gnss_pack(
149-
system_id, compid_, &msg, data.time_of_week, data.fix_type, data.time, data.nanos, data.lat,
150-
data.lon, data.height, data.vel_n, data.vel_e, data.vel_d, data.h_acc, data.v_acc, data.ecef.x,
151-
data.ecef.y, data.ecef.z, data.ecef.p_acc, data.ecef.vx, data.ecef.vy, data.ecef.vz,
152-
data.ecef.s_acc, data.rosflight_timestamp);
153-
send_message(msg);
154-
}
155-
156-
void Mavlink::send_gnss_full(uint8_t system_id, const GNSSFull & full)
157-
{
158-
mavlink_message_t msg;
159-
mavlink_rosflight_gnss_full_t data = {};
160-
data.time_of_week = full.time_of_week;
161-
data.year = full.year;
162-
data.month = full.month;
163-
data.day = full.day;
164-
data.hour = full.hour;
165-
data.min = full.min;
166-
data.sec = full.sec;
167-
data.valid = full.valid;
168-
data.t_acc = full.t_acc;
169-
data.nano = full.nano;
170-
data.fix_type = full.fix_type;
171-
data.num_sat = full.num_sat;
172-
data.lon = full.lon;
173-
data.lat = full.lat;
174-
data.height = full.height;
175-
data.height_msl = full.height_msl;
176-
data.h_acc = full.h_acc;
177-
data.v_acc = full.v_acc;
178-
data.vel_n = full.vel_n;
179-
data.vel_e = full.vel_e;
180-
data.vel_d = full.vel_d;
181-
data.g_speed = full.g_speed;
182-
data.head_mot = full.head_mot;
183-
data.s_acc = full.s_acc;
184-
data.head_acc = full.head_acc;
185-
data.p_dop = full.p_dop;
186-
data.rosflight_timestamp = full.rosflight_timestamp;
187-
mavlink_msg_rosflight_gnss_full_encode(system_id, compid_, &msg, &data);
149+
system_id, compid_, &msg, data.seconds, data.nanos, data.fix_type, data.year, data.month,
150+
data.day, data.hour, data.min, data.sec, data.num_sat, data.lat, data.lon, data.height,
151+
data.vel_n, data.vel_e, data.vel_d, data.h_acc, data.v_acc, data.s_acc);
188152
send_message(msg);
189153
}
190154

comms/mavlink/mavlink.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ class Mavlink : public CommLinkInterface
8989
void send_timesync(uint8_t system_id, int64_t tc1, int64_t ts1) override;
9090
void send_version(uint8_t system_id, const char * const version) override;
9191
void send_gnss(uint8_t system_id, const GNSSData & data) override;
92-
void send_gnss_full(uint8_t system_id, const GNSSFull & full) override;
9392
void send_error_data(uint8_t system_id, const StateManager::BackupData & error_data) override;
9493
void send_battery_status(uint8_t system_id, float voltage, float current) override;
9594

include/board.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class Board
103103
// GPS
104104
virtual bool gnss_present() = 0;
105105
virtual bool gnss_has_new_data() = 0;
106-
virtual bool gnss_read(GNSSData * gnss, GNSSFull * gnss_full) = 0;
106+
virtual bool gnss_read(GNSSData * gnss) = 0;
107107

108108
// Battery
109109
virtual bool battery_present() = 0;

include/comm_manager.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class CommManager : public CommLinkInterface::ListenerInterface, public ParamLis
6464

6565
STREAM_ID_SERVO_OUTPUT_RAW,
6666
STREAM_ID_GNSS,
67-
STREAM_ID_GNSS_FULL,
6867
STREAM_ID_RC_RAW,
6968
STREAM_ID_LOW_PRIORITY,
7069
STREAM_COUNT
@@ -157,7 +156,6 @@ class CommManager : public CommLinkInterface::ListenerInterface, public ParamLis
157156
void send_mag(void);
158157
void send_battery_status(void);
159158
void send_gnss(void);
160-
void send_gnss_full(void);
161159
void send_low_priority(void);
162160

163161
// Debugging Utils
@@ -167,7 +165,6 @@ class CommManager : public CommLinkInterface::ListenerInterface, public ParamLis
167165

168166
// the time of week stamp for the last sent GNSS message, to prevent re-sending
169167
uint32_t last_sent_gnss_tow_ = 0;
170-
uint32_t last_sent_gnss_full_tow_ = 0;
171168

172169
public:
173170
CommManager(ROSflight & rf, CommLinkInterface & comm_link);

include/interface/comm_link.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ class CommLinkInterface
166166
virtual void send_timesync(uint8_t system_id, int64_t tc1, int64_t ts1) = 0;
167167
virtual void send_version(uint8_t system_id, const char * const version) = 0;
168168
virtual void send_gnss(uint8_t system_id, const GNSSData & data) = 0;
169-
virtual void send_gnss_full(uint8_t system_id, const GNSSFull & data) = 0;
170169
virtual void send_error_data(uint8_t system_id, const StateManager::BackupData & error_data) = 0;
171170
virtual void send_battery_status(uint8_t system_id, float voltage, float current) = 0;
172171

include/sensors.h

Lines changed: 12 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ typedef struct
4747
{
4848
bool imu;
4949
bool gnss;
50-
bool gnss_full;
5150
bool baro;
5251
bool mag;
5352
bool diff_pressure;
@@ -68,69 +67,29 @@ enum GNSSFixType
6867

6968
struct GNSSData
7069
{
71-
struct ECEF
72-
{
73-
int32_t x; // cm
74-
int32_t y; // cm
75-
int32_t z; // cm
76-
uint32_t p_acc; // cm
77-
int32_t vx; // cm/s
78-
int32_t vy; // cm/s
79-
int32_t vz; // cm/s
80-
uint32_t s_acc; // cm/s
81-
};
82-
83-
GNSSFixType fix_type;
84-
uint32_t time_of_week;
85-
uint64_t time; // Unix time, in seconds
70+
uint64_t time_of_week; // Used internally to firmware for checking gnss
71+
// messages. Not included in ROS2 or MAVlink messages
72+
uint64_t seconds; // Unix time, in seconds
8673
uint64_t nanos; // Fractional time
87-
int32_t lat; // deg*10^-7
88-
int32_t lon; // deg*10^-7
89-
int32_t height; // mm
90-
int32_t vel_n; // mm/s
91-
int32_t vel_e; // mm/s
92-
int32_t vel_d; // mm/s
93-
uint32_t h_acc; // mm
94-
uint32_t v_acc; // mm
95-
96-
ECEF ecef;
97-
98-
uint64_t rosflight_timestamp; // microseconds, time stamp of last byte in the message
99-
100-
GNSSData() { memset(this, 0, sizeof(GNSSData)); }
101-
};
102-
103-
struct GNSSFull
104-
{
105-
uint64_t time_of_week;
74+
GNSSFixType fix_type;
10675
uint16_t year;
10776
uint8_t month;
10877
uint8_t day;
10978
uint8_t hour;
11079
uint8_t min;
11180
uint8_t sec;
112-
uint8_t valid;
113-
uint32_t t_acc;
114-
int32_t nano;
115-
uint8_t fix_type;
11681
uint8_t num_sat;
11782
int32_t lon;
11883
int32_t lat;
11984
int32_t height;
120-
int32_t height_msl;
121-
uint32_t h_acc;
122-
uint32_t v_acc;
123-
int32_t vel_n;
124-
int32_t vel_e;
125-
int32_t vel_d;
126-
int32_t g_speed;
127-
int32_t head_mot;
128-
uint32_t s_acc;
129-
uint32_t head_acc;
130-
uint16_t p_dop;
131-
uint64_t rosflight_timestamp; // microseconds, time stamp of last byte in the message
132-
133-
GNSSFull() { memset(this, 0, sizeof(GNSSFull)); }
85+
int32_t vel_n; // mm/s
86+
int32_t vel_e; // mm/s
87+
int32_t vel_d; // mm/s
88+
uint32_t h_acc; // mm
89+
uint32_t v_acc; // mm
90+
uint32_t s_acc; // mm/s
91+
92+
GNSSData() { memset(this, 0, sizeof(GNSSData)); }
13493
};
13594

13695
class ROSflight;
@@ -158,7 +117,6 @@ class Sensors : public ParamListenerInterface
158117
bool sonar_range_valid = false;
159118

160119
GNSSData gnss_data;
161-
GNSSFull gnss_full;
162120
float gps_CNO = 0; // What is this?
163121
bool gnss_present = false;
164122

src/comm_manager.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -460,16 +460,6 @@ void CommManager::send_gnss(void)
460460
}
461461
}
462462

463-
void CommManager::send_gnss_full()
464-
{
465-
const GNSSFull & gnss_full = RF_.sensors_.data().gnss_full;
466-
467-
if (gnss_full.time_of_week != last_sent_gnss_full_tow_) {
468-
comm_link_.send_gnss_full(sysid_, RF_.sensors_.data().gnss_full);
469-
last_sent_gnss_full_tow_ = gnss_full.time_of_week;
470-
}
471-
}
472-
473463
void CommManager::send_low_priority(void)
474464
{
475465
send_next_param();
@@ -508,8 +498,6 @@ void CommManager::stream(got_flags got)
508498
if (got.battery) { send_battery_status(); }
509499
// GPS data (GNSS Packed)
510500
if (got.gnss) { send_gnss(); }
511-
// GPS full data (not needed)
512-
if (got.gnss_full) { send_gnss_full(); }
513501
if (got.rc) { send_rc_raw(); }
514502

515503
{

src/sensors.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,8 @@ got_flags Sensors::run()
159159
data_.gnss_present = true;
160160
if (rf_.board_.gnss_has_new_data()) {
161161
got.gnss = true;
162-
rf_.board_.gnss_read(&this->data_.gnss_data, &this->data_.gnss_full);
162+
rf_.board_.gnss_read(&this->data_.gnss_data);
163163
}
164-
got.gnss_full = got.gnss; // bot come with the pvt GPS data
165164
}
166165

167166
// BAROMETER:

0 commit comments

Comments
 (0)