From 9a5db5fb2d2fac1d3786f8cd400da7b17850d65a Mon Sep 17 00:00:00 2001 From: Mariano Lizarraga Date: Fri, 11 Mar 2011 16:30:11 -0600 Subject: [PATCH] Added support for scaled and raw pressure messages --- src/uas/SlugsMAV.h | 2 -- src/uas/UAS.cc | 18 +++++++++++++++--- src/ui/SlugsHilSim.cc | 6 +++--- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/uas/SlugsMAV.h b/src/uas/SlugsMAV.h index 1fbe14516..db2259e89 100644 --- a/src/uas/SlugsMAV.h +++ b/src/uas/SlugsMAV.h @@ -77,8 +77,6 @@ signals: void slugsGPSDateTime(int systemId, const mavlink_gps_date_time_t& gpsDateTime); void slugsActionAck(int systemId, const mavlink_action_ack_t& actionAck); - void slugsPidValues(int systemId, const mavlink_pid_t& pidValues); - void slugsBootMsg(int uasId, mavlink_boot_t& boot); void slugsAttitude(int uasId, mavlink_attitude_t& attitude); diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index dd0eaaeca..3e2e7a596 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -727,12 +727,24 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) mavlink_raw_pressure_t pressure; mavlink_msg_raw_pressure_decode(&message, &pressure); quint64 time = this->getUnixTime(pressure.usec); + emit valueChanged(uasId, "abs pressure", "raw", pressure.press_abs, time); + emit valueChanged(uasId, "diff pressure 1", "raw", pressure.press_diff1, time); + emit valueChanged(uasId, "diff pressure 2", "raw", pressure.press_diff2, time); + emit valueChanged(uasId, "temperature", "raw", pressure.temperature, time); + } + break; + + case MAVLINK_MSG_ID_SCALED_PRESSURE: + { + mavlink_scaled_pressure_t pressure; + mavlink_msg_scaled_pressure_decode(&message, &pressure); + quint64 time = this->getUnixTime(pressure.usec); emit valueChanged(uasId, "abs pressure", "hPa", pressure.press_abs, time); - emit valueChanged(uasId, "diff pressure 1", "hPa", pressure.press_diff1, time); - emit valueChanged(uasId, "diff pressure 2", "hPa", pressure.press_diff2, time); - emit valueChanged(uasId, "temperature", "deg C", pressure.temperature/100.0f, time); + emit valueChanged(uasId, "diff pressure", "hPa", pressure.press_diff, time); + emit valueChanged(uasId, "temperature", "C", pressure.temperature/100.0, time); } break; + case MAVLINK_MSG_ID_RC_CHANNELS_RAW: { mavlink_rc_channels_raw_t channels; diff --git a/src/ui/SlugsHilSim.cc b/src/ui/SlugsHilSim.cc index 22d86668e..11f390b20 100644 --- a/src/ui/SlugsHilSim.cc +++ b/src/ui/SlugsHilSim.cc @@ -323,10 +323,10 @@ void SlugsHilSim::commandDatagramToSimulink() #ifdef MAVLINK_ENABLED_SLUGS //mavlink_pwm_commands_t* pwdC = (static_cast(activeUas))->getPwmCommands(); - mavlink_pwm_commands_t* pwdC; + //mavlink_pwm_commands_t* pwdC; - if(pwdC != NULL){ - } +// if(pwdC != NULL){ +// } QByteArray data; data.resize(22); -- 2.22.0