From 7303d6171040e86c8e2087da5a111973a1129944 Mon Sep 17 00:00:00 2001 From: lm Date: Thu, 10 Feb 2011 18:17:42 +0100 Subject: [PATCH] A number of bugfixes for various MAVLink messages --- .gitignore | 61 ++++++++++++++++++++-------------------- deploy/mac_create_dmg.sh | 20 ++++--------- qgroundcontrol.pri | 6 ++-- src/comm/MAVLinkSimulationMAV.cc | 18 +++++++++++- src/uas/UAS.cc | 3 +- src/ui/QGCRemoteControlView.cc | 6 ++-- 6 files changed, 63 insertions(+), 51 deletions(-) diff --git a/.gitignore b/.gitignore index ddd3a43..6d8b9fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,32 +1,33 @@ -*Makefile* -tags -build -Info.plist -obj -*.log -*~ -*qtc* -bin/*.exe -bin/*.txt -bin/mac -*pro.user* -qrc_*.cpp -*.Debug -*.Release -tmp -debug -release -qgroundcontrol -mavlinkgen -*.wav -qgroundcontrol.xcodeproj/** -doc/html -doc/doxy.log -deploy/mac -deploy/linux -controller_log* -user_config.pri -*.app +*Makefile* +tags +build +Info.plist +obj +*.log +*~ +*qtc* +bin/*.exe +bin/*.txt +bin/mac +*pro.user* +qrc_*.cpp +*.Debug +*.Release +tmp +debug +release +qgroundcontrol +mavlinkgen +*.wav +qgroundcontrol.xcodeproj/** +doc/html +doc/doxy.log +deploy/mac +deploy/linux +deploy/qgroundcontrol* +controller_log* +user_config.pri +*.app *.ncb *.vcproj @@ -39,4 +40,4 @@ user_config.pri *.project *.cproject *.sln -*.suo \ No newline at end of file +*.suo diff --git a/deploy/mac_create_dmg.sh b/deploy/mac_create_dmg.sh index bcdfe43..1607f63 100644 --- a/deploy/mac_create_dmg.sh +++ b/deploy/mac_create_dmg.sh @@ -1,20 +1,12 @@ #!/bin/sh -# Clean build directories -rm -rf mac -mkdir -p mac -# Change to build directory and compile application -cd .. -make -j4 -# Copy and build the application bundle -cd deploy -cp -r ../bin/mac/qgroundcontrol.app mac/. +cp -r ../../qgroundcontrol-build-desktop/qgroundcontrol.app . -cp -r ../audio mac/qgroundcontrol.app/Contents/MacOs/. -mkdir -p mac/qgroundcontrol.app/Contents/Frameworks/ +cp -r ../audio qgroundcontrol.app/Contents/MacOs/. +mkdir -p qgroundcontrol.app/Contents/Frameworks/ # SDL is not copied by Qt - for whatever reason -cp -r SDL.framework mac/qgroundcontrol.app/Contents/Frameworks/. +cp -r /Library/Frameworks/SDL.framework qgroundcontrol.app/Contents/Frameworks/. echo -e '\n\nStarting to create disk image. This may take a while..\n' -macdeployqt mac/qgroundcontrol.app -dmg -rm -rf mac/qgroundcontrol.app +macdeployqt qgroundcontrol.app -dmg +#rm -rf qgroundcontrol.app echo -e '\n\n QGroundControl .DMG file is now ready for publishing\n' diff --git a/qgroundcontrol.pri b/qgroundcontrol.pri index b745ad4..5cd1846 100644 --- a/qgroundcontrol.pri +++ b/qgroundcontrol.pri @@ -50,11 +50,13 @@ macx { COMPILER_VERSION = $$system(gcc -v) #message(Using compiler $$COMPILER_VERSION) + CONFIG += x86 cocoa phonon + CONFIG -= x86_64 + HARDWARE_PLATFORM = $$system(uname -a) contains( $$HARDWARE_PLATFORM, "9.6.0" ) || contains( $$HARDWARE_PLATFORM, "9.7.0" ) || contains( $$HARDWARE_PLATFORM, "9.8.0" ) || contains( $$HARDWARE_PLATFORM, "9.9.0" ) { # x86 Mac OS X Leopard 10.5 and earlier - CONFIG += x86 x86_64 cocoa phonon - #CONFIG -= x86_64 + #message(Building for Mac OS X 32bit/Leopard 10.5 and earlier) # Enable function-profiling with the OS X saturn tool diff --git a/src/comm/MAVLinkSimulationMAV.cc b/src/comm/MAVLinkSimulationMAV.cc index ee70e30..90e8c47 100644 --- a/src/comm/MAVLinkSimulationMAV.cc +++ b/src/comm/MAVLinkSimulationMAV.cc @@ -143,9 +143,13 @@ void MAVLinkSimulationMAV::mainloop() // ATTITUDE mavlink_attitude_t attitude; + attitude.usec = 0; attitude.roll = 0.0f; attitude.pitch = 0.0f; attitude.yaw = yaw; + attitude.rollspeed = 0.0f; + attitude.pitchspeed = 0.0f; + attitude.yawspeed = 0.0f; mavlink_msg_attitude_encode(systemid, MAV_COMP_ID_IMU, &msg, &attitude); link->sendMAVLinkMessage(&msg); @@ -158,7 +162,7 @@ void MAVLinkSimulationMAV::mainloop() status.packet_drop = 0; status.vbat = 10500; status.status = sys_state; - + status.battery_remaining = 900; mavlink_msg_sys_status_encode(systemid, MAV_COMP_ID_IMU, &msg, &status); link->sendMAVLinkMessage(&msg); timer10Hz = 5; @@ -183,8 +187,19 @@ void MAVLinkSimulationMAV::mainloop() nav.wp_dist = 2.0f; nav.alt_error = 0.5f; nav.xtrack_error = 0.2f; + nav.aspd_error = 0.0f; mavlink_msg_nav_controller_output_encode(systemid, MAV_COMP_ID_IMU, &msg, &nav); link->sendMAVLinkMessage(&msg); + + // RAW PRESSURE + mavlink_raw_pressure_t pressure; + pressure.press_abs = 1000; + pressure.press_diff1 = 2000; + pressure.press_diff2 = 5000; + pressure.temperature = 18150; // 18.15 deg Celsius + pressure.usec = 0; // Works also with zero timestamp + mavlink_msg_raw_pressure_encode(systemid, MAV_COMP_ID_IMU, &msg, &pressure); + link->sendMAVLinkMessage(&msg); } // 25 Hz execution @@ -203,6 +218,7 @@ void MAVLinkSimulationMAV::mainloop() control_status.gps_fix = 2; // 2D GPS fix control_status.position_fix = 3; // 3D fix from GPS + barometric pressure control_status.vision_fix = 0; // no fix from vision system + control_status.ahrs_health = 230; mavlink_msg_control_status_encode(systemid, MAV_COMP_ID_IMU, &ret, &control_status); link->sendMAVLinkMessage(&ret); #endif //MAVLINK_ENABLED_PIXHAWK diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 71fc76b..baf152b 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -620,10 +620,11 @@ 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(0); + 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); } break; case MAVLINK_MSG_ID_RC_CHANNELS_RAW: diff --git a/src/ui/QGCRemoteControlView.cc b/src/ui/QGCRemoteControlView.cc index 506fcb7..f7a693b 100644 --- a/src/ui/QGCRemoteControlView.cc +++ b/src/ui/QGCRemoteControlView.cc @@ -97,7 +97,7 @@ void QGCRemoteControlView::setUASId(int id) { // The UAS exists, disconnect any existing connections disconnect(uas, SIGNAL(remoteControlChannelRawChanged(int,float,float)), this, SLOT(setChannel(int,float,float))); - disconnect(uas, SIGNAL(remoteControlRSSIRawChanged(float)), this, SLOT(setRemoteRSSI(float))); + disconnect(uas, SIGNAL(remoteControlRSSIChanged(float)), this, SLOT(setRemoteRSSI(float))); disconnect(uas, SIGNAL(radioCalibrationRawReceived(const QPointer)), calibrationWindow, SLOT(receive(const QPointer&))); disconnect(uas, SIGNAL(remoteControlChannelRawChanged(int,float)), calibrationWindow, SLOT(setChannelRaw(int,float))); disconnect(uas, SIGNAL(remoteControlChannelScaledChanged(int,float,float)), calibrationWindow, SLOT(setChannelScaled(int,float))); @@ -116,9 +116,7 @@ void QGCRemoteControlView::setUASId(int id) connect(newUAS, SIGNAL(remoteControlChannelRawChanged(int,float)), this, SLOT(setChannelRaw(int,float))); connect(newUAS, SIGNAL(remoteControlChannelRawChanged(int,float)), calibrationWindow, SLOT(setChannel(int,float))); - connect(newUAS, SIGNAL(remoteControlChannelScaledChanged(int,float)), this, SLOT(setChannelScaled(int,float))); -// connect(newUAS, SIGNAL(remoteControlChannelScaledChanged(int,float)), calibrationWindow, SLOT(setChannelScaled(int,float))); } } @@ -205,6 +203,8 @@ void QGCRemoteControlView::redraw() { progressBars.at(i)->setValue(normalized.at(i)*100.0f); } + // Update RSSI + rssiBar->setValue(rssi*100); updated = false; } }