1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

ahrs: fix type on flags, remove redundant code

No need to have boolean flags being floats.
Some of the attitude message was being populated twice.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1428 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
stac 2010-08-27 02:14:54 +00:00 committed by stac
parent a0b21bef45
commit 0a7088c24a
2 changed files with 6 additions and 12 deletions

View File

@ -141,7 +141,7 @@ struct attitude_solution {
struct altitude_sensor {
float altitude;
float updated;
bool updated;
};
struct gps_sensor {
@ -149,7 +149,7 @@ struct gps_sensor {
float heading;
float groundspeed;
float quality;
float updated;
bool updated;
};
static struct mag_sensor mag_data;
@ -201,8 +201,6 @@ int16_t * valid_data_buffer;
uint32_t ekf_too_slow = 0;
//! Total number of data blocks converted
uint32_t total_conversion_blocks = 0;
//! Flag to indicate new GPS data available
uint8_t gps_updated = FALSE;
//! Home location in ECEF coordinates
double BaseECEF[3] = {0, 0, 0};
//! Rotation matrix from LLA to Rne
@ -361,7 +359,7 @@ int main()
vel[2] = 0;
FullCorrection(mag, gps_data.NED, vel, altitude_data.altitude);
gps_data.updated = FALSE;
gps_data.updated = false;
}
else
MagCorrection(mag);
@ -772,7 +770,7 @@ void process_spi_request(void)
}
if(user_rx_v1.payload.user.v.req.update.gps.updated)
{
gps_data.updated = TRUE;
gps_data.updated = true;
gps_data.NED[0] = user_rx_v1.payload.user.v.req.update.gps.NED[0];
gps_data.NED[1] = user_rx_v1.payload.user.v.req.update.gps.NED[1];
gps_data.NED[2] = user_rx_v1.payload.user.v.req.update.gps.NED[2];
@ -795,10 +793,6 @@ void process_spi_request(void)
user_tx_v1.payload.user.v.rsp.update.Vel[1] = Nav.Vel[1];
user_tx_v1.payload.user.v.rsp.update.Vel[2] = Nav.Vel[2];
user_tx_v1.payload.user.v.rsp.update.quaternion.q2 = attitude_data.quaternion.q2;
user_tx_v1.payload.user.v.rsp.update.quaternion.q3 = attitude_data.quaternion.q3;
user_tx_v1.payload.user.v.rsp.update.quaternion.q4 = attitude_data.quaternion.q4;
dump_spi_message(PIOS_COM_AUX, "U", (uint8_t *)&user_tx_v1, sizeof(user_tx_v1));
lfsm_user_set_tx_v1 (&user_tx_v1);
break;

View File

@ -200,7 +200,7 @@ enum opahrs_result PIOS_OPAHRS_resync(void)
return rc;
}
extern enum opahrs_result PIOS_OPAHRS_Sync(struct opahrs_msg_v1 *rsp)
enum opahrs_result PIOS_OPAHRS_Sync(struct opahrs_msg_v1 *rsp)
{
struct opahrs_msg_v1 req;
enum opahrs_result rc;
@ -289,7 +289,7 @@ enum opahrs_result PIOS_OPAHRS_SetMagNorth(struct opahrs_msg_v1 *req)
return opahrs_msg_v1_recv_rsp (OPAHRS_MSG_V1_RSP_NORTH, &rsp);
}
extern enum opahrs_result PIOS_OPAHRS_SetGetUpdate(struct opahrs_msg_v1 *req, struct opahrs_msg_v1 *rsp)
enum opahrs_result PIOS_OPAHRS_SetGetUpdate(struct opahrs_msg_v1 *req, struct opahrs_msg_v1 *rsp)
{
enum opahrs_result rc;