mavlink VFR_HUD message fixed, minor fixes and cleanup

This commit is contained in:
Anton Babushkin
2013-08-22 18:05:30 +02:00
parent bb91484b26
commit 41fac46ff0
4 changed files with 17 additions and 17 deletions
+2 -2
View File
@@ -825,9 +825,9 @@ int commander_thread_main(int argc, char *argv[])
status.condition_landed = local_position.landed;
status_changed = true;
if (status.condition_landed) {
mavlink_log_info(mavlink_fd, "[cmd] LANDED");
mavlink_log_critical(mavlink_fd, "[cmd] LANDED");
} else {
mavlink_log_info(mavlink_fd, "[cmd] IN AIR");
mavlink_log_critical(mavlink_fd, "[cmd] IN AIR");
}
}
}
+5 -5
View File
@@ -637,12 +637,12 @@ l_airspeed(const struct listener *l)
orb_copy(ORB_ID(airspeed), mavlink_subs.airspeed_sub, &airspeed);
float groundspeed = sqrtf(global_pos.vx * global_pos.vx + global_pos.vy * global_pos.vy);
float throttle = actuators_0.control_effective[3] * (UINT16_MAX - 1);
float alt = global_pos.alt;
float climb = global_pos.vz;
uint16_t heading = (att.yaw + M_PI_F) / M_PI_F * 180.0f;
uint16_t throttle = actuators_0.control_effective[3] * (UINT16_MAX - 1);
float alt = global_pos.relative_alt;
float climb = -global_pos.vz;
mavlink_msg_vfr_hud_send(MAVLINK_COMM_0, airspeed.true_airspeed_m_s, groundspeed,
((att.yaw + M_PI_F) / M_PI_F) * 180.0f, throttle, alt, climb);
mavlink_msg_vfr_hud_send(MAVLINK_COMM_0, airspeed.true_airspeed_m_s, groundspeed, heading, throttle, alt, climb);
}
static void *
@@ -610,7 +610,7 @@ int position_estimator_inav_thread_main(int argc, char *argv[])
if (local_pos.v_xy_valid) {
global_pos.vx = local_pos.vx;
global_pos.vy = local_pos.vy;
global_pos.hdg = atan2f(local_pos.vy, local_pos.vx);
global_pos.hdg = atan2f(local_pos.vy, local_pos.vx); // TODO is it correct?
}
if (local_pos.z_valid) {
@@ -62,17 +62,17 @@
struct vehicle_global_position_s
{
uint64_t timestamp; /**< time of this estimate, in microseconds since system start */
uint64_t time_gps_usec; /**< GPS timestamp in microseconds */
uint64_t time_gps_usec; /**< GPS timestamp in microseconds */
bool valid; /**< true if position satisfies validity criteria of estimator */
int32_t lat; /**< Latitude in 1E7 degrees LOGME */
int32_t lon; /**< Longitude in 1E7 degrees LOGME */
float alt; /**< Altitude in meters LOGME */
float relative_alt; /**< Altitude above home position in meters, LOGME */
float vx; /**< Ground X Speed (Latitude), m/s in ENU LOGME */
float vy; /**< Ground Y Speed (Longitude), m/s in ENU LOGME */
float vz; /**< Ground Z Speed (Altitude), m/s in ENU LOGME */
float hdg; /**< Compass heading in radians -PI..+PI. */
int32_t lat; /**< Latitude in 1E7 degrees */
int32_t lon; /**< Longitude in 1E7 degrees */
float alt; /**< Altitude in meters */
float relative_alt; /**< Altitude above home position in meters, */
float vx; /**< Ground X velocity, m/s in NED */
float vy; /**< Ground Y velocity, m/s in NED */
float vz; /**< Ground Z velocity, m/s in NED */
float hdg; /**< Compass heading in radians -PI..+PI. */
};