Commit 190cf9fe authored by Valentin Platzgummer's avatar Valentin Platzgummer

WimaController MissionController WimaDataContainer WimaPlanData WimaPlaner...

WimaController MissionController WimaDataContainer WimaPlanData WimaPlaner reset to ae16d99f, and centering of flight map after mission upload (wima menu) improved (centering only if map not centered to vehicle)
parent a5f08c29
,valentin,rick,12.02.2020 15:33,file:///home/valentin/.config/libreoffice/4;
\ No newline at end of file
This diff is collapsed.
......@@ -22,7 +22,7 @@
\BOOKMARK [3][-]{subsubsection.3.4.10}{Circular Survey}{subsection.3.4}% 22
\BOOKMARK [3][-]{subsubsection.3.4.11}{How to synchronize Data with Flight View}{subsection.3.4}% 23
\BOOKMARK [3][-]{subsubsection.3.4.12}{Editing Flight Plans}{subsection.3.4}% 24
\BOOKMARK [2][-]{subsection.3.5}{WiMA Flight View and WiMA Menu}{section.3}% 25
\BOOKMARK [2][-]{subsection.3.5}{Flight View and WiMA Menu}{section.3}% 25
\BOOKMARK [3][-]{subsubsection.3.5.1}{How to synchronize a Flight Plan with the WiMA Menu}{subsection.3.5}% 26
\BOOKMARK [3][-]{subsubsection.3.5.2}{What's the Mission Section and how to use it}{subsection.3.5}% 27
\BOOKMARK [3][-]{subsubsection.3.5.3}{How to show the Mission Items}{subsection.3.5}% 28
......@@ -34,14 +34,14 @@
\BOOKMARK [3][-]{subsubsection.3.5.9}{What are the Go Reverse and Go Forward buttons for}{subsection.3.5}% 34
\BOOKMARK [3][-]{subsubsection.3.5.10}{What is the Reset Phase button for}{subsection.3.5}% 35
\BOOKMARK [3][-]{subsubsection.3.5.11}{How to change Mission Flight Speed}{subsection.3.5}% 36
\BOOKMARK [3][-]{subsubsection.3.5.12}{How to change AaR Speed}{subsection.3.5}% 37
\BOOKMARK [3][-]{subsubsection.3.5.12}{How to change AaR Flight Speed}{subsection.3.5}% 37
\BOOKMARK [3][-]{subsubsection.3.5.13}{How to change Altitude}{subsection.3.5}% 38
\BOOKMARK [2][-]{subsection.3.6}{Can I invert/reverse a Phase}{section.3}% 39
\BOOKMARK [3][-]{subsubsection.3.6.1}{What's the Vehicle Section and how to use it}{subsection.3.6}% 40
\BOOKMARK [3][-]{subsubsection.3.6.2}{How to upload and clear mission}{subsection.3.6}% 41
\BOOKMARK [3][-]{subsubsection.3.6.3}{What's Smart Return to Launch}{subsection.3.6}% 42
\BOOKMARK [3][-]{subsubsection.3.6.4}{How to configure Smart Return to Launch on low Battery.}{subsection.3.6}% 43
\BOOKMARK [3][-]{subsubsection.3.6.5}{What's the Statistics Section and how to use it}{subsection.3.6}% 44
\BOOKMARK [3][-]{subsubsection.3.6.6}{I can't find the WiMA Menu}{subsection.3.6}% 45
\BOOKMARK [3][-]{subsubsection.3.5.14}{Can I invert/reverse a Phase}{subsection.3.5}% 39
\BOOKMARK [3][-]{subsubsection.3.5.15}{What's the Vehicle Section and how to use it}{subsection.3.5}% 40
\BOOKMARK [3][-]{subsubsection.3.5.16}{How to upload and clear mission}{subsection.3.5}% 41
\BOOKMARK [3][-]{subsubsection.3.5.17}{What's Smart Return to Launch}{subsection.3.5}% 42
\BOOKMARK [3][-]{subsubsection.3.5.18}{How to configure Smart Return to Launch on low Battery.}{subsection.3.5}% 43
\BOOKMARK [3][-]{subsubsection.3.5.19}{What's the Statistics Section and how to use it}{subsection.3.5}% 44
\BOOKMARK [3][-]{subsubsection.3.5.20}{I can't find the WiMA Menu}{subsection.3.5}% 45
\BOOKMARK [1][-]{section.4}{Useful third party Software}{}% 46
\BOOKMARK [2][-]{subsection.4.1}{ArduPilot Simulator}{section.4}% 47
No preview for this file type
No preview for this file type
......@@ -33,6 +33,41 @@
\maketitle
\newpage
\begin{minipage}[t]{0.5\textwidth}
\noindent © 2020 TU Wien. All rights reserved.
\noindent TU Wien, ITC 389, Gusshausstrasse 25 / 389
\noindent Phone: 00 43 58801 – 389211
\noindent Mail: valentin.platzgummer@tuwien.ac.at
\vspace{5mm}
\end{minipage}
\newline
\noindent \textbf{Trademarks} \newline \noindent
All other trademarks or registered trademarks are the property of their respective owners.
Disclaimer
The information provided in this document is provided "as is" without warranty of any kind. TU Wien / ITC E389 disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall TU Wien / ITC E389 be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if TU Wien / ITC E389 or its suppliers have been advised of the possibility of such damages. \newline
\noindent \textbf{Document Lifetime} \newline \noindent
TU Wien may occasionally update online documentation between releases of the related software. Consequently, if this document was not downloaded recently, it may not contain the most up-to-date information. Please refer to \url{http://www.nt.tuwien.ac.at} for the most current information.
From the Web site, you may also download and refresh this document if it has been updated, as indicated by a change in this date: 2020. \newline
\noindent \textbf{Where to get help } \newline \noindent
TU Wien support, product, and licensing information can be obtained as follows.  \newline
\noindent \textbf{Product information} — Documentation, release notes, software updates, and information about TU Wien / ITC E389 products, licensing, and service, are at TU Wien / ITC E389 website at: \url{http://www.nt.tuwien.ac.at} \newline
\noindent \textbf{Technical support} — Go to http://www.[website].com and select Support. On the Support page, you will see several options, including one for making a service request. Note that to open a service request, you must have a valid support agreement. \newline
\noindent \textbf{Your comments } \newline \noindent
Your suggestions will help us continue to improve the accuracy, organization, and overall quality of the user publications. Please send your opinion of this document to: 
\href{mailto:Documentation@[Company Name].com}{Documentation@[Company Name].com}
If you have issues, comments, or questions about specific information or procedures, please include the title and, if available, the part number, the revision, the page numbers, and any other details that will help us locate the subject that you are addressing.
\newpage
\tableofcontents
\newpage
\section{Introduction}
......@@ -274,7 +309,7 @@ To reduce calculation effort, the maximum number of way-points can be set using
To synchronize the generated flight plan with the \wima flight view (see \cref{sec:wimaFlightView}) press the \verb|Sync WiMA| button in the upper right corner (see \cref{fig:syncWima}). The button will be visible only if a valid flight plan was generated and flash if data is not synchronized with the \wima flight view.
\subsubsection{Editing Flight Plans}
The generated flight plan can be edited in the same way as it would be done inside the standard plan view using the mission tool strip (see \cref{fig:wimaViewMissionToolStrip}). After editing, the flight plan can be saved (see \cref{sec:savingLoadingWima}) or synchronized with \wima flight view (see \cref{sec:syncWima}).
\subsection{\wima Flight View and \wima Menu}
\subsection{Flight View and \wima Menu}
\label{sec:wimaFlightView}
The \wima flight view extends the \qgc flight view by the \wima menu, which offers some useful tools like flight plan partitioning, smart return to launch, fast speed changing etc. By default the \wima menu is visible inside the flight view (see \cref{fig:wimaMenu}). The menu can be hidden using the \verb|disable WiMA| slider at it's top. A slider showing the text \verb|enable WiMA| will remain a few seconds at the lower left corner of the flight view befor vanishing. Hovering the mouse at the lower left corner will make the slider visible again.
\begin{figure*}
......@@ -349,11 +384,11 @@ The \verb|Go Forward| or \verb|Go Reverse| buttons are used to proceed to the ne
The reset button sets the start way-point to the first or last mission
\subsubsection{How to change Mission Flight Speed}
The mission flight speed can be changed by altering the value of the \verb|Mission Speed| input box (see \cref{fig:missionSection}). This affects measurement points only. The AaR path way-point speed can be altered as well (see the following section).
\subsubsection{How to change AaR Speed}
The AaR (see \cref{sec:AaR}) flight speed can be changed by altering the value of the \verb|AaR Speed| input box (see \cref{fig:missionSection}). This affects AaR path way-points only. The measurement way-point speed can be altered as well (see the previous section).
\subsubsection{How to change AaR Flight Speed}\label{sec:AaRSpeed}
The AaR (see \cref{sec:AaR}) flight speed can be changed by altering the value of the \verb|AaR Speed| input box (see \cref{fig:missionSection}). This affects AaR path way-points only. The measurement way-point speed can be altered as well (see the previous section). This speed will also be used for smart RTL (see \cref{sec:SRTL}).
\subsubsection{How to change Altitude}
The Altitude can be changed by altering the value of the \verb|Altitude| input box (see \cref{fig:missionSection}). This value affects AaR path and measurement points.
\subsection{Can I invert/reverse a Phase}
\subsubsection{Can I invert/reverse a Phase}
\label{sec:invert}
A phase can be inverted by checking the \verb|Invert Phase| check box (see. \cref{fig:missionSection}).
\subsubsection{What's the Vehicle Section and how to use it}
......@@ -363,7 +398,7 @@ Missions can be uploaded and clear using the \verb|Upload| and \verb|Remove| but
\subsubsection{What's Smart Return to Launch}
\label{sec:SRTL}
Most return to launch (RTL) implementations choose the direct way from the vehicles current to it's takeoff position as a return path. \wima's smart RTL algorithms chooses a return path based on the save area defined by the user (see \cref{sec:wimaAreas}). A smart RTL can be triggered by pressing the \verb|Smart RTL| button. As a security measure pressing this button the user will asked to confirm the action (see \cref{fig:smartRTLconfirmStart}). After confirmation the vehicle will be paused at it's current position and a return path will be displayed. Again the user is asked for confirmation (see \cref{fig:smartRTLconfirmExecute}). On success the return path will be uploaded and executed.
If configured (see \cref{sec:configSRTL}) a smart RTL will be triggered on low battery voltage. The confirmation procedure is the same as described above.
If configured (see \cref{sec:configSRTL}) a smart RTL will be triggered on low battery voltage. The confirmation procedure is the same. The vehicle will return with the speed defined inside the \verb|AaR Speed| input box (see \cref{sec:AaRSpeed}).
\begin{figure*}
\centering
\vspace{-5pt}
......@@ -380,14 +415,14 @@ If configured (see \cref{sec:configSRTL}) a smart RTL will be triggered on low b
\label{fig:smartRTLconfirmExecute}
\end{subfigure}
\caption{Confirmation process of a smart RTL.}
\vspace{-15pt}
\vspace{-5pt}
\end{figure*}
\subsubsection{How to configure Smart Return to Launch on low Battery.}
\label{sec:configSRTL}
The smart RTL on low battery can be configured under general settings (see. \cref{fig:smartRTLconfig}).
\begin{figure*}
\centering
\vspace{-5pt}
\vspace{0pt}
\begin{subfigure}[t]{0.49\textwidth}
\centering
\includegraphics[width=0.3\textwidth]{pics/qgcSettings}
......@@ -409,13 +444,13 @@ The smart RTL on low battery can be configured under general settings (see. \cre
\end{subfigure}
\caption{How to configure \wima smart RTL.}
\label{fig:smartRTLconfig}
\vspace{-15pt}
\vspace{-5pt}
\end{figure*}
\subsubsection{What's the Statistics Section and how to use it}
The statistics section is the last section of the \wima menu (see \cref{fig:statisticsSection}). It shows the length of the current mission (phase) and the estimated flight time, based on the mission speed.
\begin{figure*}[ht!]
\centering
\vspace{-5pt}
\vspace{0pt}
\begin{subfigure}[t]{0.3\textwidth}
\includegraphics[width=0.95\textwidth]{pics/missionSection}
\centering
......@@ -435,7 +470,7 @@ The statistics section is the last section of the \wima menu (see \cref{fig:stat
\label{fig:statisticsSection}
\end{subfigure}
\caption{The different sections of the \wima menu.}
\vspace{-15pt}
\vspace{-5pt}
\end{figure*}
\subsubsection{I can't find the \wima Menu}
See the introduction of \cref{sec:wimaFlightView}.
......@@ -461,11 +496,9 @@ The simulator is launched by a Python script, thus Python must be installed on y
\begin{shaded*}
\begin{verbatim}
./Tools/autotest/sim_vehicle.py -v ArduCopter
\end{verbatim}
\end{verbatim}
\end{shaded*}
Thereby the \verb|-v| option specifies the vehicle type. The \verb|-l| and \verb|-L| option can be used to define a custom start location. The \verb|-S| option increases the simulation speed. See the \verb|sim_vehicle.py --help| option for further information.
After launching, the vehicle should appear inside \qgc.
On success the vehicle should appear inside \qgc. The \verb|-v| option specifies the vehicle type. The \verb|-l| and \verb|-L| option can be used to define a custom start location. With the \verb|-L| option predefined locations inside \verb|ardupilot_root/Tools/autotest/locations.txt| can be used. \verb|-S| option increases the simulation speed. See the \verb|sim_vehicle.py --help| option for further information.
......
\contentsline {section}{\numberline {1}Introduction}{4}{section.1}
\contentsline {subsection}{\numberline {1.1}Purpose}{4}{subsection.1.1}
\contentsline {subsection}{\numberline {1.2}Scope}{4}{subsection.1.2}
\contentsline {subsection}{\numberline {1.3}How to use this Guide}{4}{subsection.1.3}
\contentsline {section}{\numberline {2}System Description}{4}{section.2}
\contentsline {subsection}{\numberline {2.1}Key Features}{4}{subsection.2.1}
\contentsline {subsection}{\numberline {2.2}Inventory}{4}{subsection.2.2}
\contentsline {section}{\numberline {3}Menus and Instructions}{5}{section.3}
\contentsline {subsection}{\numberline {3.1}Warnings}{5}{subsection.3.1}
\contentsline {subsection}{\numberline {3.2}Hints}{5}{subsection.3.2}
\contentsline {subsection}{\numberline {3.3}Brief Summary}{5}{subsection.3.3}
\contentsline {subsection}{\numberline {3.4}WiMA\xspace Plan View}{6}{subsection.3.4}
\contentsline {subsubsection}{\numberline {3.4.1}WiMA Tool Strip}{6}{subsubsection.3.4.1}
\contentsline {subsubsection}{\numberline {3.4.2}WiMA Areas}{6}{subsubsection.3.4.2}
\contentsline {subsubsection}{\numberline {3.4.3}Saving and Loading WiMA\xspace Missions}{7}{subsubsection.3.4.3}
\contentsline {subsubsection}{\numberline {3.4.4}Clearing WiMA\xspace Missions}{9}{subsubsection.3.4.4}
\contentsline {subsubsection}{\numberline {3.4.5}Uploading, Downloading and Clearing vehicle Missions}{9}{subsubsection.3.4.5}
\contentsline {subsubsection}{\numberline {3.4.6}Inserting WiMA\xspace Areas}{9}{subsubsection.3.4.6}
\contentsline {subsubsection}{\numberline {3.4.7}Generating a WiMA\xspace flight plan}{9}{subsubsection.3.4.7}
\contentsline {subsubsection}{\numberline {3.4.8}Navigating the Map}{9}{subsubsection.3.4.8}
\contentsline {subsubsection}{\numberline {3.4.9}How to display the generated flight plan}{9}{subsubsection.3.4.9}
\contentsline {subsubsection}{\numberline {3.4.10}Circular Survey}{10}{subsubsection.3.4.10}
\contentsline {subsubsection}{\numberline {3.4.11}How to synchronize Data with Flight View}{11}{subsubsection.3.4.11}
\contentsline {subsubsection}{\numberline {3.4.12}Editing Flight Plans}{11}{subsubsection.3.4.12}
\contentsline {subsection}{\numberline {3.5}WiMA\xspace Flight View and WiMA\xspace Menu}{11}{subsection.3.5}
\contentsline {subsubsection}{\numberline {3.5.1}How to synchronize a Flight Plan with the WiMA\xspace Menu}{11}{subsubsection.3.5.1}
\contentsline {subsubsection}{\numberline {3.5.2}What's the Mission Section and how to use it}{11}{subsubsection.3.5.2}
\contentsline {subsubsection}{\numberline {3.5.3}How to show the Mission Items}{12}{subsubsection.3.5.3}
\contentsline {subsubsection}{\numberline {3.5.4}How to show the current Phase}{12}{subsubsection.3.5.4}
\contentsline {subsubsection}{\numberline {3.5.5}What's the AaR Path}{13}{subsubsection.3.5.5}
\contentsline {subsubsection}{\numberline {3.5.6}Whats a Mission Phase}{13}{subsubsection.3.5.6}
\contentsline {subsubsection}{\numberline {3.5.7}How to partition a flight plan}{13}{subsubsection.3.5.7}
\contentsline {subsubsection}{\numberline {3.5.8}What's the Overlap}{13}{subsubsection.3.5.8}
\contentsline {subsubsection}{\numberline {3.5.9}What are the Go Reverse and Go Forward buttons for}{13}{subsubsection.3.5.9}
\contentsline {subsubsection}{\numberline {3.5.10}What is the Reset Phase button for}{13}{subsubsection.3.5.10}
\contentsline {subsubsection}{\numberline {3.5.11}How to change Mission Flight Speed}{13}{subsubsection.3.5.11}
\contentsline {subsubsection}{\numberline {3.5.12}How to change AaR Speed}{14}{subsubsection.3.5.12}
\contentsline {subsubsection}{\numberline {3.5.13}How to change Altitude}{14}{subsubsection.3.5.13}
\contentsline {subsection}{\numberline {3.6}Can I invert/reverse a Phase}{14}{subsection.3.6}
\contentsline {subsubsection}{\numberline {3.6.1}What's the Vehicle Section and how to use it}{14}{subsubsection.3.6.1}
\contentsline {subsubsection}{\numberline {3.6.2}How to upload and clear mission}{14}{subsubsection.3.6.2}
\contentsline {subsubsection}{\numberline {3.6.3}What's Smart Return to Launch}{14}{subsubsection.3.6.3}
\contentsline {subsubsection}{\numberline {3.6.4}How to configure Smart Return to Launch on low Battery.}{15}{subsubsection.3.6.4}
\contentsline {subsubsection}{\numberline {3.6.5}What's the Statistics Section and how to use it}{15}{subsubsection.3.6.5}
\contentsline {subsubsection}{\numberline {3.6.6}I can't find the WiMA\xspace Menu}{15}{subsubsection.3.6.6}
\contentsline {section}{\numberline {4}Useful third party Software}{16}{section.4}
\contentsline {subsection}{\numberline {4.1}ArduPilot Simulator}{16}{subsection.4.1}
\contentsline {section}{\numberline {1}Introduction}{5}{section.1}
\contentsline {subsection}{\numberline {1.1}Purpose}{5}{subsection.1.1}
\contentsline {subsection}{\numberline {1.2}Scope}{5}{subsection.1.2}
\contentsline {subsection}{\numberline {1.3}How to use this Guide}{5}{subsection.1.3}
\contentsline {section}{\numberline {2}System Description}{5}{section.2}
\contentsline {subsection}{\numberline {2.1}Key Features}{5}{subsection.2.1}
\contentsline {subsection}{\numberline {2.2}Inventory}{5}{subsection.2.2}
\contentsline {section}{\numberline {3}Menus and Instructions}{6}{section.3}
\contentsline {subsection}{\numberline {3.1}Warnings}{6}{subsection.3.1}
\contentsline {subsection}{\numberline {3.2}Hints}{6}{subsection.3.2}
\contentsline {subsection}{\numberline {3.3}Brief Summary}{6}{subsection.3.3}
\contentsline {subsection}{\numberline {3.4}WiMA\xspace Plan View}{7}{subsection.3.4}
\contentsline {subsubsection}{\numberline {3.4.1}WiMA Tool Strip}{7}{subsubsection.3.4.1}
\contentsline {subsubsection}{\numberline {3.4.2}WiMA Areas}{7}{subsubsection.3.4.2}
\contentsline {subsubsection}{\numberline {3.4.3}Saving and Loading WiMA\xspace Missions}{8}{subsubsection.3.4.3}
\contentsline {subsubsection}{\numberline {3.4.4}Clearing WiMA\xspace Missions}{10}{subsubsection.3.4.4}
\contentsline {subsubsection}{\numberline {3.4.5}Uploading, Downloading and Clearing vehicle Missions}{10}{subsubsection.3.4.5}
\contentsline {subsubsection}{\numberline {3.4.6}Inserting WiMA\xspace Areas}{10}{subsubsection.3.4.6}
\contentsline {subsubsection}{\numberline {3.4.7}Generating a WiMA\xspace flight plan}{10}{subsubsection.3.4.7}
\contentsline {subsubsection}{\numberline {3.4.8}Navigating the Map}{10}{subsubsection.3.4.8}
\contentsline {subsubsection}{\numberline {3.4.9}How to display the generated flight plan}{10}{subsubsection.3.4.9}
\contentsline {subsubsection}{\numberline {3.4.10}Circular Survey}{11}{subsubsection.3.4.10}
\contentsline {subsubsection}{\numberline {3.4.11}How to synchronize Data with Flight View}{12}{subsubsection.3.4.11}
\contentsline {subsubsection}{\numberline {3.4.12}Editing Flight Plans}{12}{subsubsection.3.4.12}
\contentsline {subsection}{\numberline {3.5}Flight View and WiMA\xspace Menu}{12}{subsection.3.5}
\contentsline {subsubsection}{\numberline {3.5.1}How to synchronize a Flight Plan with the WiMA\xspace Menu}{12}{subsubsection.3.5.1}
\contentsline {subsubsection}{\numberline {3.5.2}What's the Mission Section and how to use it}{12}{subsubsection.3.5.2}
\contentsline {subsubsection}{\numberline {3.5.3}How to show the Mission Items}{13}{subsubsection.3.5.3}
\contentsline {subsubsection}{\numberline {3.5.4}How to show the current Phase}{13}{subsubsection.3.5.4}
\contentsline {subsubsection}{\numberline {3.5.5}What's the AaR Path}{14}{subsubsection.3.5.5}
\contentsline {subsubsection}{\numberline {3.5.6}Whats a Mission Phase}{14}{subsubsection.3.5.6}
\contentsline {subsubsection}{\numberline {3.5.7}How to partition a flight plan}{14}{subsubsection.3.5.7}
\contentsline {subsubsection}{\numberline {3.5.8}What's the Overlap}{14}{subsubsection.3.5.8}
\contentsline {subsubsection}{\numberline {3.5.9}What are the Go Reverse and Go Forward buttons for}{14}{subsubsection.3.5.9}
\contentsline {subsubsection}{\numberline {3.5.10}What is the Reset Phase button for}{14}{subsubsection.3.5.10}
\contentsline {subsubsection}{\numberline {3.5.11}How to change Mission Flight Speed}{14}{subsubsection.3.5.11}
\contentsline {subsubsection}{\numberline {3.5.12}How to change AaR Flight Speed}{15}{subsubsection.3.5.12}
\contentsline {subsubsection}{\numberline {3.5.13}How to change Altitude}{15}{subsubsection.3.5.13}
\contentsline {subsubsection}{\numberline {3.5.14}Can I invert/reverse a Phase}{15}{subsubsection.3.5.14}
\contentsline {subsubsection}{\numberline {3.5.15}What's the Vehicle Section and how to use it}{15}{subsubsection.3.5.15}
\contentsline {subsubsection}{\numberline {3.5.16}How to upload and clear mission}{15}{subsubsection.3.5.16}
\contentsline {subsubsection}{\numberline {3.5.17}What's Smart Return to Launch}{15}{subsubsection.3.5.17}
\contentsline {subsubsection}{\numberline {3.5.18}How to configure Smart Return to Launch on low Battery.}{15}{subsubsection.3.5.18}
\contentsline {subsubsection}{\numberline {3.5.19}What's the Statistics Section and how to use it}{15}{subsubsection.3.5.19}
\contentsline {subsubsection}{\numberline {3.5.20}I can't find the WiMA\xspace Menu}{17}{subsubsection.3.5.20}
\contentsline {section}{\numberline {4}Useful third party Software}{18}{section.4}
\contentsline {subsection}{\numberline {4.1}ArduPilot Simulator}{18}{subsection.4.1}
......@@ -178,7 +178,9 @@ FlightMap {
onNewItemsFromVehicle: {
var visualItems = _missionController.visualItems
if (visualItems && visualItems.count !== 1) {
mapFitFunctions.fitMapViewportToMissionItems()
if (recenterNeeded()){
mapFitFunctions.fitMapViewportToMissionItems()
}
firstVehiclePositionReceived = true
}
}
......
......@@ -331,27 +331,6 @@ void MissionController::convertToKMLDocument(QDomDocument& document)
kml.save(document);
}
//QList<QObject *> MissionController::takeVisualItems()
//{
// QList<QObject *> objectList;
// if (_visualItems) {
// _deinitAllVisualItems();
// QList<QObject *> *objectListPt = _visualItems->objectList();
// for (auto object : *objectListPt)
// objectList.append(object);
// _visualItems->clear();
// _visualItems->deleteLater();
// _settingsItem = nullptr;
// _visualItems = new QmlObjectListModel(this);
// _addMissionSettings(_visualItems, false /* addToCenter */);
// _initAllVisualItems();
// setDirty(true);
// _resetMissionFlightStatus();
// }
// return objectList;
//}
void MissionController::sendItemsToVehicle(Vehicle* vehicle, QmlObjectListModel* visualMissionItems)
{
if (vehicle) {
......@@ -430,36 +409,7 @@ int MissionController::insertSimpleMissionItem(const MissionItem &missionItem, i
return newItem->sequenceNumber();
}
int MissionController::insertSimpleMissionItem(const QList<const MissionItem *> &missionItems, int index)
{
SimpleMissionItem *newItem = nullptr;
for (int i = 0; i < missionItems.size(); ++i) {
MissionItem missionItem = *missionItems[i];
newItem = new SimpleMissionItem(_controllerVehicle, _flyView, missionItem, this);
newItem->setSequenceNumber(_nextSequenceNumber());
_initVisualItem(newItem, false /* doResetDirty */);
MAV_CMD takeoffCmd = _controllerVehicle->vtol() ? MAV_CMD_NAV_VTOL_TAKEOFF : MAV_CMD_NAV_TAKEOFF;
if (newItem->command() == takeoffCmd) {
if (!_controllerVehicle->firmwarePlugin()->supportedMissionCommands().contains(takeoffCmd)) {
newItem->setCommand(MAV_CMD_NAV_WAYPOINT);
return -1; // can not add this takeoff command for this vehicle
}
}
if (newItem->specifiesAltitude()) {
newItem->altitude()->setRawValue(missionItem.relativeAltitude());
newItem->setAltitudeMode(QGroundControlQmlGlobal::AltitudeMode::AltitudeModeRelative);
}
newItem->setMissionFlightStatus(_missionFlightStatus);
_visualItems->insert(index + i, newItem);
}
setDirty(false); // must be called, since _initVisualItem(newItem, false /* doResetDirty */) was used
return (newItem != nullptr) ? newItem->sequenceNumber(): -1;
}
/*int MissionController::insertSimpleMissionItem(SimpleMissionItem &missionItem, int i)
int MissionController::insertSimpleMissionItem(SimpleMissionItem &missionItem, int i)
{
int sequenceNumber = _nextSequenceNumber();
SimpleMissionItem * newItem = new SimpleMissionItem(missionItem, _flyView, this);
......@@ -476,7 +426,7 @@ int MissionController::insertSimpleMissionItem(const QList<const MissionItem *>
_visualItems->insert(i, newItem);
return newItem->sequenceNumber();
}*/
}
int MissionController::insertROIMissionItem(QGeoCoordinate coordinate, int i)
{
......@@ -1771,14 +1721,7 @@ void MissionController::_deinitAllVisualItems(void)
void MissionController::_initVisualItem(VisualMissionItem* visualItem)
{
_initVisualItem(visualItem, true);
}
void MissionController::_initVisualItem(VisualMissionItem *visualItem, bool doResetDirty)
{
if (doResetDirty)
setDirty(false); // this is to expensive if called on many visualItems in a row (call setDirty(false) after last _initVisualItem)
setDirty(false);
connect(visualItem, &VisualMissionItem::specifiesCoordinateChanged, this, &MissionController::_recalcWaypointLines);
connect(visualItem, &VisualMissionItem::coordinateHasRelativeAltitudeChanged, this, &MissionController::_recalcWaypointLines);
......
......@@ -114,15 +114,10 @@ public:
/// @return Sequence number for new item
int insertSimpleMissionItem(const MissionItem &missionItem, int i);
/// Add a list of simple mission items to the list
/// @param i: index to insert at
/// @return Sequence number for new item
int insertSimpleMissionItem(const QList<const MissionItem *> &missionItems, int index);
/// Add a new simple mission item to the list
/// @param i: index to insert at
/// @return Sequence number for new item
//int insertSimpleMissionItem(SimpleMissionItem &missionItem, int i);
int insertSimpleMissionItem(SimpleMissionItem &missionItem, int i);
/// Add a new ROI mission item to the list
/// @param i: index to insert at
......@@ -196,7 +191,6 @@ public:
// Property accessors
QmlObjectListModel* visualItems (void) { return _visualItems; }
//QList<QObject *> takeVisualItems (void);
QmlObjectListModel* waypointLines (void) { return &_waypointLines; }
QVariantList waypointPath (void) { return _waypointPath; }
QStringList complexMissionItemNames (void) const;
......@@ -281,7 +275,6 @@ private:
void _initAllVisualItems(void);
void _deinitAllVisualItems(void);
void _initVisualItem(VisualMissionItem* item);
void _initVisualItem(VisualMissionItem* item, bool doResetDirty);
void _deinitVisualItem(VisualMissionItem* item);
void _setupActiveVehicle(Vehicle* activeVehicle, bool forceLoadFromVehicle);
void _calcPrevWaypointValues(double homeAlt, VisualMissionItem* currentItem, VisualMissionItem* prevItem, double* azimuth, double* distance, double* altDifference);
......
This diff is collapsed.
......@@ -2,6 +2,7 @@
WimaDataContainer::WimaDataContainer(QObject *parent)
: QObject (parent)
, _planData (this /* parent */)
{
}
......@@ -14,16 +15,11 @@ WimaDataContainer::WimaDataContainer(QObject *parent)
*
* \sa WimaPlanData
*/
void WimaDataContainer::push(QSharedPointer<const WimaPlanData> planData)
void WimaDataContainer::push(const WimaPlanData &planData)
{
_planData = planData;
auto start = std::chrono::high_resolution_clock::now();
emit newDataAvailable();
qWarning() << "WimaDataContainer::push"
<< std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::high_resolution_clock::now()-start).count()
<< " ms";
}
/*!
......@@ -33,7 +29,7 @@ void WimaDataContainer::push(QSharedPointer<const WimaPlanData> planData)
*
* \sa WimaPlanData
*/
QSharedPointer<const WimaPlanData> WimaDataContainer::pull() const
const WimaPlanData &WimaDataContainer::pull() const
{
return _planData;
}
......
......@@ -18,11 +18,11 @@ signals:
void newDataAvailable(void);
public slots:
void push(QSharedPointer<const WimaPlanData> planData);
QSharedPointer<const WimaPlanData> pull() const;
void push(const WimaPlanData &planData);
const WimaPlanData &pull() const;
private:
QSharedPointer<const WimaPlanData> _planData;
WimaPlanData _planData;
};
......@@ -102,8 +102,10 @@ void WimaPlanData::append(const WimaMeasurementAreaData &areaData)
void WimaPlanData::append(const QList<MissionItem *> &missionItems)
{
for (auto item : missionItems)
_missionItems.append(QSharedPointer<const MissionItem>(item));
for (MissionItem *item : missionItems) {
MissionItem copy = MissionItem(*item, this);
_missionItems.append(copy);
}
}
/*!
......@@ -122,7 +124,7 @@ QList<const WimaAreaData *> WimaPlanData::areaList() const
return _areaList;
}
QList<QSharedPointer<const MissionItem>> WimaPlanData::missionItems() const
QList<MissionItem> WimaPlanData::missionItems() const
{
return _missionItems;
}
......
......@@ -9,7 +9,7 @@
#include "WimaJoinedAreaData.h"
#include "MissionItem.h"
class WimaPlanData : public QObject
class WimaPlanData : QObject
{
Q_OBJECT
public:
......@@ -22,11 +22,11 @@ public:
void append(const WimaServiceAreaData &areaData);
void append(const WimaCorridorData &areaData);
void append(const WimaMeasurementAreaData &areaData);
void append(const QList<MissionItem *> &missionItems);
void append(const QList<MissionItem *> &missionItems);
void clear();
QList<const WimaAreaData *> areaList() const;
QList<QSharedPointer<const MissionItem>> missionItems() const;
QList<MissionItem> missionItems() const;
......@@ -41,7 +41,7 @@ private:
WimaServiceAreaData _serviceArea;
WimaCorridorData _corridor;
WimaMeasurementAreaData _measurementArea;
QList<const WimaAreaData *> _areaList;
QList<const WimaAreaData*> _areaList;
QList<QSharedPointer<const MissionItem>> _missionItems;
QList<MissionItem> _missionItems;
};
 #include "WimaPlaner.h"
#include "WimaPlaner.h"
#include "CircularSurveyComplexItem.h"
......@@ -480,6 +480,7 @@ void WimaPlaner::recalcPolygonInteractivity(int index)
bool WimaPlaner::calcArrivalAndReturnPath()
{
static int counter = 0;
setReadyForSync(false);
// extract old survey data
......@@ -594,6 +595,8 @@ bool WimaPlaner::calcArrivalAndReturnPath()
_missionController->setCurrentPlanViewIndex(missionItems->indexOf(_circularSurvey), false);
setSyncronizedWithControllerFalse();
setReadyForSync(true);
counter++;
qWarning() << "WimaPlaner::calcArrivalAndReturnPath(): " << counter;
return true;
}
......@@ -643,19 +646,15 @@ bool WimaPlaner::recalcJoinedArea()
*/
void WimaPlaner::pushToContainer()
{
auto start = std::chrono::high_resolution_clock::now();
if (_container != nullptr) {
if (!_readyForSync)
return;
_container->push(toPlanData());
WimaPlanData planData = toPlanData();
_container->push(planData);
setSyncronizedWithController(true);
} else {
qWarning("WimaPlaner::uploadToContainer(): no container assigned.");
}
qWarning() << "WimaPlaner::pushToContainer()"
<< std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::high_resolution_clock::now()-start).count()
<< " ms";
}
bool WimaPlaner::calcShortestPath(const QGeoCoordinate &start, const QGeoCoordinate &destination, QVector<QGeoCoordinate> &path)
......@@ -664,12 +663,16 @@ bool WimaPlaner::calcShortestPath(const QGeoCoordinate &start, const QGeoCoordin
using namespace PolygonCalculus;
QVector<QPointF> path2D;
auto startTime = std::chrono::high_resolution_clock::now();
bool retVal = PolygonCalculus::shortestPath(
toQPolygonF(toCartesian2D(_joinedArea.coordinateList(), /*origin*/ start)),
/*start point*/ QPointF(0,0),
/*destination*/ toCartesian2D(destination, start),
/*shortest path*/ path2D);
path.append(toGeo(path2D, /*origin*/ start));
auto duration = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now()-startTime).count();
qWarning() << "WimaPlaner::calcShortestPath: time " << duration << " us";
return retVal;
}
......@@ -700,28 +703,27 @@ void WimaPlaner::setInteractive()
*
* \sa WimaController, WimaPlanData
*/
QSharedPointer<WimaPlanData> WimaPlaner::toPlanData()
WimaPlanData WimaPlaner::toPlanData()
{
//WimaPlanData *data = new WimaPlanData(nullptr);
QSharedPointer<WimaPlanData> planData(new WimaPlanData());
WimaPlanData planData;
// store areas
planData->append(WimaMeasurementAreaData(_measurementArea));
planData->append(WimaServiceAreaData(_serviceArea));
planData->append(WimaCorridorData(_corridor));
planData->append(WimaJoinedAreaData(_joinedArea));
planData.append(WimaMeasurementAreaData(_measurementArea));
planData.append(WimaServiceAreaData(_serviceArea));
planData.append(WimaCorridorData(_corridor));
planData.append(WimaJoinedAreaData(_joinedArea));
// convert mission items to mavlink commands
QObject deleteObject; // used to automatically delete content of rgMissionItems after this function call
QList<MissionItem*> rgMissionItems;
QmlObjectListModel *visualItems = _missionController->visualItems();
MissionController::convertToMissionItems(visualItems, rgMissionItems, nullptr);
for (int i = 0; i <= _arrivalPathLength; ++i)
rgMissionItems.removeFirst();
for (int i = 0; i < _returnPathLength; ++i)
rgMissionItems.removeLast();
QmlObjectListModel visualItemsToCopy;
for (int i = _arrivalPathLength+1; i < visualItems->count()-_returnPathLength; i++)
visualItemsToCopy.append(visualItems->get(i));
MissionController::convertToMissionItems(&visualItemsToCopy, rgMissionItems, &deleteObject);
// store mavlink commands
planData->append(rgMissionItems);
planData.append(rgMissionItems);
return planData;
}
......
......@@ -142,10 +142,10 @@ signals:
void joinedAreaValidChanged();
private:
// Member Functions
QSharedPointer<WimaPlanData> toPlanData ();
void setSyncronizedWithController (bool sync);
void setReadyForSync (bool ready);
void setJoinedAreaValid (bool valid);
WimaPlanData toPlanData();
void setSyncronizedWithController (bool sync);
void setReadyForSync (bool ready);
void setJoinedAreaValid (bool valid);
// Member Variables
PlanMasterController *_masterController;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment