Skip to content

Commit caad062

Browse files
committed
fixes for test board and misc other nits
1 parent 9a7c200 commit caad062

File tree

6 files changed

+17
-5
lines changed

6 files changed

+17
-5
lines changed

comms/mavlink/mavlink.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,13 @@ void Mavlink::send_sonar(uint8_t system_id,
263263
}
264264

265265

266-
virtual void Mavlink::send_oflow(uint8_t system_id, OpticalFlowStruct *oflow)
266+
void Mavlink::send_oflow(uint8_t system_id, OpticalFlowStruct *oflow)
267267
{
268-
float timestamp = oflow->header.timestamp;
269-
float x = oflow->rate[0];
270-
float y - oflow->rate[1];
268+
(void)system_id;
269+
(void)oflow;
270+
//float timestamp = oflow->header.timestamp;
271+
//float x = oflow->rate[0];
272+
//float y = oflow->rate[1];
271273
// TODO. Add Optical flow packet...
272274
}
273275

comms/mavlink/mavlink.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ class Mavlink : public CommLinkInterface
7979
void send_sonar(uint8_t system_id,
8080
/* TODO enum type*/ uint8_t type, float range, float max_range,
8181
float min_range) override;
82+
void send_oflow(uint8_t system_id, OpticalFlowStruct *oflow) override;
8283
void send_status(uint8_t system_id, bool armed, bool failsafe, bool rc_override, bool offboard,
8384
uint8_t error_code, uint8_t control_mode, int16_t num_errors,
8485
int16_t loop_time_us) override;

include/comm_manager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ class CommManager : public CommLinkInterface::ListenerInterface, public ParamLis
152152
void send_diff_pressure(void);
153153
void send_baro(void);
154154
void send_sonar(void);
155+
void send_oflow(void);
155156
void send_mag(void);
156157
void send_battery_status(void);
157158
void send_gnss(void);

src/comm_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ void CommManager::send_baro(void)
424424
void CommManager::send_sonar(void)
425425
{
426426
comm_link_.send_sonar(sysid_,
427-
RF_.sensors_.get_sonar()->type,
427+
(uint8_t)RF_.sensors_.get_sonar()->type,
428428
RF_.sensors_.get_sonar()->range,
429429
RF_.sensors_.get_sonar()->max_range,
430430
RF_.sensors_.get_sonar()->min_range );

test/test_board.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@
127127
(void) sonar;
128128
return false;
129129
}
130+
131+
bool testBoard::flow_read(rosflight_firmware::OpticalFlowStruct * flow)
132+
{
133+
(void) flow;
134+
return false;
135+
}
130136

131137
bool testBoard::gnss_read(rosflight_firmware::GnssStruct * gnss) { return false; }
132138

test/test_board.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@
8484

8585
bool sonar_read(rosflight_firmware::RangeStruct * sonar) override;
8686

87+
bool flow_read(rosflight_firmware::OpticalFlowStruct * flow) override;
88+
8789
// Battery
8890
bool battery_read(rosflight_firmware::BatteryStruct * bat) override;
8991
void battery_voltage_set_multiplier(double multiplier) override;

0 commit comments

Comments
 (0)