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
d32650bf
Commit
d32650bf
authored
Feb 12, 2014
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new waypoints based on the UAV airframe type
parent
e53822a0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
1 deletion
+50
-1
MockUAS.h
src/qgcunittest/MockUAS.h
+3
-0
UAS.cc
src/uas/UAS.cc
+26
-0
UAS.h
src/uas/UAS.h
+3
-0
UASInterface.h
src/uas/UASInterface.h
+8
-1
WaypointList.cc
src/ui/WaypointList.cc
+10
-0
No files found.
src/qgcunittest/MockUAS.h
View file @
d32650bf
...
...
@@ -168,6 +168,9 @@ public slots:
virtual
void
sendHilGps
(
quint64
time_us
,
double
lat
,
double
lon
,
double
alt
,
int
fix_type
,
float
eph
,
float
epv
,
float
vel
,
float
vn
,
float
ve
,
float
vd
,
float
cog
,
int
satellites
)
{
Q_UNUSED
(
time_us
);
Q_UNUSED
(
lat
);
Q_UNUSED
(
lon
);
Q_UNUSED
(
alt
);
Q_UNUSED
(
fix_type
);
Q_UNUSED
(
eph
);
Q_UNUSED
(
epv
);
Q_UNUSED
(
vel
);
Q_UNUSED
(
vn
);
Q_UNUSED
(
ve
);
Q_UNUSED
(
vd
);
Q_UNUSED
(
cog
);
Q_UNUSED
(
satellites
);
Q_ASSERT
(
false
);
};
virtual
bool
isRotaryWing
()
{
Q_ASSERT
(
false
);
return
false
;
}
virtual
bool
isFixedWing
()
{
Q_ASSERT
(
false
);
return
false
;
}
private:
int
_systemType
;
int
_systemId
;
...
...
src/uas/UAS.cc
View file @
d32650bf
...
...
@@ -2178,6 +2178,32 @@ void UAS::readParametersFromStorage()
sendMessage
(
msg
);
}
bool
UAS
::
isRotaryWing
()
{
switch
(
airframe
)
{
case
MAV_TYPE_QUADROTOR
:
/* fallthrough */
case
MAV_TYPE_COAXIAL
:
case
MAV_TYPE_HELICOPTER
:
case
MAV_TYPE_HEXAROTOR
:
case
MAV_TYPE_OCTOROTOR
:
case
MAV_TYPE_TRICOPTER
:
return
true
;
default:
return
false
;
}
}
bool
UAS
::
isFixedWing
()
{
switch
(
airframe
)
{
case
MAV_TYPE_FIXED_WING
:
return
true
;
default:
return
false
;
}
}
/**
* @param rate The update rate in Hz the message should be sent
*/
...
...
src/uas/UAS.h
View file @
d32650bf
...
...
@@ -306,6 +306,9 @@ public:
return
nedAttGlobalOffset
;
}
bool
isRotaryWing
();
bool
isFixedWing
();
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
px
::
GLOverlay
getOverlay
()
{
...
...
src/uas/UASInterface.h
View file @
d32650bf
...
...
@@ -267,6 +267,9 @@ public:
*/
virtual
QList
<
QAction
*>
getActions
()
const
=
0
;
static
const
unsigned
int
WAYPOINT_RADIUS_DEFAULT_FIXED_WING
=
25
;
static
const
unsigned
int
WAYPOINT_RADIUS_DEFAULT_ROTARY_WING
=
5
;
public
slots
:
/** @brief Set a new name for the system */
...
...
@@ -376,6 +379,11 @@ public slots:
virtual
void
startGyroscopeCalibration
()
=
0
;
virtual
void
startPressureCalibration
()
=
0
;
/** @brief Return if this a rotary wing */
virtual
bool
isRotaryWing
()
=
0
;
/** @brief Return if this is a fixed wing */
virtual
bool
isFixedWing
()
=
0
;
/** @brief Set the current battery type and voltages */
virtual
void
setBatterySpecs
(
const
QString
&
specs
)
=
0
;
/** @brief Get the current battery type and specs */
...
...
@@ -393,7 +401,6 @@ public slots:
/** @brief Send raw GPS for sensor HIL */
virtual
void
sendHilGps
(
quint64
time_us
,
double
lat
,
double
lon
,
double
alt
,
int
fix_type
,
float
eph
,
float
epv
,
float
vel
,
float
vn
,
float
ve
,
float
vd
,
float
cog
,
int
satellites
)
=
0
;
protected:
QColor
color
;
...
...
src/ui/WaypointList.cc
View file @
d32650bf
...
...
@@ -269,6 +269,16 @@ void WaypointList::addEditable(bool onCurrentPosition)
// Create waypoint with last frame
Waypoint
*
last
=
waypoints
.
last
();
wp
=
WPM
->
createWaypoint
();
if
(
uas
)
{
if
(
uas
->
isRotaryWing
())
{
wp
->
setAcceptanceRadius
(
UASInterface
::
WAYPOINT_RADIUS_DEFAULT_FIXED_WING
);
}
else
if
(
uas
->
isFixedWing
())
{
wp
->
setAcceptanceRadius
(
UASInterface
::
WAYPOINT_RADIUS_DEFAULT_ROTARY_WING
);
}
}
// wp->blockSignals(true);
MAV_FRAME
frame
=
(
MAV_FRAME
)
last
->
getFrame
();
wp
->
setFrame
(
frame
);
...
...
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