Skip to content

Commit be8a302

Browse files
Merge pull request #57 from larus-breeze/work3
Merging recent changes into trunk.
2 parents 81eac8b + 720a581 commit be8a302

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

NAV_Algorithms/data_structures.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ typedef struct
9090
float integrator_vario;
9191
float3vector wind;
9292
float3vector wind_average;
93-
uint32_t circle_mode;
93+
uint32_t flight_mode;
9494
quaternion<float> q;
9595
eulerangle<float> euler;
9696
float effective_vertical_acceleration;

NAV_Algorithms/navigator.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,11 @@ void navigator_t::report_data( output_data_t &d)
143143
d.effective_vertical_acceleration
144144
= variometer.get_effective_vertical_acceleration();
145145

146-
d.circle_mode = ahrs.get_circling_state();
146+
if( airborne_detector.is_airborne())
147+
d.flight_mode = ahrs.get_circling_state();
148+
else
149+
d.flight_mode = 3; // = ON_GROUND
150+
147151
d.turn_rate = ahrs.get_turn_rate();
148152
d.slip_angle = ahrs.getSlipAngle();
149153
d.pitch_angle = ahrs.getPitchAngle();

Output_Formatter/CAN_output.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ enum CAN_ID_SENSOR
4444
CAN_Id_SlipPitch = 0x128, //!< float slip angle from body-acc, float pitch angle from body-acc
4545
CAN_Id_Voltage_Circle = 0x129, //!< float supply voltage, uint8_t circle-mode
4646
CAN_Id_SystemState = 0x12a, //!< u32 system_state, u32 git_tag dec
47+
CAN_Id_Sensor_Health = 0x12b, //!< float magnetic disturbance
4748

4849
CAN_Id_GPS_Date_Time = 0x140, //!< uint8_t year-2000, month, day, hour, mins, secs
4950
CAN_Id_GPS_Lat = 0x141, //!< double latitude
@@ -121,7 +122,12 @@ void CAN_output ( const output_data_t &x, bool horizon_activated)
121122
p.id=CAN_Id_Voltage_Circle;
122123
p.dlc=5;
123124
p.data_f[0] = x.m.supply_voltage;
124-
p.data_b[4] = (uint8_t)(x.circle_mode);
125+
p.data_b[4] = (uint8_t)(x.flight_mode);
126+
CAN_send(p, 1);
127+
128+
p.id=CAN_Id_Sensor_Health;
129+
p.dlc=4;
130+
p.data_f[0] = x.magnetic_disturbance;
125131
CAN_send(p, 1);
126132

127133
p.id=CAN_Id_GPS_Date_Time;

Output_Formatter/CAN_output.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#define CMD_MEASURE_LEVEL 0x3002
5959
#define CMD_CALCULATE 0x3003
6060
#define CMD_TUNE 0x3004
61+
#define CMD_RESET_SENSOR 0x3005
6162

6263
void CAN_output ( const output_data_t &x, bool horizon_activated);
6364
void CAN_heartbeat( void);

Output_Formatter/system_state.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ enum availability_bits
2424
USB_OUTPUT_ACTIVE = 0x1000,
2525
BLUEZ_OUTPUT_ACTIVE = 0x2000,
2626
CAN_OUTPUT_ACTIVE = 0x4000,
27-
USART_2_OUTPUT_ACTIVE = 0x8000
27+
USART_2_OUTPUT_ACTIVE = 0x8000,
28+
29+
HORIZON_NOT_AVAILABLE = 0x10000
2830
};
2931

3032
extern uint32_t system_state; //!< bits collected from availability_bits

0 commit comments

Comments
 (0)