Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
d018be5d
Commit
d018be5d
authored
Sep 22, 2010
by
Bryan Godbolt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
radio cal data now passed properly via mavlink
parent
47165eaa
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
41 additions
and
23 deletions
+41
-23
OpalLink.cc
src/comm/OpalLink.cc
+1
-1
QGCRemoteControlView.cc
src/ui/QGCRemoteControlView.cc
+1
-1
AbstractCalibrator.h
src/ui/RadioCalibration/AbstractCalibrator.h
+2
-0
AirfoilServoCalibrator.cc
src/ui/RadioCalibration/AirfoilServoCalibrator.cc
+3
-3
AirfoilServoCalibrator.h
src/ui/RadioCalibration/AirfoilServoCalibrator.h
+4
-4
CurveCalibrator.h
src/ui/RadioCalibration/CurveCalibrator.h
+2
-2
RadioCalibrationData.cc
src/ui/RadioCalibration/RadioCalibrationData.cc
+8
-2
RadioCalibrationData.h
src/ui/RadioCalibration/RadioCalibrationData.h
+13
-4
RadioCalibrationWindow.cc
src/ui/RadioCalibration/RadioCalibrationWindow.cc
+1
-1
RadioCalibrationWindow.h
src/ui/RadioCalibration/RadioCalibrationWindow.h
+1
-0
SwitchCalibrator.cc
src/ui/RadioCalibration/SwitchCalibrator.cc
+2
-2
SwitchCalibrator.h
src/ui/RadioCalibration/SwitchCalibrator.h
+3
-3
No files found.
src/comm/OpalLink.cc
View file @
d018be5d
...
...
@@ -142,7 +142,7 @@ void OpalLink::writeBytes(const char *bytes, qint64 length)
this
->
sendRCValues
=
static_cast
<
bool
>
(
rc
.
enabled
);
}
break
;
#ifdef MAVLINK_ENABLE_UALBERTA_MESSAGES
#ifdef MAVLINK_ENABLE
D
_UALBERTA_MESSAGES
case
MAVLINK_MSG_ID_RADIO_CALIBRATION
:
{
mavlink_radio_calibration_t
radio
;
...
...
src/ui/QGCRemoteControlView.cc
View file @
d018be5d
...
...
@@ -110,7 +110,7 @@ void QGCRemoteControlView::setUASId(int id)
// New UAS exists, connect
nameLabel
->
setText
(
QString
(
"RC Input of %1"
).
arg
(
newUAS
->
getUASName
()));
calibrationWindow
->
setUASId
(
id
);
connect
(
newUAS
,
SIGNAL
(
radioCalibrationReceived
(
const
QPointer
<
RadioCalibrationData
>
)),
calibrationWindow
,
SLOT
(
receive
(
const
QPointer
<
RadioCalibrationData
>&
)));
connect
(
newUAS
,
SIGNAL
(
radioCalibrationReceived
(
const
QPointer
<
RadioCalibrationData
>
&
)),
calibrationWindow
,
SLOT
(
receive
(
const
QPointer
<
RadioCalibrationData
>&
)));
connect
(
newUAS
,
SIGNAL
(
remoteControlChannelChanged
(
int
,
float
,
float
)),
this
,
SLOT
(
setChannel
(
int
,
float
,
float
)));
connect
(
newUAS
,
SIGNAL
(
remoteControlChannelChanged
(
int
,
float
,
float
)),
calibrationWindow
,
SLOT
(
setChannel
(
int
,
float
,
float
)));
connect
(
newUAS
,
SIGNAL
(
remoteControlRSSIChanged
(
float
)),
this
,
SLOT
(
setRemoteRSSI
(
float
)));
...
...
src/ui/RadioCalibration/AbstractCalibrator.h
View file @
d018be5d
...
...
@@ -16,6 +16,8 @@ public:
~
AbstractCalibrator
();
virtual
void
set
(
const
QVector
<
float
>&
data
)
=
0
;
signals:
void
setpointChanged
(
int
index
,
float
value
);
public
slots
:
void
channelChanged
(
float
raw
);
...
...
src/ui/RadioCalibration/AirfoilServoCalibrator.cc
View file @
d018be5d
...
...
@@ -91,19 +91,19 @@ AirfoilServoCalibrator::AirfoilServoCalibrator(AirfoilType type, QWidget *parent
void
AirfoilServoCalibrator
::
setHigh
()
{
highPulseWidth
->
setText
(
QString
::
number
(
static_cast
<
double
>
(
logExtrema
())));
emit
highSetpointChanged
(
logExtrema
());
emit
setpointChanged
(
2
,
logExtrema
());
}
void
AirfoilServoCalibrator
::
setCenter
()
{
centerPulseWidth
->
setText
(
QString
::
number
(
static_cast
<
double
>
(
logAverage
())));
emit
centerSetpointChanged
(
logAverage
());
emit
setpointChanged
(
1
,
logAverage
());
}
void
AirfoilServoCalibrator
::
setLow
()
{
lowPulseWidth
->
setText
(
QString
::
number
(
static_cast
<
double
>
(
logExtrema
())));
emit
lowSetpointChanged
(
logExtrema
());
emit
setpointChanged
(
0
,
logExtrema
());
}
void
AirfoilServoCalibrator
::
set
(
const
QVector
<
float
>
&
data
)
...
...
src/ui/RadioCalibration/AirfoilServoCalibrator.h
View file @
d018be5d
...
...
@@ -26,10 +26,10 @@ public:
/** @param data must have exaclty 3 elemets. they are assumed to be low center high */
void
set
(
const
QVector
<
float
>&
data
);
signals:
void
highSetpointChanged
(
float
);
void
centerSetpointChanged
(
float
);
void
lowSetpointChanged
(
float
);
//
signals:
//
void highSetpointChanged(float);
//
void centerSetpointChanged(float);
//
void lowSetpointChanged(float);
protected
slots
:
void
setHigh
();
...
...
src/ui/RadioCalibration/CurveCalibrator.h
View file @
d018be5d
...
...
@@ -25,8 +25,8 @@ public:
~
CurveCalibrator
();
void
set
(
const
QVector
<
float
>
&
data
);
signals:
void
setpointChanged
(
int
setpoint
,
float
raw
);
//
signals:
// void setpointChanged(int setpoint, float raw);
protected
slots
:
void
setSetpoint
(
int
setpoint
);
...
...
src/ui/RadioCalibration/RadioCalibrationData.cc
View file @
d018be5d
...
...
@@ -2,7 +2,13 @@
RadioCalibrationData
::
RadioCalibrationData
()
{
data
=
new
QVector
<
QVector
<
float
>
>
();
data
=
new
QVector
<
QVector
<
float
>
>
(
6
);
(
*
data
).
insert
(
AILERON
,
QVector
<
float
>
(
3
));
(
*
data
).
insert
(
ELEVATOR
,
QVector
<
float
>
(
3
));
(
*
data
).
insert
(
RUDDER
,
QVector
<
float
>
(
3
));
(
*
data
).
insert
(
GYRO
,
QVector
<
float
>
(
2
));
(
*
data
).
insert
(
PITCH
,
QVector
<
float
>
(
5
));
(
*
data
).
insert
(
THROTTLE
,
QVector
<
float
>
(
5
));
}
RadioCalibrationData
::
RadioCalibrationData
(
const
QVector
<
float
>
&
aileron
,
...
...
@@ -45,5 +51,5 @@ const QVector<float>& RadioCalibrationData::operator ()(int i) const
}
// This is not good. If it is ever used after being returned it will cause a crash
return
QVector
<
float
>
();
//
return QVector<float>();
}
src/ui/RadioCalibration/RadioCalibrationData.h
View file @
d018be5d
...
...
@@ -30,12 +30,21 @@ public:
THROTTLE
};
void
loadFile
();
void
saveFile
();
void
send
();
void
receive
();
//
void loadFile();
//
void saveFile();
//
void send();
//
void receive();
const
float
*
operator
[](
int
i
)
const
;
const
QVector
<
float
>&
operator
()(
int
i
)
const
;
void
set
(
int
element
,
int
index
,
float
value
)
{(
*
data
)[
element
][
index
]
=
value
;}
public
slots
:
void
setAileron
(
int
index
,
float
value
)
{
set
(
AILERON
,
index
,
value
);}
void
setElevator
(
int
index
,
float
value
)
{
set
(
ELEVATOR
,
index
,
value
);}
void
setRudeer
(
int
index
,
float
value
)
{
set
(
RUDDER
,
index
,
value
);}
void
setGyro
(
int
index
,
float
value
)
{
set
(
GYRO
,
index
,
value
);}
void
setPitch
(
int
index
,
float
value
)
{
set
(
PITCH
,
index
,
value
);}
void
setThrottle
(
int
index
,
float
value
)
{
set
(
THROTTLE
,
index
,
value
);}
protected:
QVector
<
QVector
<
float
>
>
*
data
;
...
...
src/ui/RadioCalibration/RadioCalibrationWindow.cc
View file @
d018be5d
...
...
@@ -43,6 +43,7 @@ RadioCalibrationWindow::RadioCalibrationWindow(QWidget *parent) :
connect
(
transmit
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
send
()));
connect
(
get
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
request
()));
connect
(
aileron
,
SIGNAL
(
setpointChanged
(
int
,
float
)),
radio
,
SLOT
(
setAileron
(
int
,
float
)));
setUASId
(
0
);
}
...
...
@@ -94,7 +95,6 @@ void RadioCalibrationWindow::send()
UAS
*
uas
=
dynamic_cast
<
UAS
*>
(
UASManager
::
instance
()
->
getUASForId
(
uasId
));
if
(
uas
)
{
qDebug
()
<<
"we have a uas"
;
mavlink_message_t
msg
;
mavlink_msg_radio_calibration_pack
(
uasId
,
0
,
&
msg
,
(
*
radio
)[
RadioCalibrationData
::
AILERON
],
...
...
src/ui/RadioCalibration/RadioCalibrationWindow.h
View file @
d018be5d
...
...
@@ -50,6 +50,7 @@ protected:
CurveCalibrator
*
throttle
;
int
uasId
;
QPointer
<
RadioCalibrationData
>
radio
;
QSignalMapper
mapper
;
};
#endif // RADIOCALIBRATIONWINDOW_H
src/ui/RadioCalibration/SwitchCalibrator.cc
View file @
d018be5d
...
...
@@ -39,13 +39,13 @@ SwitchCalibrator::SwitchCalibrator(QString titleString, QWidget *parent) :
void
SwitchCalibrator
::
setDefault
()
{
defaultPulseWidth
->
setText
(
QString
::
number
(
static_cast
<
double
>
(
logExtrema
())));
emit
defaultSetpointChanged
(
logExtrema
());
emit
setpointChanged
(
0
,
logExtrema
());
}
void
SwitchCalibrator
::
setToggled
()
{
toggledPulseWidth
->
setText
(
QString
::
number
(
static_cast
<
double
>
(
logExtrema
())));
emit
toggledSetpointChanged
(
logExtrema
());
emit
setpointChanged
(
1
,
logExtrema
());
}
void
SwitchCalibrator
::
set
(
const
QVector
<
float
>
&
data
)
...
...
src/ui/RadioCalibration/SwitchCalibrator.h
View file @
d018be5d
...
...
@@ -17,9 +17,9 @@ public:
explicit
SwitchCalibrator
(
QString
title
=
QString
(),
QWidget
*
parent
=
0
);
void
set
(
const
QVector
<
float
>
&
data
);
signals:
void
defaultSetpointChanged
(
float
);
void
toggledSetpointChanged
(
float
);
//
signals:
//
void defaultSetpointChanged(float);
//
void toggledSetpointChanged(float);
protected
slots
:
void
setDefault
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment