mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
Initial commit of pathcompiler stub
This commit is contained in:
parent
f3e3a2f16b
commit
0f526fe67e
@ -19,7 +19,8 @@ HEADERS += opmapplugin.h \
|
||||
# opmap_edit_waypoint_dialog.h \
|
||||
opmap_zoom_slider_widget.h \
|
||||
opmap_statusbar_widget.h \
|
||||
opmap_overlay_widget.h
|
||||
opmap_overlay_widget.h \
|
||||
pathcompiler.h
|
||||
|
||||
SOURCES += opmapplugin.cpp \
|
||||
opmapgadgetwidget.cpp \
|
||||
@ -31,7 +32,8 @@ SOURCES += opmapplugin.cpp \
|
||||
# opmap_edit_waypoint_dialog.cpp \
|
||||
opmap_zoom_slider_widget.cpp \
|
||||
opmap_statusbar_widget.cpp \
|
||||
opmap_overlay_widget.cpp
|
||||
opmap_overlay_widget.cpp \
|
||||
pathcompiler.cpp
|
||||
|
||||
OTHER_FILES += OPMapGadget.pluginspec
|
||||
|
||||
@ -44,3 +46,5 @@ FORMS += opmapgadgetoptionspage.ui \
|
||||
opmap_overlay_widget.ui
|
||||
|
||||
RESOURCES += opmap.qrc
|
||||
|
||||
|
||||
|
32
ground/openpilotgcs/src/plugins/opmap/pathcompiler.cpp
Normal file
32
ground/openpilotgcs/src/plugins/opmap/pathcompiler.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file pathcompiler.h
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
||||
* @addtogroup GCSPlugins GCS Plugins
|
||||
* @{
|
||||
* @addtogroup OPMapPlugin OpenPilot Map Plugin
|
||||
* @{
|
||||
* @brief The OpenPilot Map plugin
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "pathcompiler.h"
|
||||
|
||||
PathCompiler::PathCompiler(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
}
|
97
ground/openpilotgcs/src/plugins/opmap/pathcompiler.h
Normal file
97
ground/openpilotgcs/src/plugins/opmap/pathcompiler.h
Normal file
@ -0,0 +1,97 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file pathcompiler.h
|
||||
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
||||
* @addtogroup GCSPlugins GCS Plugins
|
||||
* @{
|
||||
* @addtogroup OPMapPlugin OpenPilot Map Plugin
|
||||
* @{
|
||||
* @brief The OpenPilot Map plugin
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef PATHCOMPILER_H
|
||||
#define PATHCOMPILER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <uavobject.h>
|
||||
|
||||
/**
|
||||
* This class is a two way adapter between a visualization of a path and the
|
||||
* UAVObject representation on the flight controller. It also can support multiple
|
||||
* ways of converting a path from what the user clicked to the underlying representation
|
||||
* to achieve the desired end flight trajectory
|
||||
*/
|
||||
class PathCompiler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PathCompiler(QObject *parent = 0);
|
||||
|
||||
//! This method opens a dialog (if filename is null) and saves the path
|
||||
int savePath(QString filename = null);
|
||||
|
||||
//! This method opens a dialog (if filename is null) and loads the path
|
||||
int loadPath(QString filename = null);
|
||||
|
||||
//! Waypoint representation that is exchanged between visualization
|
||||
struct waypoint {
|
||||
float latitude;
|
||||
float longitude;
|
||||
};
|
||||
|
||||
signals:
|
||||
/**
|
||||
* Indicates something changed the waypoints and the map should
|
||||
* update the display
|
||||
*/
|
||||
void visualizationChanged(QList<struct PathCompiler::waypoint>);
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* These are slots that the visualization can call to manipulate the path.
|
||||
* It is an important design detail that the visualiation _not_ attempt to maintain
|
||||
* the list of waypoints itself. This starts the slippery of moving the path logic
|
||||
* into the view.
|
||||
*/
|
||||
|
||||
/**
|
||||
* add a waypoint
|
||||
* @param waypoint the new waypoint to add
|
||||
* @param position which position to insert it to, defaults to end
|
||||
*/
|
||||
void doAddWaypoint(struct PathCompiler::waypoint, int position = -1);
|
||||
|
||||
/**
|
||||
* Delete a waypoint
|
||||
* @param index which waypoint to delete
|
||||
*/
|
||||
void doDelWaypoint(int index);
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* These are slots that the UAV can call to update the path.
|
||||
*/
|
||||
|
||||
/**
|
||||
* When the UAV waypoints change trigger the pathcompiler to
|
||||
* get the latest version and then update the visualization
|
||||
*/
|
||||
void doUpdateFromUAV();
|
||||
};
|
||||
|
||||
#endif // PATHCOMPILER_H
|
Loading…
x
Reference in New Issue
Block a user