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

Merge branch 'rghunter/udp_control' of ssh://git.openpilot.org/OpenPilot into rghunter/udp_control

This commit is contained in:
Laura Sebesta 2012-07-17 23:07:34 +02:00
commit e3ea070eb0
4 changed files with 65 additions and 51 deletions

View File

@ -1,3 +1,22 @@
% GCSCONTROL
% This class allows the user to send 4-axis stick commands to OpenPilot
% GCS.
%
% Create class by
% control = GCSControl
%
% Open connection by
% control.connect('01.23.45.67', 89)
% where the first value is the IP address of the computer running GCS and
% the second value is the port on which GCS is listening.
%
% Send command by
% control.command(pitch, yaw, roll, throttle)
% where all variables are between [-1,1]
%
% Close connection by
% control.close()
classdef GCSControl < handle
properties

View File

@ -169,7 +169,6 @@ void GCSControlGadget::sticksChangedLocally(double leftX, double leftY, double r
newThrottle = leftY;
break;
}
newThrottle = (newThrottle + 1)/2.0;
//check if buttons have control over this axis... if so don't update it
int buttonRollControl=0;

View File

@ -54,7 +54,7 @@ GCSControlGadgetConfiguration::GCSControlGadgetConfiguration(QString classId, QS
yawChannel = qSettings->value("yawChannel").toInt();
throttleChannel = qSettings->value("throttleChannel").toInt();
udp_port = qSettings->value("controlPortUDP").toInt();
udp_port = qSettings->value("controlPortUDP").toUInt();
udp_host = QHostAddress(qSettings->value("controlHostUDP").toString());
int i;

View File

@ -143,7 +143,7 @@
<item>
<widget class="QTabWidget" name="UDPSetup">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tabWidgetPage2">
<attribute name="title">
@ -1020,59 +1020,55 @@
<rect>
<x>20</x>
<y>20</y>
<width>191</width>
<height>121</height>
<width>301</width>
<height>71</height>
</rect>
</property>
<property name="title">
<string>UDP Port Configuration</string>
</property>
<widget class="QLineEdit" name="udp_port">
<property name="geometry">
<rect>
<x>60</x>
<y>30</y>
<width>113</width>
<height>30</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_6">
<property name="geometry">
<rect>
<x>10</x>
<y>40</y>
<width>67</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Port:</string>
</property>
</widget>
<widget class="QLineEdit" name="udp_host">
<property name="geometry">
<rect>
<x>60</x>
<y>70</y>
<width>113</width>
<height>30</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_7">
<property name="geometry">
<rect>
<x>10</x>
<y>80</y>
<width>67</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Host:</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Host:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="udp_host">
<property name="maximumSize">
<size>
<width>120</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>127.0.0.1</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Port:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="udp_port">
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>2323</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>