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
b0a54951
Commit
b0a54951
authored
Mar 23, 2017
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only show gimbal yaw if vehicle points to next waypoint
parent
073295bc
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
42 additions
and
4 deletions
+42
-4
ArduCopterFirmwarePlugin.cc
src/FirmwarePlugin/APM/ArduCopterFirmwarePlugin.cc
+10
-0
ArduCopterFirmwarePlugin.h
src/FirmwarePlugin/APM/ArduCopterFirmwarePlugin.h
+1
-0
FirmwarePlugin.cc
src/FirmwarePlugin/FirmwarePlugin.cc
+5
-0
FirmwarePlugin.h
src/FirmwarePlugin/FirmwarePlugin.h
+3
-0
PX4FirmwarePlugin.cc
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
+9
-0
PX4FirmwarePlugin.h
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h
+1
-0
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+0
-1
MissionController.cc
src/MissionManager/MissionController.cc
+6
-3
Vehicle.cc
src/Vehicle/Vehicle.cc
+4
-0
Vehicle.h
src/Vehicle/Vehicle.h
+3
-0
No files found.
src/FirmwarePlugin/APM/ArduCopterFirmwarePlugin.cc
View file @
b0a54951
...
...
@@ -224,3 +224,13 @@ QString ArduCopterFirmwarePlugin::takeControlFlightMode(void)
{
return
QStringLiteral
(
"Stabilize"
);
}
bool
ArduCopterFirmwarePlugin
::
vehicleYawsToNextWaypointInMission
(
const
Vehicle
*
vehicle
)
const
{
if
(
vehicle
->
parameterManager
()
->
parameterExists
(
FactSystem
::
defaultComponentId
,
QStringLiteral
(
"WP_YAW_BEHAVIOR"
)))
{
Fact
*
yawMode
=
vehicle
->
parameterManager
()
->
getParameter
(
FactSystem
::
defaultComponentId
,
QStringLiteral
(
"WP_YAW_BEHAVIOR"
));
return
yawMode
&&
yawMode
->
rawValue
().
toInt
()
!=
0
;
}
return
false
;
}
src/FirmwarePlugin/APM/ArduCopterFirmwarePlugin.h
View file @
b0a54951
...
...
@@ -69,6 +69,7 @@ public:
QString
geoFenceRadiusParam
(
Vehicle
*
vehicle
)
final
;
QString
offlineEditingParamFile
(
Vehicle
*
vehicle
)
final
{
Q_UNUSED
(
vehicle
);
return
QStringLiteral
(
":/FirmwarePlugin/APM/Copter.OfflineEditing.params"
);
}
QString
takeControlFlightMode
(
void
)
final
;
bool
vehicleYawsToNextWaypointInMission
(
const
Vehicle
*
vehicle
)
const
final
;
private:
static
bool
_remapParamNameIntialized
;
...
...
src/FirmwarePlugin/FirmwarePlugin.cc
View file @
b0a54951
...
...
@@ -431,3 +431,8 @@ const QVariantList& FirmwarePlugin::cameraList(const Vehicle* vehicle)
return
_cameraList
;
}
bool
FirmwarePlugin
::
vehicleYawsToNextWaypointInMission
(
const
Vehicle
*
vehicle
)
const
{
return
vehicle
->
multiRotor
()
?
false
:
true
;
}
src/FirmwarePlugin/FirmwarePlugin.h
View file @
b0a54951
...
...
@@ -267,6 +267,9 @@ public:
/// Returns a list of CameraMetaData objects for available cameras on the vehicle.
virtual
const
QVariantList
&
cameraList
(
const
Vehicle
*
vehicle
);
/// @true: When flying a mission the vehicle is always facing towards the next waypoint
virtual
bool
vehicleYawsToNextWaypointInMission
(
const
Vehicle
*
vehicle
)
const
;
// FIXME: Hack workaround for non pluginize FollowMe support
static
const
char
*
px4FollowMeFlightMode
;
...
...
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
View file @
b0a54951
...
...
@@ -498,3 +498,12 @@ QString PX4FirmwarePlugin::takeControlFlightMode(void)
{
return
QString
(
_manualFlightMode
);
}
bool
PX4FirmwarePlugin
::
vehicleYawsToNextWaypointInMission
(
const
Vehicle
*
vehicle
)
const
{
if
(
vehicle
->
parameterManager
()
->
parameterExists
(
FactSystem
::
defaultComponentId
,
QStringLiteral
(
"MIS_YAWMODE"
)))
{
Fact
*
yawMode
=
vehicle
->
parameterManager
()
->
getParameter
(
FactSystem
::
defaultComponentId
,
QStringLiteral
(
"MIS_YAWMODE"
));
return
yawMode
&&
yawMode
->
rawValue
().
toInt
()
==
1
;
}
return
false
;
}
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h
View file @
b0a54951
...
...
@@ -63,6 +63,7 @@ public:
QString
missionFlightMode
(
void
)
override
;
QString
rtlFlightMode
(
void
)
override
;
QString
takeControlFlightMode
(
void
)
override
;
bool
vehicleYawsToNextWaypointInMission
(
const
Vehicle
*
vehicle
)
const
override
;
protected:
typedef
struct
{
...
...
src/MissionEditor/MissionEditor.qml
View file @
b0a54951
...
...
@@ -236,7 +236,6 @@ QGCView {
/// Sets a new current mission item
/// @param sequenceNumber - index for new item, -1 to clear current item
function
setCurrentItem
(
sequenceNumber
)
{
console
.
log
(
"
setCurrentItem
"
,
sequenceNumber
,
_currentMissionIndex
)
if
(
sequenceNumber
!==
_currentMissionIndex
)
{
_currentMissionItem
=
undefined
_currentMissionIndex
=
-
1
...
...
src/MissionManager/MissionController.cc
View file @
b0a54951
...
...
@@ -939,9 +939,12 @@ void MissionController::_recalcMissionFlightStatus()
}
// Look for gimbal change
double
gimbalYaw
=
item
->
specifiedGimbalYaw
();
if
(
!
qIsNaN
(
gimbalYaw
))
{
_missionFlightStatus
.
gimbalYaw
=
gimbalYaw
;
if
(
_activeVehicle
->
vehicleYawsToNextWaypointInMission
())
{
// We current only support gimbal display in this mode
double
gimbalYaw
=
item
->
specifiedGimbalYaw
();
if
(
!
qIsNaN
(
gimbalYaw
))
{
_missionFlightStatus
.
gimbalYaw
=
gimbalYaw
;
}
}
if
(
i
==
0
)
{
...
...
src/Vehicle/Vehicle.cc
View file @
b0a54951
...
...
@@ -2436,6 +2436,10 @@ const QVariantList& Vehicle::cameraList(void) const
return
emptyList
;
}
bool
Vehicle
::
vehicleYawsToNextWaypointInMission
(
void
)
const
{
return
_firmwarePlugin
->
vehicleYawsToNextWaypointInMission
(
this
);
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
...
...
src/Vehicle/Vehicle.h
View file @
b0a54951
...
...
@@ -660,6 +660,9 @@ public:
bool
supportsMissionItemInt
(
void
)
const
{
return
_supportsMissionItemInt
;
}
/// @true: When flying a mission the vehicle is always facing towards the next waypoint
bool
vehicleYawsToNextWaypointInMission
(
void
)
const
;
public
slots
:
/// Sets the firmware plugin instance data associated with this Vehicle. This object will be parented to the Vehicle
/// and destroyed when the vehicle goes away.
...
...
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