Commit 2601b482 authored by Valentin Platzgummer's avatar Valentin Platzgummer

SnakeWorker added

parent 5ac59ffd
......@@ -92,11 +92,6 @@ exists($$MAVLINKPATH/common) {
INCLUDEPATH += libs/eigen
DEFINES += NOMINMAX
#
# [REQUIRED] snake library (Wima)
INCLUDEPATH += libs/snake
INCLUDEPATH += libs/or-tools/include
#
# [REQUIRED] shapelib library
INCLUDEPATH += libs/shapelib
......@@ -200,3 +195,13 @@ contains (DEFINES, DISABLE_AIRMAP) {
$${AIRMAPD_PATH}/include
}
}
# GeograpicLib (TODO: add Windows support!)
LinuxBuild {
LIBS += -L/usr/local/lib -lGeographic # libGeograpic.so
}
# google or-tools (TODO: add Windows support!)
LinuxBuild {
LIBS += -L/usr/local/lib -lortools # libortools.so
}
cmake_minimum_required(VERSION 3.14)
project(polyclipping)
add_library(polyclipping
STATIC
clipper.cpp)
target_include_directories(polyclipping PUBLIC include)
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.18
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Disable VCS-based implicit rules.
% : %,v
# Disable VCS-based implicit rules.
% : RCS/%
# Disable VCS-based implicit rules.
% : RCS/%,v
# Disable VCS-based implicit rules.
% : SCCS/s.%
# Disable VCS-based implicit rules.
% : s.%
.SUFFIXES: .hpux_make_needs_suffix_list
# Command-line flag to silence nested $(MAKE).
$(VERBOSE)MAKESILENT = -s
# Suppress display of executed commands.
$$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/local/bin/cmake
# The command to remove a file.
RM = /usr/local/bin/cmake -E rm -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/valentin/Desktop/drones/qgroundcontrol
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/valentin/Desktop/drones/qgroundcontrol
#=============================================================================
# Targets provided globally by CMake.
# Special rule for the target install/strip
install/strip: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
/usr/local/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip
# Special rule for the target install/strip
install/strip/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
/usr/local/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip/fast
# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
/usr/local/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
.PHONY : edit_cache
# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast
# Special rule for the target install
install: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/usr/local/bin/cmake -P cmake_install.cmake
.PHONY : install
# Special rule for the target install
install/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/usr/local/bin/cmake -P cmake_install.cmake
.PHONY : install/fast
# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
/usr/local/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache
# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast
# Special rule for the target list_install_components
list_install_components:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
.PHONY : list_install_components
# Special rule for the target list_install_components
list_install_components/fast: list_install_components
.PHONY : list_install_components/fast
# Special rule for the target install/local
install/local: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
/usr/local/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local
# Special rule for the target install/local
install/local/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
/usr/local/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local/fast
# The main all target
all: cmake_check_build_system
cd /home/valentin/Desktop/drones/qgroundcontrol && $(CMAKE_COMMAND) -E cmake_progress_start /home/valentin/Desktop/drones/qgroundcontrol/CMakeFiles /home/valentin/Desktop/drones/qgroundcontrol/libs/clipper//CMakeFiles/progress.marks
cd /home/valentin/Desktop/drones/qgroundcontrol && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 libs/clipper/all
$(CMAKE_COMMAND) -E cmake_progress_start /home/valentin/Desktop/drones/qgroundcontrol/CMakeFiles 0
.PHONY : all
# The main clean target
clean:
cd /home/valentin/Desktop/drones/qgroundcontrol && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 libs/clipper/clean
.PHONY : clean
# The main clean target
clean/fast: clean
.PHONY : clean/fast
# Prepare targets for installation.
preinstall: all
cd /home/valentin/Desktop/drones/qgroundcontrol && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 libs/clipper/preinstall
.PHONY : preinstall
# Prepare targets for installation.
preinstall/fast:
cd /home/valentin/Desktop/drones/qgroundcontrol && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 libs/clipper/preinstall
.PHONY : preinstall/fast
# clear depends
depend:
cd /home/valentin/Desktop/drones/qgroundcontrol && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend
# Convenience name for target.
libs/clipper/CMakeFiles/polyclipping.dir/rule:
cd /home/valentin/Desktop/drones/qgroundcontrol && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 libs/clipper/CMakeFiles/polyclipping.dir/rule
.PHONY : libs/clipper/CMakeFiles/polyclipping.dir/rule
# Convenience name for target.
polyclipping: libs/clipper/CMakeFiles/polyclipping.dir/rule
.PHONY : polyclipping
# fast build rule for target.
polyclipping/fast:
cd /home/valentin/Desktop/drones/qgroundcontrol && $(MAKE) $(MAKESILENT) -f libs/clipper/CMakeFiles/polyclipping.dir/build.make libs/clipper/CMakeFiles/polyclipping.dir/build
.PHONY : polyclipping/fast
# Convenience name for target.
libs/clipper/CMakeFiles/polyclipping_autogen.dir/rule:
cd /home/valentin/Desktop/drones/qgroundcontrol && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 libs/clipper/CMakeFiles/polyclipping_autogen.dir/rule
.PHONY : libs/clipper/CMakeFiles/polyclipping_autogen.dir/rule
# Convenience name for target.
polyclipping_autogen: libs/clipper/CMakeFiles/polyclipping_autogen.dir/rule
.PHONY : polyclipping_autogen
# fast build rule for target.
polyclipping_autogen/fast:
cd /home/valentin/Desktop/drones/qgroundcontrol && $(MAKE) $(MAKESILENT) -f libs/clipper/CMakeFiles/polyclipping_autogen.dir/build.make libs/clipper/CMakeFiles/polyclipping_autogen.dir/build
.PHONY : polyclipping_autogen/fast
clipper.o: clipper.cpp.o
.PHONY : clipper.o
# target to build an object file
clipper.cpp.o:
cd /home/valentin/Desktop/drones/qgroundcontrol && $(MAKE) $(MAKESILENT) -f libs/clipper/CMakeFiles/polyclipping.dir/build.make libs/clipper/CMakeFiles/polyclipping.dir/clipper.cpp.o
.PHONY : clipper.cpp.o
clipper.i: clipper.cpp.i
.PHONY : clipper.i
# target to preprocess a source file
clipper.cpp.i:
cd /home/valentin/Desktop/drones/qgroundcontrol && $(MAKE) $(MAKESILENT) -f libs/clipper/CMakeFiles/polyclipping.dir/build.make libs/clipper/CMakeFiles/polyclipping.dir/clipper.cpp.i
.PHONY : clipper.cpp.i
clipper.s: clipper.cpp.s
.PHONY : clipper.s
# target to generate assembly for a file
clipper.cpp.s:
cd /home/valentin/Desktop/drones/qgroundcontrol && $(MAKE) $(MAKESILENT) -f libs/clipper/CMakeFiles/polyclipping.dir/build.make libs/clipper/CMakeFiles/polyclipping.dir/clipper.cpp.s
.PHONY : clipper.cpp.s
polyclipping_autogen/mocs_compilation.o: polyclipping_autogen/mocs_compilation.cpp.o
.PHONY : polyclipping_autogen/mocs_compilation.o
# target to build an object file
polyclipping_autogen/mocs_compilation.cpp.o:
cd /home/valentin/Desktop/drones/qgroundcontrol && $(MAKE) $(MAKESILENT) -f libs/clipper/CMakeFiles/polyclipping.dir/build.make libs/clipper/CMakeFiles/polyclipping.dir/polyclipping_autogen/mocs_compilation.cpp.o
.PHONY : polyclipping_autogen/mocs_compilation.cpp.o
polyclipping_autogen/mocs_compilation.i: polyclipping_autogen/mocs_compilation.cpp.i
.PHONY : polyclipping_autogen/mocs_compilation.i
# target to preprocess a source file
polyclipping_autogen/mocs_compilation.cpp.i:
cd /home/valentin/Desktop/drones/qgroundcontrol && $(MAKE) $(MAKESILENT) -f libs/clipper/CMakeFiles/polyclipping.dir/build.make libs/clipper/CMakeFiles/polyclipping.dir/polyclipping_autogen/mocs_compilation.cpp.i
.PHONY : polyclipping_autogen/mocs_compilation.cpp.i
polyclipping_autogen/mocs_compilation.s: polyclipping_autogen/mocs_compilation.cpp.s
.PHONY : polyclipping_autogen/mocs_compilation.s
# target to generate assembly for a file
polyclipping_autogen/mocs_compilation.cpp.s:
cd /home/valentin/Desktop/drones/qgroundcontrol && $(MAKE) $(MAKESILENT) -f libs/clipper/CMakeFiles/polyclipping.dir/build.make libs/clipper/CMakeFiles/polyclipping.dir/polyclipping_autogen/mocs_compilation.cpp.s
.PHONY : polyclipping_autogen/mocs_compilation.cpp.s
# Help Target
help:
@echo "The following are some of the valid targets for this Makefile:"
@echo "... all (the default if no target is provided)"
@echo "... clean"
@echo "... depend"
@echo "... edit_cache"
@echo "... install"
@echo "... install/local"
@echo "... install/strip"
@echo "... list_install_components"
@echo "... rebuild_cache"
@echo "... polyclipping_autogen"
@echo "... polyclipping"
@echo "... clipper.o"
@echo "... clipper.i"
@echo "... clipper.s"
@echo "... polyclipping_autogen/mocs_compilation.o"
@echo "... polyclipping_autogen/mocs_compilation.i"
@echo "... polyclipping_autogen/mocs_compilation.s"
.PHONY : help
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
cd /home/valentin/Desktop/drones/qgroundcontrol && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system
# This file is used to ignore files which are generated
# ----------------------------------------------------------------------------
*~
*.autosave
*.a
*.core
*.moc
*.o
*.obj
*.orig
*.rej
*.so
*.so.*
*_pch.h.cpp
*_resource.rc
*.qm
.#*
*.*#
core
!core/
tags
.DS_Store
.directory
*.debug
Makefile*
*.prl
*.app
moc_*.cpp
ui_*.h
qrc_*.cpp
Thumbs.db
*.res
*.rc
/.qmake.cache
/.qmake.stash
# qtcreator generated files
*.pro.user*
# xemacs temporary files
*.flc
# Vim temporary files
.*.swp
# Visual Studio generated files
*.ib_pdb_index
*.idb
*.ilk
*.pdb
*.sln
*.suo
*.vcproj
*vcproj.*.*.user
*.ncb
*.sdf
*.opensdf
*.vcxproj
*vcxproj.*
# MinGW generated files
*.Debug
*.Release
# Python byte code
*.pyc
# Binaries
# --------
*.dll
*.exe
......@@ -4329,10 +4329,10 @@ double DistanceFromLineSqrd(
const IntPoint& pt, const IntPoint& ln1, const IntPoint& ln2)
{
//The equation of a line in general form (Ax + By + C = 0)
//given 2 points (x,y) & (x,y) is ...
//(y - y)x + (x - x)y + (y - y)x - (x - x)y = 0
//A = (y - y); B = (x - x); C = (y - y)x - (x - x)y
//perpendicular distance of point (x,y) = (Ax + By + C)/Sqrt(A + B)
//given 2 points (x�,y�) & (x�,y�) is ...
//(y� - y�)x + (x� - x�)y + (y� - y�)x� - (x� - x�)y� = 0
//A = (y� - y�); B = (x� - x�); C = (y� - y�)x� - (x� - x�)y�
//perpendicular distance of point (x�,y�) = (Ax� + By� + C)/Sqrt(A� + B�)
//see http://en.wikipedia.org/wiki/Perpendicular_distance
double A = double(ln1.Y - ln2.Y);
double B = double(ln2.X - ln1.X);
......
CONFIG -= qt
TEMPLATE = lib
DEFINES += CLIPPER_LIBRARY
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
clipper.cpp
HEADERS += \
clipper.hpp \
clipper_global.h
# Default rules for deployment.
unix {
target.path = /usr/lib
}
!isEmpty(target.path): INSTALLS += target
#ifndef CLIPPER_GLOBAL_H
#define CLIPPER_GLOBAL_H
#if defined(_MSC_VER) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__) || defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
# define Q_DECL_EXPORT __declspec(dllexport)
# define Q_DECL_IMPORT __declspec(dllimport)
#else
# define Q_DECL_EXPORT __attribute__((visibility("default")))
# define Q_DECL_IMPORT __attribute__((visibility("default")))
#endif
#if defined(CLIPPER_LIBRARY)
# define CLIPPER_EXPORT Q_DECL_EXPORT
#else
# define CLIPPER_EXPORT Q_DECL_IMPORT
#endif
#endif // CLIPPER_GLOBAL_H
# Install script for directory: /home/valentin/Desktop/drones/qgroundcontrol/libs/clipper
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "RelWithDebInfo")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
# Set default install directory permissions.
if(NOT DEFINED CMAKE_OBJDUMP)
set(CMAKE_OBJDUMP "/usr/bin/objdump")
endif()
// This file is autogenerated. Changes will be overwritten.
#include "EWIEGA46WW/moc_qwt_abstract_legend.cpp"
#include "EWIEGA46WW/moc_qwt_abstract_scale.cpp"
#include "EWIEGA46WW/moc_qwt_abstract_slider.cpp"
#include "EWIEGA46WW/moc_qwt_analog_clock.cpp"
#include "EWIEGA46WW/moc_qwt_compass.cpp"
#include "EWIEGA46WW/moc_qwt_counter.cpp"
#include "EWIEGA46WW/moc_qwt_dial.cpp"
#include "EWIEGA46WW/moc_qwt_dyngrid_layout.cpp"
#include "EWIEGA46WW/moc_qwt_knob.cpp"
#include "EWIEGA46WW/moc_qwt_legend.cpp"
#include "EWIEGA46WW/moc_qwt_legend_label.cpp"
#include "EWIEGA46WW/moc_qwt_magnifier.cpp"
#include "EWIEGA46WW/moc_qwt_panner.cpp"
#include "EWIEGA46WW/moc_qwt_picker.cpp"
#include "EWIEGA46WW/moc_qwt_plot.cpp"
#include "EWIEGA46WW/moc_qwt_plot_canvas.cpp"
#include "EWIEGA46WW/moc_qwt_plot_magnifier.cpp"
#include "EWIEGA46WW/moc_qwt_plot_panner.cpp"
#include "EWIEGA46WW/moc_qwt_plot_picker.cpp"
#include "EWIEGA46WW/moc_qwt_plot_zoomer.cpp"
#include "EWIEGA46WW/moc_qwt_scale_widget.cpp"
#include "EWIEGA46WW/moc_qwt_slider.cpp"
#include "EWIEGA46WW/moc_qwt_text_label.cpp"
#include "EWIEGA46WW/moc_qwt_thermo.cpp"
#include "EWIEGA46WW/moc_qwt_wheel.cpp"
// This file is autogenerated. Changes will be overwritten.
// No files found that require moc or the moc files are included
enum some_compilers { need_more_than_nothing };
// This file is autogenerated. Changes will be overwritten.
// No files found that require moc or the moc files are included
enum some_compilers { need_more_than_nothing };
// This file is autogenerated. Changes will be overwritten.
// No files found that require moc or the moc files are included
enum some_compilers { need_more_than_nothing };
// This file is autogenerated. Changes will be overwritten.
// No files found that require moc or the moc files are included
enum some_compilers { need_more_than_nothing };
// This file is autogenerated. Changes will be overwritten.
// No files found that require moc or the moc files are included
enum some_compilers { need_more_than_nothing };
// This file is autogenerated. Changes will be overwritten.
// No files found that require moc or the moc files are included
enum some_compilers { need_more_than_nothing };
// This file is autogenerated. Changes will be overwritten.
// No files found that require moc or the moc files are included
enum some_compilers { need_more_than_nothing };
// This file is autogenerated. Changes will be overwritten.
// No files found that require moc or the moc files are included
enum some_compilers { need_more_than_nothing };
// This file is autogenerated. Changes will be overwritten.
// No files found that require moc or the moc files are included
enum some_compilers { need_more_than_nothing };
# This file is used to ignore files which are generated
# ----------------------------------------------------------------------------
*~
*.autosave
*.a
*.core
*.moc
*.o
*.obj
*.orig
*.rej
*.so
*.so.*
*_pch.h.cpp
*_resource.rc
*.qm
.#*
*.*#
core
!core/
tags
.DS_Store
.directory
*.debug
Makefile*
*.prl
*.app
moc_*.cpp
ui_*.h
qrc_*.cpp
Thumbs.db
*.res
*.rc
/.qmake.cache
/.qmake.stash
# qtcreator generated files
*.pro.user*
# xemacs temporary files
*.flc
# Vim temporary files
.*.swp
# Visual Studio generated files
*.ib_pdb_index
*.idb
*.ilk
*.pdb
*.sln
*.suo
*.vcproj
*vcproj.*.*.user
*.ncb
*.sdf
*.opensdf
*.vcxproj
*vcxproj.*
# MinGW generated files
*.Debug
*.Release
# Python byte code
*.pyc
# Binaries
# --------
*.dll
*.exe
add_library(snake
STATIC
snake.cpp
snake_geometry.cpp
)
find_package(GeographicLib REQUIRED)
find_package(ortools CONFIG REQUIRED)
target_link_libraries (snake ${GeographicLib_LIBRARIES} polyclipping ${ORTOOLS_LIBRARIES})
target_include_directories(snake PRIVATE polylabel) # polylabel
target_include_directories(snake PUBLIC include) # polylabel
add_subdirectory(test)