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
fb7d8413
Commit
fb7d8413
authored
Aug 17, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'new_state_machine_modes' of
https://github.com/DrTon/qgroundcontrol
into config
parents
c5bed07a
8541598f
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
209 additions
and
200 deletions
+209
-200
UAS.cc
src/uas/UAS.cc
+69
-99
UAS.h
src/uas/UAS.h
+3
-6
UASInterface.h
src/uas/UASInterface.h
+1
-1
UASControlWidget.cc
src/ui/uas/UASControlWidget.cc
+114
-88
UASControlWidget.h
src/ui/uas/UASControlWidget.h
+22
-6
No files found.
src/uas/UAS.cc
View file @
fb7d8413
This diff is collapsed.
Click to expand it.
src/uas/UAS.h
View file @
fb7d8413
...
...
@@ -69,7 +69,7 @@ public:
/** @brief Get short mode */
const
QString
&
getShortMode
()
const
;
/** @brief Translate from mode id to text */
static
QString
getShortModeTextFor
(
int
id
);
static
QString
getShortModeTextFor
(
uint8_t
base_mode
,
uint32_t
custom_mode
,
int
autopilot
);
/** @brief Translate from mode id to audio text */
static
QString
getAudioModeTextFor
(
int
id
);
/** @brief Get the unique system id */
...
...
@@ -362,9 +362,8 @@ protected: //COMMENTS FOR TEST UNIT
int
airframe
;
///< The airframe type
int
autopilot
;
///< Type of the Autopilot: -1: None, 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM
bool
systemIsArmed
;
///< If the system is armed
uint8_t
mode
;
///< The current mode of the MAV
uint8_t
base_
mode
;
///< The current mode of the MAV
uint32_t
custom_mode
;
///< The current mode of the MAV
uint32_t
navMode
;
///< The current navigation mode of the MAV
int
status
;
///< The current status of the MAV
QString
shortModeText
;
///< Short textual mode description
QString
shortStateText
;
///< Short textual state description
...
...
@@ -506,8 +505,6 @@ public:
float
getChargeLevel
();
/** @brief Get the human-readable status message for this code */
void
getStatusForCode
(
int
statusCode
,
QString
&
uasState
,
QString
&
stateDescription
);
/** @brief Get the human-readable navigation mode translation for this mode */
QString
getNavModeText
(
int
mode
);
/** @brief Check if vehicle is in autonomous mode */
bool
isAuto
();
/** @brief Check if vehicle is armed */
...
...
@@ -834,7 +831,7 @@ public slots:
void
setSelected
();
/** @brief Set current mode of operation, e.g. auto or manual */
void
setMode
(
int
m
ode
);
void
setMode
(
uint8_t
newBaseMode
,
uint32_t
newCustomM
ode
);
/** @brief Request all parameters */
void
requestParameters
();
...
...
src/uas/UASInterface.h
View file @
fb7d8413
...
...
@@ -295,7 +295,7 @@ public slots:
/** @brief Start/continue the current robot action */
virtual
void
go
()
=
0
;
/** @brief Set the current mode of operation */
virtual
void
setMode
(
int
m
ode
)
=
0
;
virtual
void
setMode
(
uint8_t
newBaseMode
,
uint32_t
newCustomM
ode
)
=
0
;
/** Stops the robot system. If it is an MAV, the robot starts the emergency landing procedure **/
virtual
void
emergencySTOP
()
=
0
;
/** Kills the robot. All systems are immediately shut down (e.g. the main power line is cut). This might lead to a crash **/
...
...
src/ui/uas/UASControlWidget.cc
View file @
fb7d8413
This diff is collapsed.
Click to expand it.
src/ui/uas/UASControlWidget.h
View file @
fb7d8413
...
...
@@ -39,6 +39,18 @@ This file is part of the QGROUNDCONTROL project
#include <ui_UASControl.h>
#include <UASInterface.h>
enum
PX4_CUSTOM_MODE
{
PX4_CUSTOM_MODE_MANUAL
=
1
,
PX4_CUSTOM_MODE_SEATBELT
,
PX4_CUSTOM_MODE_EASY
,
PX4_CUSTOM_MODE_AUTO
};
struct
full_mode_s
{
uint8_t
baseMode
;
uint32_t
customMode
;
};
/**
* @brief Widget controlling one MAV
*/
...
...
@@ -51,8 +63,10 @@ public:
~
UASControlWidget
();
public
slots
:
/** @brief Update modes list for selected system */
void
updateModesList
();
/** @brief Set the system this widget controls */
void
setUAS
(
UASInterface
*
uas
);
void
setUAS
(
UASInterface
*
uas
ID
);
/** @brief Trigger next context action */
void
cycleContextButton
();
/** @brief Set the operation mode of the MAV */
...
...
@@ -60,11 +74,11 @@ public slots:
/** @brief Transmit the operation mode */
void
transmitMode
();
/** @brief Update the mode */
void
updateMode
(
int
uas
,
QString
mode
,
QString
description
);
void
updateMode
(
int
uas
ID
,
QString
mode
,
QString
description
);
/** @brief Update state */
void
updateState
(
int
state
);
/** @brief Update internal state machine */
void
update
Statemachine
();
void
update
ArmText
();
signals:
void
changedMode
(
int
);
...
...
@@ -75,9 +89,11 @@ protected slots:
void
setBackgroundColor
(
QColor
color
);
protected:
int
uas
;
///< Reference to the current uas
unsigned
int
uasMode
;
///< Current uas mode
bool
engineOn
;
///< Engine state
int
uasID
;
///< Reference to the current uas
struct
full_mode_s
*
modesList
;
///< Modes list for the current UAS
int
modesNum
;
///< Number of modes in list for the current UAS
int
modeIdx
;
///< Current uas mode index
bool
armed
;
///< Engine state
private:
Ui
::
uasControl
ui
;
...
...
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