diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 591dcf0..376082d 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -1,17 +1,17 @@ { - "configurations": [ - { - "name": "Linux", - "includePath": [ - "../HEAR_Architecture/**", - "../HEAR_ROS_BRIDGE/**", - "../../devel/include/**", - "/opt/ros/melodic/include/**" - ], - "compilerPath": "/usr/bin/clang", - "cStandard": "c11", - "intelliSenseMode": "clang-x64" - } - ], - "version": 4 -} + "configurations": [ + { + "name": "Linux", + "includePath": [ + "../HEAR_Architecture/**", + "../HEAR_ROS_BRIDGE/**", + "../../devel/include/**", + "/opt/ros/melodic/include/**" + ], + "compilerPath": "/usr/bin/clang", + "cStandard": "c11", + "intelliSenseMode": "clang-x64" + } + ], + "version": 4 + } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 09ae403..a6c5a75 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,8 +1,16 @@ { "python.autoComplete.extraPaths": [ - "/home/pedrohrpbs/catkin_ws_HEAR/devel/lib/python2.7/dist-packages", - "/home/pedrohrpbs/catkin_ws_tensorflow/devel/lib/python2.7/dist-packages", - "/home/pedrohrpbs/catkin_ws_NAVIO/devel/lib/python2.7/dist-packages", + "/home/ahmed/HEAR_ws/devel/lib/python2.7/dist-packages", + "/home/ahmed/catkin_ws_other/devel/lib/python2.7/dist-packages", + "/home/ahmed/catkin_ws/devel/lib/python2.7/dist-packages", + "/home/ahmed/event_ws/devel/lib/python2.7/dist-packages", "/opt/ros/melodic/lib/python2.7/dist-packages" - ] + ], + "python.analysis.extraPaths": [ + "/home/ahmed/HEAR_ws/devel/lib/python2.7/dist-packages", + "/home/ahmed/catkin_ws_other/devel/lib/python2.7/dist-packages", + "/home/ahmed/catkin_ws/devel/lib/python2.7/dist-packages", + "/home/ahmed/event_ws/devel/lib/python2.7/dist-packages", + "/opt/ros/melodic/lib/python2.7/dist-packages" + ], } \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d33243..420b504 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,19 +5,15 @@ add_compile_options(-std=c++11) find_package(catkin REQUIRED COMPONENTS roscpp - hear_hardware_interface hear_architecture hear_ros_bridge ) catkin_package( - INCLUDE_DIRS - LIBRARIES ${PROJECT_NAME} CATKIN_DEPENDS hear_ros_bridge + hear_architecture roscpp - DEPENDS - system_lib ) include_directories( @@ -25,7 +21,19 @@ include_directories( ) add_executable(mc_example_node example_node/example_node.cpp) +add_executable(mc_slam_mrft_node example_node/SLAM_tuning_node.cpp) add_executable(mc_translation_node example_node/traslation_node.cpp) +add_executable(mc_test_node example_node/test_node.cpp) +add_executable(mrft_scenario example_node/mrft_scenario.cpp) + +add_dependencies(mc_example_node ${catkin_EXPORTED_TARGETS}) +add_dependencies(mc_slam_mrft_node ${catkin_EXPORTED_TARGETS}) +add_dependencies(mc_translation_node ${catkin_EXPORTED_TARGETS}) +add_dependencies(mc_test_node ${catkin_EXPORTED_TARGETS}) +add_dependencies(mrft_scenario ${catkin_EXPORTED_TARGETS}) target_link_libraries(mc_example_node ${catkin_LIBRARIES}) +target_link_libraries(mc_test_node ${catkin_LIBRARIES}) +target_link_libraries(mc_slam_mrft_node ${catkin_LIBRARIES}) target_link_libraries(mc_translation_node ${catkin_LIBRARIES}) +target_link_libraries(mrft_scenario ${catkin_LIBRARIES}) \ No newline at end of file diff --git a/build/CMakeCache.txt b/build/CMakeCache.txt deleted file mode 100644 index 2c8a6fa..0000000 --- a/build/CMakeCache.txt +++ /dev/null @@ -1,299 +0,0 @@ -# This is the CMakeCache file. -# For build in directory: /run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build -# It was generated by CMake: /usr/bin/cmake -# You can edit this file to change values found and used by cmake. -# If you do not want to change any of the values, simply exit the editor. -# If you do want to change a value, simply edit, save, and exit the editor. -# The syntax for the file is as follows: -# KEY:TYPE=VALUE -# KEY is the name of a variable in the cache. -# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. -# VALUE is the current value for the KEY. - -######################## -# EXTERNAL cache entries -######################## - -//Path to a program. -CMAKE_AR:FILEPATH=/usr/bin/ar - -//No help, variable specified on the command line. -CMAKE_BUILD_TYPE:STRING=Debug - -//Enable/Disable color output during build. -CMAKE_COLOR_MAKEFILE:BOOL=ON - -//No help, variable specified on the command line. -CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/clang++-6.0 - -//LLVM archiver -CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/llvm-ar-6.0 - -//Generate index for LLVM archive -CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/llvm-ranlib-6.0 - -//No help, variable specified on the command line. -CMAKE_C_COMPILER:FILEPATH=/usr/bin/clang-6.0 - -//LLVM archiver -CMAKE_C_COMPILER_AR:FILEPATH=/usr/bin/llvm-ar-6.0 - -//Generate index for LLVM archive -CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/bin/llvm-ranlib-6.0 - -//Flags used by the compiler during all build types. -CMAKE_C_FLAGS:STRING= - -//Flags used by the compiler during debug builds. -CMAKE_C_FLAGS_DEBUG:STRING=-g - -//Flags used by the compiler during release builds for minimum -// size. -CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the compiler during release builds. -CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the compiler during release builds with debug info. -CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//Flags used by the linker. -CMAKE_EXE_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//No help, variable specified on the command line. -CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE - -//Install path prefix, prepended onto install directories. -CMAKE_INSTALL_PREFIX:PATH=/usr/local - -//Path to a program. -CMAKE_LINKER:FILEPATH=/usr/bin/ld - -//Path to a program. -CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make - -//Flags used by the linker during the creation of modules. -CMAKE_MODULE_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_NM:FILEPATH=/usr/bin/nm - -//Path to a program. -CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy - -//Path to a program. -CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump - -//Value Computed by CMake -CMAKE_PROJECT_NAME:STATIC=hear_navio_mc_example - -//Path to a program. -CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib - -//Flags used by the linker during the creation of dll's. -CMAKE_SHARED_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//If set, runtime paths are not added when installing shared libraries, -// but are added when building. -CMAKE_SKIP_INSTALL_RPATH:BOOL=NO - -//If set, runtime paths are not added when using shared libraries. -CMAKE_SKIP_RPATH:BOOL=NO - -//Flags used by the linker during the creation of static libraries. -CMAKE_STATIC_LINKER_FLAGS:STRING= - -//Flags used by the linker during debug builds. -CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during release minsize builds. -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during release builds. -CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during Release with Debug Info builds. -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_STRIP:FILEPATH=/usr/bin/strip - -//If this value is on, makefiles will be generated without the -// .SILENT directive, and all commands will be echoed to the console -// during the make. This is useful for debugging only. With Visual -// Studio IDE projects all commands are done without /nologo. -CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE - -//Value Computed by CMake -hear_navio_mc_example_BINARY_DIR:STATIC=/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build - -//Value Computed by CMake -hear_navio_mc_example_SOURCE_DIR:STATIC=/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC - - -######################## -# INTERNAL cache entries -######################## - -//ADVANCED property for variable: CMAKE_AR -CMAKE_AR-ADVANCED:INTERNAL=1 -//This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build -//Major version of cmake used to create the current loaded cache -CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 -//Minor version of cmake used to create the current loaded cache -CMAKE_CACHE_MINOR_VERSION:INTERNAL=10 -//Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=2 -//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE -CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 -//Path to CMake executable. -CMAKE_COMMAND:INTERNAL=/usr/bin/cmake -//Path to cpack program executable. -CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack -//Path to ctest program executable. -CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest -//ADVANCED property for variable: CMAKE_CXX_COMPILER -CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR -CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB -CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER -CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER_AR -CMAKE_C_COMPILER_AR-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER_RANLIB -CMAKE_C_COMPILER_RANLIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS -CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG -CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL -CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE -CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO -CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//Executable file format -CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS -CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG -CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE -CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS -CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 -//Name of external makefile project generator. -CMAKE_EXTRA_GENERATOR:INTERNAL= -//Name of generator. -CMAKE_GENERATOR:INTERNAL=Unix Makefiles -//Name of generator platform. -CMAKE_GENERATOR_PLATFORM:INTERNAL= -//Name of generator toolset. -CMAKE_GENERATOR_TOOLSET:INTERNAL= -//Source directory with the top level CMakeLists.txt file for this -// project -CMAKE_HOME_DIRECTORY:INTERNAL=/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC -//Install .so files without execute permission. -CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 -//ADVANCED property for variable: CMAKE_LINKER -CMAKE_LINKER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MAKE_PROGRAM -CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS -CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG -CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE -CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_NM -CMAKE_NM-ADVANCED:INTERNAL=1 -//number of local generators -CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJCOPY -CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJDUMP -CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 -//Platform information initialized -CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RANLIB -CMAKE_RANLIB-ADVANCED:INTERNAL=1 -//Path to CMake installation. -CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.10 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS -CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG -CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE -CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH -CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_RPATH -CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS -CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG -CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE -CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STRIP -CMAKE_STRIP-ADVANCED:INTERNAL=1 -//uname command -CMAKE_UNAME:INTERNAL=/bin/uname -//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE -CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 - diff --git a/build/CMakeFiles/3.10.2/CMakeSystem.cmake b/build/CMakeFiles/3.10.2/CMakeSystem.cmake deleted file mode 100644 index d7e94d8..0000000 --- a/build/CMakeFiles/3.10.2/CMakeSystem.cmake +++ /dev/null @@ -1,15 +0,0 @@ -set(CMAKE_HOST_SYSTEM "Linux-5.4.0-53-generic") -set(CMAKE_HOST_SYSTEM_NAME "Linux") -set(CMAKE_HOST_SYSTEM_VERSION "5.4.0-53-generic") -set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") - - - -set(CMAKE_SYSTEM "Linux-5.4.0-53-generic") -set(CMAKE_SYSTEM_NAME "Linux") -set(CMAKE_SYSTEM_VERSION "5.4.0-53-generic") -set(CMAKE_SYSTEM_PROCESSOR "x86_64") - -set(CMAKE_CROSSCOMPILING "FALSE") - -set(CMAKE_SYSTEM_LOADED 1) diff --git a/build/CMakeFiles/3.10.2/CompilerIdC/CMakeCCompilerId.c b/build/CMakeFiles/3.10.2/CompilerIdC/CMakeCCompilerId.c deleted file mode 100644 index 722faa8..0000000 --- a/build/CMakeFiles/3.10.2/CompilerIdC/CMakeCCompilerId.c +++ /dev/null @@ -1,598 +0,0 @@ -#ifdef __cplusplus -# error "A C++ compiler has been selected for C." -#endif - -#if defined(__18CXX) -# define ID_VOID_MAIN -#endif -#if defined(__CLASSIC_C__) -/* cv-qualifiers did not exist in K&R C */ -# define const -# define volatile -#endif - - -/* Version number components: V=Version, R=Revision, P=Patch - Version date components: YYYY=Year, MM=Month, DD=Day */ - -#if defined(__INTEL_COMPILER) || defined(__ICC) -# define COMPILER_ID "Intel" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif - /* __INTEL_COMPILER = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) -# if defined(__INTEL_COMPILER_UPDATE) -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) -# else -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) -# endif -# if defined(__INTEL_COMPILER_BUILD_DATE) - /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ -# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) -# endif -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__PATHCC__) -# define COMPILER_ID "PathScale" -# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) -# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) -# if defined(__PATHCC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) -# endif - -#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) -# define COMPILER_ID "Embarcadero" -# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_C) -# define COMPILER_ID "SunPro" -# if __SUNPRO_C >= 0x5100 - /* __SUNPRO_C = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# endif - -#elif defined(__HP_cc) -# define COMPILER_ID "HP" - /* __HP_cc = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) - -#elif defined(__DECC) -# define COMPILER_ID "Compaq" - /* __DECC_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) - -#elif defined(__IBMC__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 -# define COMPILER_ID "XL" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 -# define COMPILER_ID "VisualAge" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) -# define COMPILER_ID "Fujitsu" - -#elif defined(__TINYC__) -# define COMPILER_ID "TinyCC" - -#elif defined(__BCC__) -# define COMPILER_ID "Bruce" - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__GNUC__) -# define COMPILER_ID "GNU" -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) -# define COMPILER_ID "ADSP" -#if defined(__VISUALDSPVERSION__) - /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ -# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) -# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - -#elif defined(__ARMCC_VERSION) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) -# define COMPILER_ID "SDCC" -# if defined(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) -# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) -# else - /* SDCC = VRP */ -# define COMPILER_VERSION_MAJOR DEC(SDCC/100) -# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) -# define COMPILER_VERSION_PATCH DEC(SDCC % 10) -# endif - -#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) -# define COMPILER_ID "MIPSpro" -# if defined(_SGI_COMPILER_VERSION) - /* _SGI_COMPILER_VERSION = VRP */ -# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) -# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) -# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) -# else - /* _COMPILER_VERSION = VRP */ -# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) -# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) -# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__sgi) -# define COMPILER_ID "MIPSpro" - -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXE) || defined(__CRAYXC) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) -# define PLATFORM_ID "IRIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number components. */ -#ifdef COMPILER_VERSION_MAJOR -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - - -#if !defined(__STDC__) -# if defined(_MSC_VER) && !defined(__clang__) -# define C_DIALECT "90" -# else -# define C_DIALECT -# endif -#elif __STDC_VERSION__ >= 201000L -# define C_DIALECT "11" -#elif __STDC_VERSION__ >= 199901L -# define C_DIALECT "99" -#else -# define C_DIALECT "90" -#endif -const char* info_language_dialect_default = - "INFO" ":" "dialect_default[" C_DIALECT "]"; - -/*--------------------------------------------------------------------------*/ - -#ifdef ID_VOID_MAIN -void main() {} -#else -# if defined(__CLASSIC_C__) -int main(argc, argv) int argc; char *argv[]; -# else -int main(int argc, char* argv[]) -# endif -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; - require += info_arch[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#ifdef COMPILER_VERSION_INTERNAL - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXE) || defined(__CRAYXC) - require += info_cray[argc]; -#endif - require += info_language_dialect_default[argc]; - (void)argv; - return require; -} -#endif diff --git a/build/CMakeFiles/3.10.2/CompilerIdC/CMakeCCompilerId.o b/build/CMakeFiles/3.10.2/CompilerIdC/CMakeCCompilerId.o deleted file mode 100644 index 20e7338..0000000 Binary files a/build/CMakeFiles/3.10.2/CompilerIdC/CMakeCCompilerId.o and /dev/null differ diff --git a/build/CMakeFiles/3.10.2/CompilerIdCXX/CMakeCXXCompilerId.cpp b/build/CMakeFiles/3.10.2/CompilerIdCXX/CMakeCXXCompilerId.cpp deleted file mode 100644 index 2d66298..0000000 --- a/build/CMakeFiles/3.10.2/CompilerIdCXX/CMakeCXXCompilerId.cpp +++ /dev/null @@ -1,576 +0,0 @@ -/* This source file must have a .cpp extension so that all C++ compilers - recognize the extension without flags. Borland does not know .cxx for - example. */ -#ifndef __cplusplus -# error "A C compiler has been selected for C++." -#endif - - -/* Version number components: V=Version, R=Revision, P=Patch - Version date components: YYYY=Year, MM=Month, DD=Day */ - -#if defined(__COMO__) -# define COMPILER_ID "Comeau" - /* __COMO_VERSION__ = VRR */ -# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) -# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) - -#elif defined(__INTEL_COMPILER) || defined(__ICC) -# define COMPILER_ID "Intel" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif - /* __INTEL_COMPILER = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) -# if defined(__INTEL_COMPILER_UPDATE) -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) -# else -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) -# endif -# if defined(__INTEL_COMPILER_BUILD_DATE) - /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ -# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) -# endif -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__PATHCC__) -# define COMPILER_ID "PathScale" -# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) -# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) -# if defined(__PATHCC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) -# endif - -#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) -# define COMPILER_ID "Embarcadero" -# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_CC) -# define COMPILER_ID "SunPro" -# if __SUNPRO_CC >= 0x5100 - /* __SUNPRO_CC = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# endif - -#elif defined(__HP_aCC) -# define COMPILER_ID "HP" - /* __HP_aCC = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) - -#elif defined(__DECCXX) -# define COMPILER_ID "Compaq" - /* __DECCXX_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) - -#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 -# define COMPILER_ID "XL" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 -# define COMPILER_ID "VisualAge" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) -# define COMPILER_ID "Fujitsu" - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__GNUC__) || defined(__GNUG__) -# define COMPILER_ID "GNU" -# if defined(__GNUC__) -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# else -# define COMPILER_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) -# define COMPILER_ID "ADSP" -#if defined(__VISUALDSPVERSION__) - /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ -# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) -# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - -#elif defined(__ARMCC_VERSION) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) -# define COMPILER_ID "MIPSpro" -# if defined(_SGI_COMPILER_VERSION) - /* _SGI_COMPILER_VERSION = VRP */ -# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) -# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) -# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) -# else - /* _COMPILER_VERSION = VRP */ -# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) -# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) -# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__sgi) -# define COMPILER_ID "MIPSpro" - -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXE) || defined(__CRAYXC) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) -# define PLATFORM_ID "IRIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number components. */ -#ifdef COMPILER_VERSION_MAJOR -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - - -#if defined(_MSC_VER) && defined(_MSVC_LANG) -#define CXX_STD _MSVC_LANG -#else -#define CXX_STD __cplusplus -#endif - -const char* info_language_dialect_default = "INFO" ":" "dialect_default[" -#if CXX_STD > 201402L - "17" -#elif CXX_STD >= 201402L - "14" -#elif CXX_STD >= 201103L - "11" -#else - "98" -#endif -"]"; - -/*--------------------------------------------------------------------------*/ - -int main(int argc, char* argv[]) -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#ifdef COMPILER_VERSION_INTERNAL - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXE) || defined(__CRAYXC) - require += info_cray[argc]; -#endif - require += info_language_dialect_default[argc]; - (void)argv; - return require; -} diff --git a/build/CMakeFiles/3.10.2/CompilerIdCXX/CMakeCXXCompilerId.o b/build/CMakeFiles/3.10.2/CompilerIdCXX/CMakeCXXCompilerId.o deleted file mode 100644 index 21f7ff1..0000000 Binary files a/build/CMakeFiles/3.10.2/CompilerIdCXX/CMakeCXXCompilerId.o and /dev/null differ diff --git a/build/CMakeFiles/CMakeError.log b/build/CMakeFiles/CMakeError.log deleted file mode 100644 index c22a47d..0000000 --- a/build/CMakeFiles/CMakeError.log +++ /dev/null @@ -1,168 +0,0 @@ -Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. -Compiler: /usr/bin/clang-6.0 -Build flags: -Id flags: - -The output was: -1 -/usr/bin/ld: final link failed: Operation not supported -clang: error: linker command failed with exit code 1 (use -v to see invocation) - - -Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. -Compiler: /usr/bin/clang++-6.0 -Build flags: -Id flags: - -The output was: -1 -/usr/bin/ld: final link failed: Operation not supported -clang: error: linker command failed with exit code 1 (use -v to see invocation) - - -Determining if the C compiler works failed with the following output: -Change Dir: /run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/CMakeTmp - -Run Build Command:"/usr/bin/make" "cmTC_0b8fb/fast" -/usr/bin/make -f CMakeFiles/cmTC_0b8fb.dir/build.make CMakeFiles/cmTC_0b8fb.dir/build -make[1]: Entering directory '/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/CMakeTmp' -Building C object CMakeFiles/cmTC_0b8fb.dir/testCCompiler.c.o -/usr/bin/clang-6.0 -o CMakeFiles/cmTC_0b8fb.dir/testCCompiler.c.o -c /run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/CMakeTmp/testCCompiler.c -Linking C executable cmTC_0b8fb -/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0b8fb.dir/link.txt --verbose=1 -/usr/bin/clang-6.0 -rdynamic CMakeFiles/cmTC_0b8fb.dir/testCCompiler.c.o -o cmTC_0b8fb -/usr/bin/ld: final link failed: Operation not supported -clang: error: linker command failed with exit code 1 (use -v to see invocation) -CMakeFiles/cmTC_0b8fb.dir/build.make:97: recipe for target 'cmTC_0b8fb' failed -make[1]: *** [cmTC_0b8fb] Error 1 -make[1]: Leaving directory '/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/CMakeTmp' -Makefile:126: recipe for target 'cmTC_0b8fb/fast' failed -make: *** [cmTC_0b8fb/fast] Error 2 - - -Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. -Compiler: /usr/bin/clang-6.0 -Build flags: -Id flags: - -The output was: -1 -/usr/bin/ld: final link failed: Operation not supported -clang: error: linker command failed with exit code 1 (use -v to see invocation) - - -Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. -Compiler: /usr/bin/clang++-6.0 -Build flags: -Id flags: - -The output was: -1 -/usr/bin/ld: final link failed: Operation not supported -clang: error: linker command failed with exit code 1 (use -v to see invocation) - - -Determining if the C compiler works failed with the following output: -Change Dir: /run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/CMakeTmp - -Run Build Command:"/usr/bin/make" "cmTC_82ac0/fast" -/usr/bin/make -f CMakeFiles/cmTC_82ac0.dir/build.make CMakeFiles/cmTC_82ac0.dir/build -make[1]: Entering directory '/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/CMakeTmp' -Building C object CMakeFiles/cmTC_82ac0.dir/testCCompiler.c.o -/usr/bin/clang-6.0 -o CMakeFiles/cmTC_82ac0.dir/testCCompiler.c.o -c /run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/CMakeTmp/testCCompiler.c -Linking C executable cmTC_82ac0 -/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_82ac0.dir/link.txt --verbose=1 -/usr/bin/clang-6.0 -rdynamic CMakeFiles/cmTC_82ac0.dir/testCCompiler.c.o -o cmTC_82ac0 -/usr/bin/ld: final link failed: Operation not supported -clang: error: linker command failed with exit code 1 (use -v to see invocation) -CMakeFiles/cmTC_82ac0.dir/build.make:97: recipe for target 'cmTC_82ac0' failed -make[1]: *** [cmTC_82ac0] Error 1 -make[1]: Leaving directory '/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/CMakeTmp' -Makefile:126: recipe for target 'cmTC_82ac0/fast' failed -make: *** [cmTC_82ac0/fast] Error 2 - - -Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. -Compiler: /usr/bin/clang-6.0 -Build flags: -Id flags: - -The output was: -1 -/usr/bin/ld: final link failed: Operation not supported -clang: error: linker command failed with exit code 1 (use -v to see invocation) - - -Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. -Compiler: /usr/bin/clang++-6.0 -Build flags: -Id flags: - -The output was: -1 -/usr/bin/ld: final link failed: Operation not supported -clang: error: linker command failed with exit code 1 (use -v to see invocation) - - -Determining if the C compiler works failed with the following output: -Change Dir: /run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/CMakeTmp - -Run Build Command:"/usr/bin/make" "cmTC_a67b2/fast" -/usr/bin/make -f CMakeFiles/cmTC_a67b2.dir/build.make CMakeFiles/cmTC_a67b2.dir/build -make[1]: Entering directory '/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/CMakeTmp' -Building C object CMakeFiles/cmTC_a67b2.dir/testCCompiler.c.o -/usr/bin/clang-6.0 -o CMakeFiles/cmTC_a67b2.dir/testCCompiler.c.o -c /run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/CMakeTmp/testCCompiler.c -Linking C executable cmTC_a67b2 -/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a67b2.dir/link.txt --verbose=1 -/usr/bin/clang-6.0 -rdynamic CMakeFiles/cmTC_a67b2.dir/testCCompiler.c.o -o cmTC_a67b2 -/usr/bin/ld: final link failed: Operation not supported -clang: error: linker command failed with exit code 1 (use -v to see invocation) -CMakeFiles/cmTC_a67b2.dir/build.make:97: recipe for target 'cmTC_a67b2' failed -make[1]: *** [cmTC_a67b2] Error 1 -make[1]: Leaving directory '/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/CMakeTmp' -Makefile:126: recipe for target 'cmTC_a67b2/fast' failed -make: *** [cmTC_a67b2/fast] Error 2 - - -Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. -Compiler: /usr/bin/clang-6.0 -Build flags: -Id flags: - -The output was: -1 -/usr/bin/ld: final link failed: Operation not supported -clang: error: linker command failed with exit code 1 (use -v to see invocation) - - -Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. -Compiler: /usr/bin/clang++-6.0 -Build flags: -Id flags: - -The output was: -1 -/usr/bin/ld: final link failed: Operation not supported -clang: error: linker command failed with exit code 1 (use -v to see invocation) - - -Determining if the C compiler works failed with the following output: -Change Dir: /run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/CMakeTmp - -Run Build Command:"/usr/bin/make" "cmTC_635a3/fast" -/usr/bin/make -f CMakeFiles/cmTC_635a3.dir/build.make CMakeFiles/cmTC_635a3.dir/build -make[1]: Entering directory '/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/CMakeTmp' -Building C object CMakeFiles/cmTC_635a3.dir/testCCompiler.c.o -/usr/bin/clang-6.0 -o CMakeFiles/cmTC_635a3.dir/testCCompiler.c.o -c /run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/CMakeTmp/testCCompiler.c -Linking C executable cmTC_635a3 -/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_635a3.dir/link.txt --verbose=1 -/usr/bin/clang-6.0 -rdynamic CMakeFiles/cmTC_635a3.dir/testCCompiler.c.o -o cmTC_635a3 -/usr/bin/ld: final link failed: Operation not supported -clang: error: linker command failed with exit code 1 (use -v to see invocation) -CMakeFiles/cmTC_635a3.dir/build.make:97: recipe for target 'cmTC_635a3' failed -make[1]: *** [cmTC_635a3] Error 1 -make[1]: Leaving directory '/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/CMakeTmp' -Makefile:126: recipe for target 'cmTC_635a3/fast' failed -make: *** [cmTC_635a3/fast] Error 2 - - diff --git a/build/CMakeFiles/CMakeOutput.log b/build/CMakeFiles/CMakeOutput.log deleted file mode 100644 index 1c1ee09..0000000 --- a/build/CMakeFiles/CMakeOutput.log +++ /dev/null @@ -1,105 +0,0 @@ -The system is: Linux - 5.4.0-53-generic - x86_64 -Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. -Compiler: /usr/bin/clang-6.0 -Build flags: -Id flags: -c - -The output was: -0 - - -Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o" - -The C compiler identification is Clang, found in "/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/3.10.2/CompilerIdC/CMakeCCompilerId.o" - -Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. -Compiler: /usr/bin/clang++-6.0 -Build flags: -Id flags: -c - -The output was: -0 - - -Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.o" - -The CXX compiler identification is Clang, found in "/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/3.10.2/CompilerIdCXX/CMakeCXXCompilerId.o" - -Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. -Compiler: /usr/bin/clang-6.0 -Build flags: -Id flags: -c - -The output was: -0 - - -Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o" - -The C compiler identification is Clang, found in "/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/3.10.2/CompilerIdC/CMakeCCompilerId.o" - -Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. -Compiler: /usr/bin/clang++-6.0 -Build flags: -Id flags: -c - -The output was: -0 - - -Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.o" - -The CXX compiler identification is Clang, found in "/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/3.10.2/CompilerIdCXX/CMakeCXXCompilerId.o" - -Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. -Compiler: /usr/bin/clang-6.0 -Build flags: -Id flags: -c - -The output was: -0 - - -Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o" - -The C compiler identification is Clang, found in "/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/3.10.2/CompilerIdC/CMakeCCompilerId.o" - -Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. -Compiler: /usr/bin/clang++-6.0 -Build flags: -Id flags: -c - -The output was: -0 - - -Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.o" - -The CXX compiler identification is Clang, found in "/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/3.10.2/CompilerIdCXX/CMakeCXXCompilerId.o" - -Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. -Compiler: /usr/bin/clang-6.0 -Build flags: -Id flags: -c - -The output was: -0 - - -Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o" - -The C compiler identification is Clang, found in "/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/3.10.2/CompilerIdC/CMakeCCompilerId.o" - -Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. -Compiler: /usr/bin/clang++-6.0 -Build flags: -Id flags: -c - -The output was: -0 - - -Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.o" - -The CXX compiler identification is Clang, found in "/run/user/1000/gvfs/sftp:host=10.0.0.187,user=ku-t2/home/ku-t2/catkin_ws_HEAR/src/HEAR_Navio2_MC/build/CMakeFiles/3.10.2/CompilerIdCXX/CMakeCXXCompilerId.o" - diff --git a/build/CMakeFiles/cmake.check_cache b/build/CMakeFiles/cmake.check_cache deleted file mode 100644 index 3dccd73..0000000 --- a/build/CMakeFiles/cmake.check_cache +++ /dev/null @@ -1 +0,0 @@ -# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/example_node/SLAM_tuning_node.cpp b/example_node/SLAM_tuning_node.cpp new file mode 100644 index 0000000..4e94b74 --- /dev/null +++ b/example_node/SLAM_tuning_node.cpp @@ -0,0 +1,525 @@ +//TODO: Check again the whole naming and archeticting of SetRelativeWaypoint and SetAbsoluteWaypoint +// UAV controller tuning with SLAM +#include + +#include "HEAR_core/std_logger.hpp" +#include "HEAR_mission/Wait.hpp" +#include "HEAR_mission/WaitForCondition.hpp" +#include "HEAR_mission/Arm.hpp" +#include "HEAR_mission/Disarm.hpp" +#include "HEAR_mission/MissionScenario.hpp" +#include "HEAR_mission/UserCommand.hpp" +#include "HEAR_mission/SetRestNormSettings.hpp" +#include "HEAR_mission/SetHeightOffset.hpp" +#include "HEAR_mission/SendBoolSignal.hpp" +#include "HEAR_mission/ResetController.hpp" +#include "HEAR_mission/SetRelativeWaypoint.hpp" +#include "HEAR_mission/SwitchTrigger.hpp" +#include "HEAR_mission/SetAbsoluteWaypoint.hpp" +#include "HEAR_mission/UpdateController.hpp" +#include "HEAR_ROS_BRIDGE/ROSUnit_UpdateControllerClnt.hpp" +#include "HEAR_math/ConstantFloat.hpp" +#include "HEAR_ROS_BRIDGE/ROSUnit_UpdateControllerSrv.hpp" +#include "HEAR_control/PIDController.hpp" +#include "HEAR_ROS_BRIDGE/ROSUnit_InfoSubscriber.hpp" +#include "HEAR_ROS_BRIDGE/ROSUnit_Factory.hpp" +#include "HEAR_ROS_BRIDGE/ROSUnit_RestNormSettingsClnt.hpp" +#include "HEAR_ROS_BRIDGE/ROSUnit_ControlOutputSubscriber.hpp" + +//#define MRFT_X_SLAM +//#define MRFT_Y_SLAM +#define MRFT_Z_SLAM + +//#define PID_X_SLAM +//#define PID_Y_SLAM +//#define PID_Z_SLAM + +//#define STEP_X + +const float SLAM_FREQ = 30.0; + +int main(int argc, char** argv) { + Logger::assignLogger(new StdLogger()); + + //****************ROS Units******************** + ros::init(argc, argv, "flight_scenario"); + ros::NodeHandle nh; + + ROSUnit* ros_updt_ctr = new ROSUnit_UpdateControllerClnt(nh); + ROSUnit* ros_info_sub = new ROSUnit_InfoSubscriber(nh); + ROSUnit* ros_restnorm_settings = new ROSUnit_RestNormSettingsClnt(nh); + + ROSUnit_Factory ROSUnit_Factory_main{nh}; + ROSUnit* ros_arm_srv = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Bool, + "arm"); +#ifdef MRFT_X_SLAM + ROSUnit* ros_mrft_trigger_x = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Float, + "mrft_switch_x"); +#endif + +#ifdef PID_X_SLAM + ROSUnit* ros_slam_pid_trigger_x = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Float, + "slam_pid_switch_x"); +#endif + +#ifdef MRFT_Y_SLAM + ROSUnit* ros_mrft_trigger_y = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Float, + "mrft_switch_y"); +#endif + +#ifdef PID_Y_SLAM + ROSUnit* ros_slam_pid_trigger_y = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Float, + "slam_pid_switch_y"); +#endif + +#ifdef MRFT_Z_SLAM + ROSUnit* ros_mrft_trigger_z = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Float, + "mrft_switch_z"); +#endif + +#ifdef PID_Z_SLAM + ROSUnit* ros_slam_pid_trigger_z = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Float, + "slam_pid_switch_z"); +#endif + + ROSUnit* ros_pos_sub = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Subscriber, + ROSUnit_msg_type::ROSUnit_Point, + "global2inertial/position"); + ROSUnit* ros_rst_ctr = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Int8, + "reset_controller"); + ROSUnit* ros_flight_command = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Server, + ROSUnit_msg_type::ROSUnit_Empty, + "flight_command");//TODO: Change to user_command + ROSUnit* ros_set_path_clnt = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Poses, + "uav_control/set_path"); + ROSUnit* ros_set_height_offset = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Float, + "set_height_offset"); + ROSUnit* rosunit_set_map_frame_offset = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Bool, + "set_map_frame_offset"); + + ROSUnit* rosunit_yaw_provider = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Subscriber, + ROSUnit_msg_type::ROSUnit_Point, + "/providers/yaw"); +// //*****************Flight Elements************* + + MissionElement* update_controller_pid_x = new UpdateController(); + MissionElement* update_controller_pid_y = new UpdateController(); + MissionElement* update_controller_pid_z = new UpdateController(); + MissionElement* update_controller_pid_roll = new UpdateController(); + MissionElement* update_controller_pid_pitch = new UpdateController(); + MissionElement* update_controller_pid_yaw = new UpdateController(); + MissionElement* update_controller_pid_yaw_rate = new UpdateController(); + + #ifdef MRFT_X_SLAM + MissionElement* update_controller_mrft_x = new UpdateController(); + MissionElement* mrft_switch_on_x=new SwitchTrigger(3); + MissionElement* mrft_switch_off_x=new SwitchTrigger(1); + #endif + + #ifdef MRFT_Y_SLAM + MissionElement* update_controller_mrft_y = new UpdateController(); + MissionElement* mrft_switch_on_y=new SwitchTrigger(3); + MissionElement* mrft_switch_off_y=new SwitchTrigger(1); + #endif + + #ifdef MRFT_Z_SLAM + MissionElement* update_controller_mrft_z = new UpdateController(); + MissionElement* mrft_switch_on_z=new SwitchTrigger(3); + MissionElement* mrft_switch_off_z=new SwitchTrigger(1); + #endif + + #ifdef PID_X_SLAM + MissionElement* update_controller_pid_salm_x = new UpdateController; + MissionElement* pid_slam_switch_on_x = new SwitchTrigger(3); + MissionElement* pid_slam_switch_off_x = new SwitchTrigger(1); + #endif + + #ifdef PID_Y_SLAM + MissionElement* update_controller_pid_salm_y = new UpdateController; + MissionElement* pid_slam_switch_on_y = new SwitchTrigger(3); + MissionElement* pid_slam_switch_off_y = new SwitchTrigger(1); + #endif + + #ifdef PID_Z_SLAM + MissionElement* update_controller_pid_salm_z = new UpdateController; + MissionElement* pid_slam_switch_on_z = new SwitchTrigger(3); + MissionElement* pid_slam_switch_off_z = new SwitchTrigger(1); + #endif + + MissionElement* reset_z = new ResetController(); + + MissionElement* arm_motors = new Arm(); + MissionElement* disarm_motors = new Disarm(); + + MissionElement* user_command = new UserCommand(); + + // MissionElement* state_monitor = new StateMonitor(); + + MissionElement* set_restricted_norm_settings = new SetRestNormSettings(true, false, 0.5); + + MissionElement* land_set_rest_norm_settings = new SetRestNormSettings(true, false, 0.15); + + MissionElement* set_height_offset = new SetHeightOffset(); + MissionElement* send_set_map_offset_signal = new SendBoolSignal(true); + MissionElement* initial_pose_waypoint = new SetRelativeWaypoint(0., 0., 0., 0.); //TODO: SetRelativeWaypoint needs substantial refactoring + + MissionElement* takeoff_relative_waypoint = new SetRelativeWaypoint(0., 0., 1.5, 0.); + MissionElement* step_relative_waypoint_x = new SetRelativeWaypoint(0.5, 0., 0.0, 0.); + MissionElement* land_relative_waypoint = new SetRelativeWaypoint(0., 0., -1.5, 0.); + + //******************Connections*************** + update_controller_pid_x->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + update_controller_pid_y->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + update_controller_pid_z->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + update_controller_pid_roll->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + update_controller_pid_pitch->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + update_controller_pid_yaw->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + update_controller_pid_yaw_rate->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + + #ifdef MRFT_X_SLAM + update_controller_mrft_x->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_1_MRFT]); + mrft_switch_on_x->getPorts()[(int)SwitchTrigger::ports_id::OP_0]->connect(ros_mrft_trigger_x->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + mrft_switch_off_x->getPorts()[(int)SwitchTrigger::ports_id::OP_0]->connect(ros_mrft_trigger_x->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + #endif + + #ifdef MRFT_Y_SLAM + update_controller_mrft_y->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_1_MRFT]); + mrft_switch_on_y->getPorts()[(int)SwitchTrigger::ports_id::OP_0]->connect(ros_mrft_trigger_y->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + mrft_switch_off_y->getPorts()[(int)SwitchTrigger::ports_id::OP_0]->connect(ros_mrft_trigger_y->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + #endif + + #ifdef MRFT_Z_SLAM + update_controller_mrft_z->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_1_MRFT]); + mrft_switch_on_z->getPorts()[(int)SwitchTrigger::ports_id::OP_0]->connect(ros_mrft_trigger_z->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + mrft_switch_off_z->getPorts()[(int)SwitchTrigger::ports_id::OP_0]->connect(ros_mrft_trigger_z->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + #endif + + #ifdef PID_X_SLAM + update_controller_pid_salm_x->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + pid_slam_switch_on_x->getPorts()[(int)SwitchTrigger::ports_id::OP_0]->connect(ros_slam_pid_trigger_x->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + pid_slam_switch_off_x->getPorts()[(int)SwitchTrigger::ports_id::OP_0]->connect(ros_slam_pid_trigger_x->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + #endif + + #ifdef PID_Y_SLAM + update_controller_pid_salm_y->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + pid_slam_switch_on_y->getPorts()[(int)SwitchTrigger::ports_id::OP_0]->connect(ros_slam_pid_trigger_y->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + pid_slam_switch_off_y->getPorts()[(int)SwitchTrigger::ports_id::OP_0]->connect(ros_slam_pid_trigger_y->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + #endif + + #ifdef PID_Z_SLAM + update_controller_pid_salm_z->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + pid_slam_switch_on_z->getPorts()[(int)SwitchTrigger::ports_id::OP_0]->connect(ros_slam_pid_trigger_z->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + pid_slam_switch_off_z->getPorts()[(int)SwitchTrigger::ports_id::OP_0]->connect(ros_slam_pid_trigger_z->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + #endif + + ros_pos_sub->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_0]->connect(initial_pose_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_0]); + rosunit_yaw_provider->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_1]->connect(initial_pose_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_1]); + + ros_pos_sub->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_0]->connect(takeoff_relative_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_0]); + rosunit_yaw_provider->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_1]->connect(takeoff_relative_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_1]); + + ros_pos_sub->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_0]->connect(land_relative_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_0]); + rosunit_yaw_provider->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_1]->connect(land_relative_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_1]); + + ros_pos_sub->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_0]->connect(step_relative_waypoint_x->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_0]); + rosunit_yaw_provider->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_1]->connect(step_relative_waypoint_x->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_1]); + + ros_pos_sub->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_0]->connect(set_height_offset->getPorts()[(int)SetHeightOffset::ports_id::IP_0]); + + reset_z->getPorts()[(int)ResetController::ports_id::OP_0]->connect(ros_rst_ctr->getPorts()[(int)ROSUnit_SetInt8Clnt::ports_id::IP_0]); + + arm_motors->getPorts()[(int)Arm::ports_id::OP_0]->connect(ros_arm_srv->getPorts()[(int)ROSUnit_SetBoolClnt::ports_id::IP_0]); + disarm_motors->getPorts()[(int)Disarm::ports_id::OP_0]->connect(ros_arm_srv->getPorts()[(int)ROSUnit_SetBoolClnt::ports_id::IP_0]); + + ros_flight_command->getPorts()[(int)ROSUnit_EmptySrv::ports_id::OP_0]->connect(user_command->getPorts()[(int)UserCommand::ports_id::IP_0]); + + set_restricted_norm_settings->getPorts()[(int)SetRestNormSettings::ports_id::OP_0]->connect(ros_restnorm_settings->getPorts()[(int)ROSUnit_RestNormSettingsClnt::ports_id::IP_0]); + land_set_rest_norm_settings->getPorts()[(int)SetRestNormSettings::ports_id::OP_0]->connect(ros_restnorm_settings->getPorts()[(int)ROSUnit_RestNormSettingsClnt::ports_id::IP_0]); + + set_height_offset->getPorts()[(int)SetHeightOffset::ports_id::OP_0]->connect(ros_set_height_offset->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + send_set_map_offset_signal->getPorts()[(int)SendBoolSignal::ports_id::OP_0]->connect(rosunit_set_map_frame_offset->getPorts()[(int)ROSUnit_SetBoolClnt::ports_id::IP_0]); + initial_pose_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + takeoff_relative_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + step_relative_waypoint_x->getPorts()[(int)SetRelativeWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + + //absolute_zero_Z_relative_waypoint->connect(ros_set_path_clnt); + land_relative_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + + //*************Setting Flight Elements************* + + ((UpdateController*)update_controller_pid_x)->pid_data.kp = 0.6534; + ((UpdateController*)update_controller_pid_x)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_x)->pid_data.kd = 0.3831; + ((UpdateController*)update_controller_pid_x)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_x)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_x)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_x)->pid_data.dt = (float)1.0/120.0; + ((UpdateController*)update_controller_pid_x)->pid_data.id = block_id::PID_X; + + ((UpdateController*)update_controller_pid_y)->pid_data.kp = 0.7176; + ((UpdateController*)update_controller_pid_y)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_y)->pid_data.kd = 0.4208; + ((UpdateController*)update_controller_pid_y)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_y)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_y)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_y)->pid_data.dt = (float)1.0/120.0; + ((UpdateController*)update_controller_pid_y)->pid_data.id = block_id::PID_Y; + + ((UpdateController*)update_controller_pid_z)->pid_data.kp = 0.785493; + ((UpdateController*)update_controller_pid_z)->pid_data.ki = 0.24; + ((UpdateController*)update_controller_pid_z)->pid_data.kd = 0.239755; + ((UpdateController*)update_controller_pid_z)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_z)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_z)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_z)->pid_data.dt = (float)1.0/120.0; + ((UpdateController*)update_controller_pid_z)->pid_data.id = block_id::PID_Z; + + ((UpdateController*)update_controller_pid_roll)->pid_data.kp = 0.3265; + ((UpdateController*)update_controller_pid_roll)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_roll)->pid_data.kd = 0.0565; + ((UpdateController*)update_controller_pid_roll)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_roll)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_roll)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_roll)->pid_data.dt = 1.f/200.f; + ((UpdateController*)update_controller_pid_roll)->pid_data.id = block_id::PID_ROLL; + + ((UpdateController*)update_controller_pid_pitch)->pid_data.kp = 0.3569; + ((UpdateController*)update_controller_pid_pitch)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_pitch)->pid_data.kd = 0.0617; + ((UpdateController*)update_controller_pid_pitch)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_pitch)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_pitch)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_pitch)->pid_data.dt = 1.f/200.f; + ((UpdateController*)update_controller_pid_pitch)->pid_data.id = block_id::PID_PITCH; + + ((UpdateController*)update_controller_pid_yaw)->pid_data.kp = 3.2; + ((UpdateController*)update_controller_pid_yaw)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.kd = 0.0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_yaw)->pid_data.dt = 1.f/120.f; + ((UpdateController*)update_controller_pid_yaw)->pid_data.id = block_id::PID_YAW; + + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.kp = 0.32; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.kd = 0.0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.dt = 1.f/200.f; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.id = block_id::PID_YAW_RATE; + +#ifdef MRFT_X_SLAM + ((UpdateController*)update_controller_mrft_x)->mrft_data.beta = -0.6475; + ((UpdateController*)update_controller_mrft_x)->mrft_data.relay_amp = 0.15; + ((UpdateController*)update_controller_mrft_x)->mrft_data.bias = 0.0; + // ((UpdateController*)update_controller_mrft_x)->mrft_data.num_of_peak_conf_samples = 2; + // ((UpdateController*)update_controller_mrft_x)->mrft_data.no_switch_delay_in_ms = 100; + ((UpdateController*)update_controller_mrft_x)->mrft_data.id = block_id::MRFT_X; +#endif + +#ifdef MRFT_Y_SLAM + ((UpdateController*)update_controller_mrft_y)->mrft_data.beta = -0.6475; + ((UpdateController*)update_controller_mrft_y)->mrft_data.relay_amp = 0.15; + ((UpdateController*)update_controller_mrft_y)->mrft_data.bias = 0.0; + // ((UpdateController*)update_controller_mrft_y)->mrft_data.no_switch_delay_in_ms = 100.0; + // ((UpdateController*)update_controller_mrft_y)->mrft_data.num_of_peak_conf_samples = 2; + ((UpdateController*)update_controller_mrft_y)->mrft_data.id = block_id::MRFT_Y; +#endif + +#ifdef MRFT_Z_SLAM + ((UpdateController*)update_controller_mrft_z)->mrft_data.beta = -0.73; + ((UpdateController*)update_controller_mrft_z)->mrft_data.relay_amp = 0.15; //0.1; + ((UpdateController*)update_controller_mrft_z)->mrft_data.bias = 0.0; + ((UpdateController*)update_controller_mrft_z)->mrft_data.id = block_id::MRFT_Z; +#endif + +#ifdef PID_X_SLAM + ((UpdateController*)update_controller_pid_salm_x)->pid_data.kp = 0.28896; + ((UpdateController*)update_controller_pid_salm_x)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_salm_x)->pid_data.kd = 0.2128; + ((UpdateController*)update_controller_pid_salm_x)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_salm_x)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_salm_x)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_salm_x)->pid_data.dt = (float)1.0/SLAM_FREQ; + ((UpdateController*)update_controller_pid_salm_x)->pid_data.id = block_id::PID_SLAM_X; +#endif + +#ifdef PID_Y_SLAM + ((UpdateController*)update_controller_pid_salm_y)->pid_data.kp = 0.2350; + ((UpdateController*)update_controller_pid_salm_y)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_salm_y)->pid_data.kd = 0.1731; + ((UpdateController*)update_controller_pid_salm_y)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_salm_y)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_salm_y)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_salm_y)->pid_data.dt = (float)1.0/SLAM_FREQ; + ((UpdateController*)update_controller_pid_salm_y)->pid_data.id = block_id::PID_SLAM_Y; +#endif + +#ifdef PID_Z_SLAM + ((UpdateController*)update_controller_pid_salm_z)->pid_data.kp = 0.2644; + ((UpdateController*)update_controller_pid_salm_z)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_salm_z)->pid_data.kd = 0.1614; + ((UpdateController*)update_controller_pid_salm_z)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_salm_z)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_salm_z)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_salm_z)->pid_data.dt = (float)1.0/SLAM_FREQ; + ((UpdateController*)update_controller_pid_salm_z)->pid_data.id = block_id::PID_SLAM_Z; +#endif + + ((ResetController*)reset_z)->target_block = block_id::PID_Z; + + Wait wait_1s; + wait_1s.wait_time_ms=1000; + + Wait wait_100ms; + wait_100ms.wait_time_ms=100; + + Wait wait_5s; + wait_5s.wait_time_ms=5000; + + MissionPipeline mrft_pipeline; + + mrft_pipeline.addElement((MissionElement*)&wait_1s); + + mrft_pipeline.addElement((MissionElement*)update_controller_pid_x); + mrft_pipeline.addElement((MissionElement*)update_controller_pid_y); + mrft_pipeline.addElement((MissionElement*)update_controller_pid_z); + mrft_pipeline.addElement((MissionElement*)update_controller_pid_roll); + mrft_pipeline.addElement((MissionElement*)update_controller_pid_pitch); + mrft_pipeline.addElement((MissionElement*)update_controller_pid_yaw); + mrft_pipeline.addElement((MissionElement*)update_controller_pid_yaw_rate); + + #ifdef MRFT_X_SLAM + mrft_pipeline.addElement((MissionElement*)update_controller_mrft_x); + #endif + + #ifdef MRFT_Y_SLAM + mrft_pipeline.addElement((MissionElement*)update_controller_mrft_y); + #endif + + #ifdef MRFT_Z_SLAM + mrft_pipeline.addElement((MissionElement*)update_controller_mrft_z); + #endif + + #ifdef PID_X_SLAM + mrft_pipeline.addElement((MissionElement*)update_controller_pid_salm_x); + #endif + + #ifdef PID_Y_SLAM + mrft_pipeline.addElement((MissionElement*)update_controller_pid_salm_y); + #endif + + #ifdef PID_Z_SLAM + mrft_pipeline.addElement((MissionElement*)update_controller_pid_salm_z); + #endif + + mrft_pipeline.addElement((MissionElement*)set_height_offset); //TODO: (CHECK Desc) Set a constant height command/reference based on the current pos + mrft_pipeline.addElement((MissionElement*)&wait_1s); + mrft_pipeline.addElement((MissionElement*)set_restricted_norm_settings); + mrft_pipeline.addElement((MissionElement*)initial_pose_waypoint); + mrft_pipeline.addElement((MissionElement*)user_command); + mrft_pipeline.addElement((MissionElement*)send_set_map_offset_signal); + mrft_pipeline.addElement((MissionElement*)reset_z); //Reset I-term to zero + mrft_pipeline.addElement((MissionElement*)&wait_100ms); + mrft_pipeline.addElement((MissionElement*)arm_motors); + mrft_pipeline.addElement((MissionElement*)user_command); +// mrft_pipeline.addElement((MissionElement*)&wait_1s); + + mrft_pipeline.addElement((MissionElement*)reset_z); //Reset I-term to zero + mrft_pipeline.addElement((MissionElement*)takeoff_relative_waypoint); + + mrft_pipeline.addElement((MissionElement*)user_command); +// mrft_pipeline.addElement((MissionElement*)&wait_5s); + + #ifdef MRFT_X_SLAM + mrft_pipeline.addElement((MissionElement*)mrft_switch_on_x); + #endif + + #ifdef MRFT_Y_SLAM + mrft_pipeline.addElement((MissionElement*)mrft_switch_on_y); + #endif + + #ifdef MRFT_Z_SLAM + mrft_pipeline.addElement((MissionElement*)mrft_switch_on_z); + #endif + + #ifdef PID_X_SLAM + mrft_pipeline.addElement((MissionElement*)pid_slam_switch_on_x); + #endif + + #ifdef PID_Y_SLAM + mrft_pipeline.addElement((MissionElement*)pid_slam_switch_on_y); + #endif + + #ifdef PID_Z_SLAM + mrft_pipeline.addElement((MissionElement*)pid_slam_switch_on_z); + #endif + + #ifdef STEP_X + mrft_pipeline.addElement((MissionElement*)user_command); + mrft_pipeline.addElement((MissionElement*)step_relative_waypoint_x); + #endif + + mrft_pipeline.addElement((MissionElement*)user_command); +// mrft_pipeline.addElement((MissionElement*)&wait_5s); + + mrft_pipeline.addElement((MissionElement*)initial_pose_waypoint); + + #ifdef MRFT_X_SLAM + mrft_pipeline.addElement((MissionElement*)mrft_switch_off_x); + #endif + + #ifdef MRFT_Y_SLAM + mrft_pipeline.addElement((MissionElement*)mrft_switch_off_y); + #endif + + #ifdef MRFT_Z_SLAM + mrft_pipeline.addElement((MissionElement*)mrft_switch_off_z); + #endif + + #ifdef PID_X_SLAM + mrft_pipeline.addElement((MissionElement*)pid_slam_switch_off_x); + #endif + + #ifdef PID_Y_SLAM + mrft_pipeline.addElement((MissionElement*)pid_slam_switch_off_y); + #endif + + #ifdef PID_Z_SLAM + mrft_pipeline.addElement((MissionElement*)pid_slam_switch_off_z); + #endif + + mrft_pipeline.addElement((MissionElement*)user_command); +// mrft_pipeline.addElement((MissionElement*)&wait_1s); + + mrft_pipeline.addElement((MissionElement*)land_set_rest_norm_settings); + mrft_pipeline.addElement((MissionElement*)&wait_100ms); + mrft_pipeline.addElement((MissionElement*)land_relative_waypoint); + + + Logger::getAssignedLogger()->log("FlightScenario main_scenario",LoggerLevel::Info); + MissionScenario main_scenario; + + main_scenario.AddMissionPipeline(&mrft_pipeline); + + main_scenario.StartScenario(); + Logger::getAssignedLogger()->log("Main Done",LoggerLevel::Info); + std::cout << "OK \n"; + while(ros::ok){ + ros::spinOnce(); + } + return 0; +} \ No newline at end of file diff --git a/example_node/example_node.cpp b/example_node/example_node.cpp index 6bb1108..db15ee5 100644 --- a/example_node/example_node.cpp +++ b/example_node/example_node.cpp @@ -22,7 +22,6 @@ #include "HEAR_ROS_BRIDGE/ROSUnit_UpdateControllerSrv.hpp" #include "HEAR_control/PIDController.hpp" // -#include "HEAR_ROS_BRIDGE/ROSUnit_OrientationSubscriber.hpp" #include "HEAR_ROS_BRIDGE/ROSUnit_InfoSubscriber.hpp" #include "HEAR_ROS_BRIDGE/ROSUnit_Factory.hpp" #include "HEAR_ROS_BRIDGE/ROSUnit_RestNormSettingsClnt.hpp" diff --git a/example_node/mrft_scenario.cpp b/example_node/mrft_scenario.cpp new file mode 100644 index 0000000..fda269a --- /dev/null +++ b/example_node/mrft_scenario.cpp @@ -0,0 +1,440 @@ +// UAV controller tuning for roll pitch and z channels +#include + +#include "HEAR_core/std_logger.hpp" +#include "HEAR_mission/Wait.hpp" +#include "HEAR_mission/WaitForCondition.hpp" +#include "HEAR_mission/Arm.hpp" +#include "HEAR_mission/Disarm.hpp" +#include "HEAR_mission/MissionScenario.hpp" +#include "HEAR_mission/UserCommand.hpp" +#include "HEAR_mission/SetRestNormSettings.hpp" +#include "HEAR_mission/SetHeightOffset.hpp" +#include "HEAR_mission/SendBoolSignal.hpp" +#include "HEAR_mission/ResetController.hpp" +#include "HEAR_mission/SetRelativeWaypoint.hpp" +#include "HEAR_mission/SwitchTrigger.hpp" +#include "HEAR_mission/SetAbsoluteWaypoint.hpp" +#include "HEAR_mission/UpdateController.hpp" +#include "HEAR_ROS_BRIDGE/ROSUnit_UpdateControllerClnt.hpp" +#include "HEAR_math/ConstantFloat.hpp" +#include "HEAR_ROS_BRIDGE/ROSUnit_UpdateControllerSrv.hpp" +#include "HEAR_control/PIDController.hpp" +#include "HEAR_ROS_BRIDGE/ROSUnit_InfoSubscriber.hpp" +#include "HEAR_ROS_BRIDGE/ROSUnit_Factory.hpp" +#include "HEAR_ROS_BRIDGE/ROSUnit_RestNormSettingsClnt.hpp" +#include "HEAR_ROS_BRIDGE/ROSUnit_ControlOutputSubscriber.hpp" + +#define MRFT_ROLL_CHAN +#define MRFT_PITCH_CHAN +//#define MRFT_Z_CHAN + +#define SMALL_HEXA + +int main(int argc, char** argv) { + Logger::assignLogger(new StdLogger()); + + //****************ROS Units******************** + ros::init(argc, argv, "flight_scenario"); + ros::NodeHandle nh; + + ROSUnit* ros_updt_ctr = new ROSUnit_UpdateControllerClnt(nh); + ROSUnit* ros_info_sub = new ROSUnit_InfoSubscriber(nh); + ROSUnit* ros_restnorm_settings = new ROSUnit_RestNormSettingsClnt(nh); + + ROSUnit_Factory ROSUnit_Factory_main{nh}; + ROSUnit* ros_arm_srv = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Bool, + "arm"); +#ifdef MRFT_ROLL_CHAN + ROSUnit* ros_mrft_trigger_roll = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Float, + "mrft_switch_roll"); +#endif + +#ifdef MRFT_PITCH_CHAN + ROSUnit* ros_mrft_trigger_pitch = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Float, + "mrft_switch_pitch"); +#endif + +#ifdef MRFT_Z_CHAN + ROSUnit* ros_mrft_trigger_z = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Float, + "mrft_switch_z"); +#endif + + ROSUnit* ros_pos_sub = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Subscriber, + ROSUnit_msg_type::ROSUnit_Point, + "global2inertial/position"); + ROSUnit* ros_rst_ctr = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Int8, + "reset_controller"); + ROSUnit* ros_flight_command = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Server, + ROSUnit_msg_type::ROSUnit_Empty, + "flight_command");//TODO: Change to user_command + ROSUnit* ros_set_path_clnt = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Poses, + "uav_control/set_path"); + ROSUnit* ros_set_height_offset = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Float, + "set_height_offset"); + ROSUnit* rosunit_yaw_provider = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Subscriber, + ROSUnit_msg_type::ROSUnit_Point, + "/providers/yaw"); +// //*****************Flight Elements************* + + MissionElement* update_controller_pid_x = new UpdateController(); + MissionElement* update_controller_pid_y = new UpdateController(); + MissionElement* update_controller_pid_z = new UpdateController(); + MissionElement* update_controller_pid_roll = new UpdateController(); + MissionElement* update_controller_pid_pitch = new UpdateController(); + MissionElement* update_controller_pid_yaw = new UpdateController(); + MissionElement* update_controller_pid_yaw_rate = new UpdateController(); + + #ifdef MRFT_ROLL_CHAN + MissionElement* update_controller_mrft_roll = new UpdateController(); + MissionElement* mrft_switch_on_roll = new SwitchTrigger(3); + MissionElement* mrft_switch_off_roll = new SwitchTrigger(1); + #endif + + #ifdef MRFT_PITCH_CHAN + MissionElement* update_controller_mrft_pitch = new UpdateController(); + MissionElement* mrft_switch_on_pitch = new SwitchTrigger(3); + MissionElement* mrft_switch_off_pitch = new SwitchTrigger(1); + #endif + + #ifdef MRFT_Z_CHAN + MissionElement* update_controller_mrft_z = new UpdateController(); + MissionElement* mrft_switch_on_z=new SwitchTrigger(3); + MissionElement* mrft_switch_off_z=new SwitchTrigger(1); + #endif + + MissionElement* reset_z = new ResetController(); + + MissionElement* arm_motors = new Arm(); + MissionElement* disarm_motors = new Disarm(); + + MissionElement* user_command = new UserCommand(); + + // MissionElement* state_monitor = new StateMonitor(); + + MissionElement* set_restricted_norm_settings = new SetRestNormSettings(true, false, 0.5); + + MissionElement* land_set_rest_norm_settings = new SetRestNormSettings(true, false, 0.15); + + MissionElement* set_height_offset = new SetHeightOffset(); + MissionElement* initial_pose_waypoint = new SetRelativeWaypoint(0., 0., 0., 0.); //TODO: SetRelativeWaypoint needs substantial refactoring + + + MissionElement* takeoff_relative_waypoint = new SetRelativeWaypoint(0., 0., 1.5, 0.); + MissionElement* forward_1m = new SetRelativeWaypoint(1.0, 0., 0.0, 0.); + MissionElement* land_relative_waypoint = new SetRelativeWaypoint(0., 0., -2., 0.); + + //******************Connections*************** + update_controller_pid_x->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + update_controller_pid_y->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + update_controller_pid_z->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + update_controller_pid_roll->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + update_controller_pid_pitch->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + update_controller_pid_yaw->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + update_controller_pid_yaw_rate->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + + #ifdef MRFT_ROLL_CHAN + update_controller_mrft_roll->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_1_MRFT]); + mrft_switch_on_roll->getPorts()[(int)SwitchTrigger::ports_id::OP_0]->connect(ros_mrft_trigger_roll->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + mrft_switch_off_roll->getPorts()[(int)SwitchTrigger::ports_id::OP_0]->connect(ros_mrft_trigger_roll->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + #endif + + #ifdef MRFT_PITCH_CHAN + update_controller_mrft_pitch->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_1_MRFT]); + mrft_switch_on_pitch->getPorts()[(int)SwitchTrigger::ports_id::OP_0]->connect(ros_mrft_trigger_pitch->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + mrft_switch_off_pitch->getPorts()[(int)SwitchTrigger::ports_id::OP_0]->connect(ros_mrft_trigger_pitch->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + #endif + + #ifdef MRFT_Z_CHAN + update_controller_mrft_z->getPorts()[(int)UpdateController::ports_id::OP_0]->connect(ros_updt_ctr->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_1_MRFT]); + mrft_switch_on_z->getPorts()[(int)SwitchTrigger::ports_id::OP_0]->connect(ros_mrft_trigger_z->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + mrft_switch_off_z->getPorts()[(int)SwitchTrigger::ports_id::OP_0]->connect(ros_mrft_trigger_z->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + #endif + + ros_pos_sub->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_0]->connect(initial_pose_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_0]); + rosunit_yaw_provider->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_1]->connect(initial_pose_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_1]); + + ros_pos_sub->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_0]->connect(takeoff_relative_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_0]); + rosunit_yaw_provider->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_1]->connect(takeoff_relative_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_1]); + + ros_pos_sub->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_0]->connect(forward_1m->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_0]); + rosunit_yaw_provider->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_1]->connect(forward_1m->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_1]); + + ros_pos_sub->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_0]->connect(land_relative_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_0]); + rosunit_yaw_provider->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_1]->connect(land_relative_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_1]); + + ros_pos_sub->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_0]->connect(set_height_offset->getPorts()[(int)SetHeightOffset::ports_id::IP_0]); + + reset_z->getPorts()[(int)ResetController::ports_id::OP_0]->connect(ros_rst_ctr->getPorts()[(int)ROSUnit_SetInt8Clnt::ports_id::IP_0]); + + arm_motors->getPorts()[(int)Arm::ports_id::OP_0]->connect(ros_arm_srv->getPorts()[(int)ROSUnit_SetBoolClnt::ports_id::IP_0]); + disarm_motors->getPorts()[(int)Disarm::ports_id::OP_0]->connect(ros_arm_srv->getPorts()[(int)ROSUnit_SetBoolClnt::ports_id::IP_0]); + + ros_flight_command->getPorts()[(int)ROSUnit_EmptySrv::ports_id::OP_0]->connect(user_command->getPorts()[(int)UserCommand::ports_id::IP_0]); + + set_restricted_norm_settings->getPorts()[(int)SetRestNormSettings::ports_id::OP_0]->connect(ros_restnorm_settings->getPorts()[(int)ROSUnit_RestNormSettingsClnt::ports_id::IP_0]); + land_set_rest_norm_settings->getPorts()[(int)SetRestNormSettings::ports_id::OP_0]->connect(ros_restnorm_settings->getPorts()[(int)ROSUnit_RestNormSettingsClnt::ports_id::IP_0]); + + set_height_offset->getPorts()[(int)SetHeightOffset::ports_id::OP_0]->connect(ros_set_height_offset->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + initial_pose_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + takeoff_relative_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + forward_1m->getPorts()[(int)SetRelativeWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + + //absolute_zero_Z_relative_waypoint->connect(ros_set_path_clnt); + land_relative_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + + //*************Setting Flight Elements************* + #ifdef SMALL_HEXA + ((UpdateController*)update_controller_pid_x)->pid_data.kp = 0.51639 * 0.8; // 0.696435; + ((UpdateController*)update_controller_pid_x)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_x)->pid_data.kd = 0.21192 * 0.8; // 0.375166; + ((UpdateController*)update_controller_pid_x)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_x)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_x)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_x)->pid_data.dt = (float)1.0/120.0; + ((UpdateController*)update_controller_pid_x)->pid_data.id = block_id::PID_X; + + ((UpdateController*)update_controller_pid_y)->pid_data.kp = 0.51639 * 0.8; // 0.568331; + ((UpdateController*)update_controller_pid_y)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_y)->pid_data.kd = 0.21192 * 0.8; // 0.306157; + ((UpdateController*)update_controller_pid_y)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_y)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_y)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_y)->pid_data.dt = (float)1.0/120.0; + ((UpdateController*)update_controller_pid_y)->pid_data.id = block_id::PID_Y; + + ((UpdateController*)update_controller_pid_z)->pid_data.kp = 0.730936; + ((UpdateController*)update_controller_pid_z)->pid_data.ki = 0.0980*2; + ((UpdateController*)update_controller_pid_z)->pid_data.kd = 0.190225; + ((UpdateController*)update_controller_pid_z)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_z)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_z)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_z)->pid_data.dt = (float)1.0/120.0; + ((UpdateController*)update_controller_pid_z)->pid_data.id = block_id::PID_Z; + + ((UpdateController*)update_controller_pid_roll)->pid_data.kp = 0.225 * 0.8; // 0.2121; //0.172195; //0.3302; //0.286708; + ((UpdateController*)update_controller_pid_roll)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_roll)->pid_data.kd = 0.04 * 0.8; // 0.0489; //0.042464; //0.0931; //0.056559; + ((UpdateController*)update_controller_pid_roll)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_roll)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_roll)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_roll)->pid_data.dt = 1.f/200.f; + ((UpdateController*)update_controller_pid_roll)->pid_data.id = block_id::PID_ROLL; + + ((UpdateController*)update_controller_pid_pitch)->pid_data.kp = 0.225 * 0.8; // 0.2506;// 0.3360; //0.2811;//0.275252; + ((UpdateController*)update_controller_pid_pitch)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_pitch)->pid_data.kd = 0.04 * 0.8; //0.0578;//0.0684; //0.053100; //0.0868;// 0.051266; + ((UpdateController*)update_controller_pid_pitch)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_pitch)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_pitch)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_pitch)->pid_data.dt = 1.f/200.f; + ((UpdateController*)update_controller_pid_pitch)->pid_data.id = block_id::PID_PITCH; + + ((UpdateController*)update_controller_pid_yaw)->pid_data.kp = 1.6 * 2; + ((UpdateController*)update_controller_pid_yaw)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.kd = 0.0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_yaw)->pid_data.dt = 1.f/120.f; + ((UpdateController*)update_controller_pid_yaw)->pid_data.id = block_id::PID_YAW; + + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.kp = 0.16 * 2; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.kd = 0.0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.dt = 1.f/200.f; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.id = block_id::PID_YAW_RATE; +#else + ((UpdateController*)update_controller_pid_x)->pid_data.kp = 0.6534; + ((UpdateController*)update_controller_pid_x)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_x)->pid_data.kd = 0.3831; + ((UpdateController*)update_controller_pid_x)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_x)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_x)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_x)->pid_data.dt = (float)1.0/120.0; + ((UpdateController*)update_controller_pid_x)->pid_data.id = block_id::PID_X; + + ((UpdateController*)update_controller_pid_y)->pid_data.kp = 0.7176; + ((UpdateController*)update_controller_pid_y)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_y)->pid_data.kd = 0.4208; + ((UpdateController*)update_controller_pid_y)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_y)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_y)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_y)->pid_data.dt = (float)1.0/120.0; + ((UpdateController*)update_controller_pid_y)->pid_data.id = block_id::PID_Y; + + ((UpdateController*)update_controller_pid_z)->pid_data.kp = 0.785493; + ((UpdateController*)update_controller_pid_z)->pid_data.ki = 0.098; + ((UpdateController*)update_controller_pid_z)->pid_data.kd = 0.239755; + ((UpdateController*)update_controller_pid_z)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_z)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_z)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_z)->pid_data.dt = (float)1.0/120.0; + ((UpdateController*)update_controller_pid_z)->pid_data.id = block_id::PID_Z; + + ((UpdateController*)update_controller_pid_roll)->pid_data.kp = 0.3227; + ((UpdateController*)update_controller_pid_roll)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_roll)->pid_data.kd = 0.0558; + ((UpdateController*)update_controller_pid_roll)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_roll)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_roll)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_roll)->pid_data.dt = 1.f/200.f; + ((UpdateController*)update_controller_pid_roll)->pid_data.id = block_id::PID_ROLL; + + ((UpdateController*)update_controller_pid_pitch)->pid_data.kp = 0.2981; + ((UpdateController*)update_controller_pid_pitch)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_pitch)->pid_data.kd = 0.0515; + ((UpdateController*)update_controller_pid_pitch)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_pitch)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_pitch)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_pitch)->pid_data.dt = 1.f/200.f; + ((UpdateController*)update_controller_pid_pitch)->pid_data.id = block_id::PID_PITCH; + + ((UpdateController*)update_controller_pid_yaw)->pid_data.kp = 3.2; + ((UpdateController*)update_controller_pid_yaw)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.kd = 0.0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_yaw)->pid_data.dt = 1.f/120.f; + ((UpdateController*)update_controller_pid_yaw)->pid_data.id = block_id::PID_YAW; + + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.kp = 0.32; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.kd = 0.0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.dt = 1.f/200.f; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.id = block_id::PID_YAW_RATE; +#endif + +#ifdef MRFT_ROLL_CHAN + ((UpdateController*)update_controller_mrft_roll)->mrft_data.beta = -0.73; + ((UpdateController*)update_controller_mrft_roll)->mrft_data.relay_amp = 0.04; + ((UpdateController*)update_controller_mrft_roll)->mrft_data.bias = 0.0; + ((UpdateController*)update_controller_mrft_roll)->mrft_data.id = block_id::MRFT_ROLL; +#endif + +#ifdef MRFT_PITCH_CHAN + ((UpdateController*)update_controller_mrft_pitch)->mrft_data.beta = -0.73; + ((UpdateController*)update_controller_mrft_pitch)->mrft_data.relay_amp = 0.04; + ((UpdateController*)update_controller_mrft_pitch)->mrft_data.bias = 0.0; + ((UpdateController*)update_controller_mrft_pitch)->mrft_data.id = block_id::MRFT_PITCH; +#endif + +#ifdef MRFT_Z_CHAN + ((UpdateController*)update_controller_mrft_z)->mrft_data.beta = -0.73; + ((UpdateController*)update_controller_mrft_z)->mrft_data.relay_amp = 0.1; //0.1; + ((UpdateController*)update_controller_mrft_z)->mrft_data.bias = 0.0; + ((UpdateController*)update_controller_mrft_z)->mrft_data.id = block_id::MRFT_Z; +#endif + + ((ResetController*)reset_z)->target_block = block_id::PID_Z; + + Wait wait_1s; + wait_1s.wait_time_ms=1000; + + Wait wait_100ms; + wait_100ms.wait_time_ms=100; + + Wait wait_700ms; + wait_700ms.wait_time_ms =500; + + MissionPipeline mrft_pipeline; + + mrft_pipeline.addElement((MissionElement*)&wait_1s); + + mrft_pipeline.addElement((MissionElement*)update_controller_pid_x); + mrft_pipeline.addElement((MissionElement*)update_controller_pid_y); + mrft_pipeline.addElement((MissionElement*)update_controller_pid_z); + mrft_pipeline.addElement((MissionElement*)update_controller_pid_roll); + mrft_pipeline.addElement((MissionElement*)update_controller_pid_pitch); + mrft_pipeline.addElement((MissionElement*)update_controller_pid_yaw); + mrft_pipeline.addElement((MissionElement*)update_controller_pid_yaw_rate); + + #ifdef MRFT_ROLL_CHAN + mrft_pipeline.addElement((MissionElement*)update_controller_mrft_roll); + #endif + + #ifdef MRFT_PITCH_CHAN + mrft_pipeline.addElement((MissionElement*)update_controller_mrft_pitch); + #endif + + #ifdef MRFT_Z_CHAN + mrft_pipeline.addElement((MissionElement*)update_controller_mrft_z); + #endif + + mrft_pipeline.addElement((MissionElement*)set_height_offset); //TODO: (CHECK Desc) Set a constant height command/reference based on the current pos + mrft_pipeline.addElement((MissionElement*)&wait_1s); + mrft_pipeline.addElement((MissionElement*)set_restricted_norm_settings); + mrft_pipeline.addElement((MissionElement*)initial_pose_waypoint); + mrft_pipeline.addElement((MissionElement*)user_command); + mrft_pipeline.addElement((MissionElement*)reset_z); //Reset I-term to zero + mrft_pipeline.addElement((MissionElement*)&wait_100ms); + mrft_pipeline.addElement((MissionElement*)arm_motors); + mrft_pipeline.addElement((MissionElement*)user_command); + mrft_pipeline.addElement((MissionElement*)reset_z); //Reset I-term to zero + mrft_pipeline.addElement((MissionElement*)takeoff_relative_waypoint); + // mrft_pipeline.addElement((MissionElement*)user_command); + mrft_pipeline.addElement((MissionElement*)&wait_700ms); + + #ifdef MRFT_ROLL_CHAN + mrft_pipeline.addElement((MissionElement*)mrft_switch_on_roll); + #endif + + #ifdef MRFT_PITCH_CHAN + mrft_pipeline.addElement((MissionElement*)mrft_switch_on_pitch); + #endif + + #ifdef MRFT_Z_CHAN + mrft_pipeline.addElement((MissionElement*)mrft_switch_on_z); + #endif + + mrft_pipeline.addElement((MissionElement*)user_command); + mrft_pipeline.addElement((MissionElement*)initial_pose_waypoint); + + #ifdef MRFT_ROLL_CHAN + mrft_pipeline.addElement((MissionElement*)mrft_switch_off_roll); + #endif + + #ifdef MRFT_PITCH_CHAN + mrft_pipeline.addElement((MissionElement*)mrft_switch_off_pitch); + #endif + + #ifdef MRFT_Z_CHAN + mrft_pipeline.addElement((MissionElement*)mrft_switch_off_z); + #endif + + mrft_pipeline.addElement((MissionElement*)user_command); + mrft_pipeline.addElement((MissionElement*)forward_1m); + mrft_pipeline.addElement((MissionElement*)user_command); + + mrft_pipeline.addElement((MissionElement*)land_set_rest_norm_settings); + mrft_pipeline.addElement((MissionElement*)&wait_100ms); + mrft_pipeline.addElement((MissionElement*)land_relative_waypoint); + + + Logger::getAssignedLogger()->log("FlightScenario main_scenario",LoggerLevel::Info); + MissionScenario main_scenario; + + main_scenario.AddMissionPipeline(&mrft_pipeline); + + main_scenario.StartScenario(); + Logger::getAssignedLogger()->log("Main Done",LoggerLevel::Info); + std::cout << "OK \n"; + while(ros::ok){ + ros::spinOnce(); + } + return 0; +} \ No newline at end of file diff --git a/example_node/test_node.cpp b/example_node/test_node.cpp new file mode 100644 index 0000000..314a496 --- /dev/null +++ b/example_node/test_node.cpp @@ -0,0 +1,381 @@ +//TODO: Check again the whole naming and archeticting of SetRelativeWaypoint and SetAbsoluteWaypoint +#include + +#include "HEAR_core/std_logger.hpp" +#include "HEAR_mission/Wait.hpp" +#include "HEAR_mission/WaitForCondition.hpp" +#include "HEAR_mission/Arm.hpp" +#include "HEAR_mission/Disarm.hpp" +#include "HEAR_mission/MissionScenario.hpp" +#include "HEAR_mission/UserCommand.hpp" +#include "HEAR_mission/SetRestNormSettings.hpp" +#include "HEAR_mission/SetHeightOffset.hpp" +#include "HEAR_mission/ResetController.hpp" +#include "HEAR_mission/SetRelativeWaypoint.hpp" +#include "HEAR_mission/SetAbsoluteWaypoint.hpp" +#include "HEAR_mission/UpdateController.hpp" +#include "HEAR_ROS_BRIDGE/ROSUnit_UpdateControllerClnt.hpp" +// +#include "HEAR_ROS_BRIDGE/ROSUnit_UpdateControllerSrv.hpp" +#include "HEAR_control/PIDController.hpp" +// +#include "HEAR_ROS_BRIDGE/ROSUnit_InfoSubscriber.hpp" +#include "HEAR_ROS_BRIDGE/ROSUnit_Factory.hpp" +#include "HEAR_ROS_BRIDGE/ROSUnit_RestNormSettingsClnt.hpp" +#include "HEAR_ROS_BRIDGE/ROSUnit_ControlOutputSubscriber.hpp" + +// #include "ChangeInternalState.hpp" +// #include "InternalSystemStateCondition.hpp" +// #include "StateMonitor.hpp" + +//#define AUTO_TEST +#define TESTING +<<<<<<< HEAD +//#define BIG_HEXA +======= +#undef BIG_HEXA +>>>>>>> 3d4646fdc27ca8a39c3f5d740c641b241115caf9 +#define SMALL_HEXA + +int main(int argc, char** argv) { + Logger::assignLogger(new StdLogger()); + + //****************ROS Units******************** + ros::init(argc, argv, "flight_scenario"); + ros::NodeHandle nh; + + ROSUnit* ros_updt_ctr = new ROSUnit_UpdateControllerClnt(nh); + ROSUnit* ros_info_sub = new ROSUnit_InfoSubscriber(nh); + ROSUnit* ros_restnorm_settings = new ROSUnit_RestNormSettingsClnt(nh); + + ROSUnit_Factory ROSUnit_Factory_main{nh}; + ROSUnit* ros_arm_srv = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Bool, + "arm"); + ROSUnit* ros_pos_sub = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Subscriber, + ROSUnit_msg_type::ROSUnit_Point, + "global2inertial/position"); + ROSUnit* ros_rst_ctr = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Int8, + "reset_controller"); + ROSUnit* ros_flight_command = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Server, + ROSUnit_msg_type::ROSUnit_Empty, + "flight_command");//TODO: Change to user_command + ROSUnit* ros_set_path_clnt = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Poses, + "uav_control/set_path"); + ROSUnit* ros_set_height_offset = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Client, + ROSUnit_msg_type::ROSUnit_Float, + "set_height_offset"); + ROSUnit* rosunit_yaw_provider = ROSUnit_Factory_main.CreateROSUnit(ROSUnit_tx_rx_type::Subscriber, + ROSUnit_msg_type::ROSUnit_Point, + "/providers/yaw"); +// //*****************Flight Elements************* + + MissionElement* update_controller_pid_x = new UpdateController(); + MissionElement* update_controller_pid_y = new UpdateController(); + MissionElement* update_controller_pid_z = new UpdateController(); + MissionElement* update_controller_pid_roll = new UpdateController(); + MissionElement* update_controller_pid_pitch = new UpdateController(); + MissionElement* update_controller_pid_yaw = new UpdateController(); + MissionElement* update_controller_pid_yaw_rate = new UpdateController(); + + MissionElement* reset_z = new ResetController(); + + MissionElement* arm_motors = new Arm(); + MissionElement* disarm_motors = new Disarm(); + + MissionElement* user_command = new UserCommand(); + + // MissionElement* state_monitor = new StateMonitor(); + + MissionElement* set_restricted_norm_settings = new SetRestNormSettings(true, false, .5); + + MissionElement* land_set_rest_norm_settings = new SetRestNormSettings(true, false, 0.15); + MissionElement* waypoint_set_rest_norm_settings = new SetRestNormSettings(true, false, 0.40); + + MissionElement* set_height_offset = new SetHeightOffset(); + MissionElement* initial_pose_waypoint = new SetRelativeWaypoint(0., 0., 0., 0.); //TODO: SetRelativeWaypoint needs substantial refactoring + + #ifdef TESTING + MissionElement* takeoff_relative_waypoint = new SetRelativeWaypoint(0., 0., 1.0, 0.); + #endif + + //MissionElement* absolute_zero_Z_relative_waypoint = new SetRelativeWaypoint(0., 0., -10, 0.); + MissionElement* absolute_origin_1m_height = new SetAbsoluteWaypoint(0, 0, 1, 0); + MissionElement* absolute_waypoint_square_1 = new SetAbsoluteWaypoint(1.5, 0., 1.0, 0.); + MissionElement* absolute_waypoint_square_2 = new SetAbsoluteWaypoint(1.5, 1.5, 1.0, 0.); + MissionElement* absolute_waypoint_square_3 = new SetAbsoluteWaypoint(-1.5, 1.5, 1.0, 0.); + MissionElement* absolute_waypoint_square_4 = new SetAbsoluteWaypoint(-1.5, -1.5, 1.0, 0.); + MissionElement* absolute_waypoint_square_5 = new SetAbsoluteWaypoint(1.5, -1.5, 1.0, 0.); + MissionElement* absolute_waypoint_square_6 = new SetAbsoluteWaypoint(1.5, 0.0, 1.0, 0.); + MissionElement* absolute_waypoint_square_7 = new SetAbsoluteWaypoint(0.0, 0.0, 1.0, 0.); + MissionElement* land_relative_waypoint = new SetRelativeWaypoint(0., 0., -2., 0.); + + //******************Connections*************** + update_controller_pid_x->getPorts()[(int)UpdateController::ports_id::OP_0]->connect((ros_updt_ctr)->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + update_controller_pid_y->getPorts()[(int)UpdateController::ports_id::OP_0]->connect((ros_updt_ctr)->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + update_controller_pid_z->getPorts()[(int)UpdateController::ports_id::OP_0]->connect((ros_updt_ctr)->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + update_controller_pid_roll->getPorts()[(int)UpdateController::ports_id::OP_0]->connect((ros_updt_ctr)->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + update_controller_pid_pitch->getPorts()[(int)UpdateController::ports_id::OP_0]->connect((ros_updt_ctr)->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + update_controller_pid_yaw->getPorts()[(int)UpdateController::ports_id::OP_0]->connect((ros_updt_ctr)->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + update_controller_pid_yaw_rate->getPorts()[(int)UpdateController::ports_id::OP_0]->connect((ros_updt_ctr)->getPorts()[(int)ROSUnit_UpdateControllerClnt::ports_id::IP_0_PID]); + + ros_pos_sub->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_0]->connect(initial_pose_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_0]); + rosunit_yaw_provider->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_1]->connect(initial_pose_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_1]); + + ros_pos_sub->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_0]->connect(takeoff_relative_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_0]); + rosunit_yaw_provider->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_1]->connect(takeoff_relative_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_1]); + + ros_pos_sub->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_0]->connect(land_relative_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_0]); + rosunit_yaw_provider->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_1]->connect(land_relative_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::IP_1]); + + ros_pos_sub->getPorts()[(int)ROSUnit_PointSub::ports_id::OP_0]->connect(set_height_offset->getPorts()[(int)SetHeightOffset::ports_id::IP_0]); + + reset_z->getPorts()[(int)ResetController::ports_id::OP_0]->connect(ros_rst_ctr->getPorts()[(int)ROSUnit_SetInt8Clnt::ports_id::IP_0]); + + arm_motors->getPorts()[(int)Arm::ports_id::OP_0]->connect(ros_arm_srv->getPorts()[(int)ROSUnit_SetBoolClnt::ports_id::IP_0]); + disarm_motors->getPorts()[(int)Disarm::ports_id::OP_0]->connect(ros_arm_srv->getPorts()[(int)ROSUnit_SetBoolClnt::ports_id::IP_0]); + + ros_flight_command->getPorts()[(int)ROSUnit_EmptySrv::ports_id::OP_0]->connect(user_command->getPorts()[(int)UserCommand::ports_id::IP_0]); + + set_restricted_norm_settings->getPorts()[(int)SetRestNormSettings::ports_id::OP_0]->connect(ros_restnorm_settings->getPorts()[(int)ROSUnit_RestNormSettingsClnt::ports_id::IP_0]); + land_set_rest_norm_settings->getPorts()[(int)SetRestNormSettings::ports_id::OP_0]->connect(ros_restnorm_settings->getPorts()[(int)ROSUnit_RestNormSettingsClnt::ports_id::IP_0]); + waypoint_set_rest_norm_settings->getPorts()[(int)SetRestNormSettings::ports_id::OP_0]->connect(ros_restnorm_settings->getPorts()[(int)ROSUnit_RestNormSettingsClnt::ports_id::IP_0]); + + set_height_offset->getPorts()[(int)SetHeightOffset::ports_id::OP_0]->connect(ros_set_height_offset->getPorts()[(int)ROSUnit_SetFloatClnt::ports_id::IP_0]); + initial_pose_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + takeoff_relative_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + //absolute_zero_Z_relative_waypoint->connect(ros_set_path_clnt); + absolute_origin_1m_height->getPorts()[(int)SetAbsoluteWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + absolute_waypoint_square_1->getPorts()[(int)SetAbsoluteWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + absolute_waypoint_square_2->getPorts()[(int)SetAbsoluteWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + absolute_waypoint_square_3->getPorts()[(int)SetAbsoluteWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + absolute_waypoint_square_4->getPorts()[(int)SetAbsoluteWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + absolute_waypoint_square_5->getPorts()[(int)SetAbsoluteWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + absolute_waypoint_square_6->getPorts()[(int)SetAbsoluteWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + absolute_waypoint_square_7->getPorts()[(int)SetAbsoluteWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + land_relative_waypoint->getPorts()[(int)SetRelativeWaypoint::ports_id::OP_0]->connect(ros_set_path_clnt->getPorts()[(int)ROSUnit_SetPosesClnt::ports_id::IP_0]); + + //*************Setting Flight Elements************* + #ifdef SMALL_HEXA + ((UpdateController*)update_controller_pid_x)->pid_data.kp = 0.4128; //0.696435; //0.51639 * 0.8; + ((UpdateController*)update_controller_pid_x)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_x)->pid_data.kd = 0.168; //0.375166; //0.21192 * 0.8; + ((UpdateController*)update_controller_pid_x)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_x)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_x)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_x)->pid_data.dt = (float)1.0/120.0; + ((UpdateController*)update_controller_pid_x)->pid_data.id = block_id::PID_X; + + ((UpdateController*)update_controller_pid_y)->pid_data.kp = 0.4128; //0.568331;// 0.51639 * 0.8; + ((UpdateController*)update_controller_pid_y)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_y)->pid_data.kd = 0.168; // 0.306157;// * 0.8; + ((UpdateController*)update_controller_pid_y)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_y)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_y)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_y)->pid_data.dt = (float)1.0/120.0; + ((UpdateController*)update_controller_pid_y)->pid_data.id = block_id::PID_Y; + + ((UpdateController*)update_controller_pid_z)->pid_data.kp = 0.730936; + ((UpdateController*)update_controller_pid_z)->pid_data.ki = 0.0980*2; + ((UpdateController*)update_controller_pid_z)->pid_data.kd = 0.190225; + ((UpdateController*)update_controller_pid_z)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_z)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_z)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_z)->pid_data.dt = (float)1.0/120.0; + ((UpdateController*)update_controller_pid_z)->pid_data.id = block_id::PID_Z; + +<<<<<<< HEAD + ((UpdateController*)update_controller_pid_roll)->pid_data.kp = 0.225 * 0.9; //0.2121; //0.172195; //0.3302; //0.286708; //0.225 * 0.8; + ((UpdateController*)update_controller_pid_roll)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_roll)->pid_data.kd = 0.04 * 0.9; //0.0489; //0.042464; //0.0931; //0.056559; //0.04 * 0.8; +======= + ((UpdateController*)update_controller_pid_roll)->pid_data.kp = 0.225 * 0.8; //0.2121; //0.172195; //0.3302; //0.286708; //0.225 * 0.8; + ((UpdateController*)update_controller_pid_roll)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_roll)->pid_data.kd = 0.04 * 0.8; // 0.0489; //0.042464; //0.0931; //0.056559; //0.04 * 0.8; +>>>>>>> 3d4646fdc27ca8a39c3f5d740c641b241115caf9 + ((UpdateController*)update_controller_pid_roll)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_roll)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_roll)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_roll)->pid_data.dt = 1.f/200.f; + ((UpdateController*)update_controller_pid_roll)->pid_data.id = block_id::PID_ROLL; + +<<<<<<< HEAD + ((UpdateController*)update_controller_pid_pitch)->pid_data.kp = 0.225 * 0.9; //0.2506;// 0.3360; //0.2811;//0.275252; //0.225 * 0.8; + ((UpdateController*)update_controller_pid_pitch)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_pitch)->pid_data.kd = 0.04 * 0.9; // 0.0578;//0.0684; //0.053100; //0.0868;// 0.051266; //0.04 * 0.8; +======= + ((UpdateController*)update_controller_pid_pitch)->pid_data.kp = 0.225 * 0.8; // 0.2506;// 0.3360; //0.2811;//0.275252; //0.225 * 0.8; + ((UpdateController*)update_controller_pid_pitch)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_pitch)->pid_data.kd = 0.04 * 0.8; // 0.0578;//0.0684; //0.053100; //0.0868;// 0.051266; //0.04 * 0.8; +>>>>>>> 3d4646fdc27ca8a39c3f5d740c641b241115caf9 + ((UpdateController*)update_controller_pid_pitch)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_pitch)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_pitch)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_pitch)->pid_data.dt = 1.f/200.f; + ((UpdateController*)update_controller_pid_pitch)->pid_data.id = block_id::PID_PITCH; + + ((UpdateController*)update_controller_pid_yaw)->pid_data.kp = 1.6 * 2; + ((UpdateController*)update_controller_pid_yaw)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.kd = 0.0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_yaw)->pid_data.dt = 1.f/120.f; + ((UpdateController*)update_controller_pid_yaw)->pid_data.id = block_id::PID_YAW; + + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.kp = 0.16 * 2; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.kd = 0.0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.dt = 1.f/200.f; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.id = block_id::PID_YAW_RATE; + #endif + + #ifdef BIG_HEXA + ((UpdateController*)update_controller_pid_x)->pid_data.kp = 0.6534; + ((UpdateController*)update_controller_pid_x)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_x)->pid_data.kd = 0.3831; + ((UpdateController*)update_controller_pid_x)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_x)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_x)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_x)->pid_data.dt = (float)1.0/120.0; + ((UpdateController*)update_controller_pid_x)->pid_data.id = block_id::PID_X; + + ((UpdateController*)update_controller_pid_y)->pid_data.kp = 0.7176; + ((UpdateController*)update_controller_pid_y)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_y)->pid_data.kd = 0.4208; + ((UpdateController*)update_controller_pid_y)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_y)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_y)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_y)->pid_data.dt = (float)1.0/120.0; + ((UpdateController*)update_controller_pid_y)->pid_data.id = block_id::PID_Y; + + ((UpdateController*)update_controller_pid_z)->pid_data.kp = 0.785493; + ((UpdateController*)update_controller_pid_z)->pid_data.ki = 0.098; + ((UpdateController*)update_controller_pid_z)->pid_data.kd = 0.239755; + ((UpdateController*)update_controller_pid_z)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_z)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_z)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_z)->pid_data.dt = (float)1.0/120.0; + ((UpdateController*)update_controller_pid_z)->pid_data.id = block_id::PID_Z; + + ((UpdateController*)update_controller_pid_roll)->pid_data.kp = 0.3227; + ((UpdateController*)update_controller_pid_roll)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_roll)->pid_data.kd = 0.0558; + ((UpdateController*)update_controller_pid_roll)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_roll)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_roll)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_roll)->pid_data.dt = 1.f/200.f; + ((UpdateController*)update_controller_pid_roll)->pid_data.id = block_id::PID_ROLL; + + ((UpdateController*)update_controller_pid_pitch)->pid_data.kp = 0.2981; + ((UpdateController*)update_controller_pid_pitch)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_pitch)->pid_data.kd = 0.0515; + ((UpdateController*)update_controller_pid_pitch)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_pitch)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_pitch)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_pitch)->pid_data.dt = 1.f/200.f; + ((UpdateController*)update_controller_pid_pitch)->pid_data.id = block_id::PID_PITCH; + + ((UpdateController*)update_controller_pid_yaw)->pid_data.kp = 3.2; + ((UpdateController*)update_controller_pid_yaw)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.kd = 0.0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_yaw)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_yaw)->pid_data.dt = 1.f/120.f; + ((UpdateController*)update_controller_pid_yaw)->pid_data.id = block_id::PID_YAW; + + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.kp = 0.32; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.ki = 0.0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.kd = 0.0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.kdd = 0.0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.anti_windup = 0; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.en_pv_derivation = 1; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.dt = 1.f/200.f; + ((UpdateController*)update_controller_pid_yaw_rate)->pid_data.id = block_id::PID_YAW_RATE; + #endif + + ((ResetController*)reset_z)->target_block = block_id::PID_Z; + + Wait wait_1s; + wait_1s.wait_time_ms=1000; + + Wait wait_100ms; + wait_100ms.wait_time_ms=100; + + Wait wait_5s; + wait_5s.wait_time_ms=5000; + + #ifdef TESTING + MissionPipeline testing_pipeline; + + testing_pipeline.addElement((MissionElement*)&wait_1s); + + testing_pipeline.addElement((MissionElement*)update_controller_pid_x); + testing_pipeline.addElement((MissionElement*)update_controller_pid_y); + testing_pipeline.addElement((MissionElement*)update_controller_pid_z); + testing_pipeline.addElement((MissionElement*)update_controller_pid_roll); + testing_pipeline.addElement((MissionElement*)update_controller_pid_pitch); + testing_pipeline.addElement((MissionElement*)update_controller_pid_yaw); + testing_pipeline.addElement((MissionElement*)update_controller_pid_yaw_rate); + + testing_pipeline.addElement((MissionElement*)set_height_offset); //TODO: (CHECK Desc) Set a constant height command/reference based on the current pos + testing_pipeline.addElement((MissionElement*)&wait_1s); + testing_pipeline.addElement((MissionElement*)set_restricted_norm_settings); + testing_pipeline.addElement((MissionElement*)initial_pose_waypoint); + testing_pipeline.addElement((MissionElement*)user_command); + testing_pipeline.addElement((MissionElement*)reset_z); //Reset I-term to zero + testing_pipeline.addElement((MissionElement*)&wait_100ms); + testing_pipeline.addElement((MissionElement*)arm_motors); + + #ifdef AUTO_TEST + testing_pipeline.addElement((MissionElement*)&wait_1s); + #else + testing_pipeline.addElement((MissionElement*)user_command); + #endif + + testing_pipeline.addElement((MissionElement*)reset_z); //Reset I-term to zero + testing_pipeline.addElement((MissionElement*)takeoff_relative_waypoint); + + #ifdef AUTO_TEST + testing_pipeline.addElement((MissionElement*)&wait_5s); + #else + testing_pipeline.addElement((MissionElement*)user_command); + #endif + + // testing_pipeline.addElement((MissionElement*)waypoint_set_rest_norm_settings); + // testing_pipeline.addElement((MissionElement*)&wait_100ms); + // testing_pipeline.addElement((MissionElement*)absolute_origin_1m_height); + // testing_pipeline.addElement((MissionElement*)absolute_waypoint_square_1); + // testing_pipeline.addElement((MissionElement*)absolute_waypoint_square_2); + // testing_pipeline.addElement((MissionElement*)absolute_waypoint_square_3); + // testing_pipeline.addElement((MissionElement*)absolute_waypoint_square_4); + // testing_pipeline.addElement((MissionElement*)absolute_waypoint_square_5); + // testing_pipeline.addElement((MissionElement*)absolute_waypoint_square_6); + // testing_pipeline.addElement((MissionElement*)absolute_waypoint_square_7); + // testing_pipeline.addElement((MissionElement*)user_command); + testing_pipeline.addElement((MissionElement*)land_set_rest_norm_settings); + testing_pipeline.addElement((MissionElement*)&wait_100ms); + testing_pipeline.addElement((MissionElement*)land_relative_waypoint); + #endif + + Logger::getAssignedLogger()->log("FlightScenario main_scenario",LoggerLevel::Info); + MissionScenario main_scenario; + + #ifdef TESTING + main_scenario.AddMissionPipeline(&testing_pipeline); + #endif + + main_scenario.StartScenario(); + Logger::getAssignedLogger()->log("Main Done",LoggerLevel::Info); + std::cout << "OK \n"; + while(ros::ok){ + ros::spinOnce(); + } + return 0; +} diff --git a/example_node/traslation_node.cpp b/example_node/traslation_node.cpp index a58be29..6e66d54 100644 --- a/example_node/traslation_node.cpp +++ b/example_node/traslation_node.cpp @@ -21,7 +21,6 @@ #include "HEAR_ROS_BRIDGE/ROSUnit_UpdateControllerSrv.hpp" #include "HEAR_control/PIDController.hpp" // -#include "HEAR_ROS_BRIDGE/ROSUnit_OrientationSubscriber.hpp" #include "HEAR_ROS_BRIDGE/ROSUnit_InfoSubscriber.hpp" #include "HEAR_ROS_BRIDGE/ROSUnit_Factory.hpp" #include "HEAR_ROS_BRIDGE/ROSUnit_RestNormSettingsClnt.hpp" diff --git a/launch/example.launch b/launch/example.launch new file mode 100644 index 0000000..89ff0ff --- /dev/null +++ b/launch/example.launch @@ -0,0 +1,8 @@ + + + + + + + diff --git a/package.xml b/package.xml index 028389a..d94490c 100644 --- a/package.xml +++ b/package.xml @@ -7,6 +7,7 @@ TODO catkin hear_ros_bridge + hear_architecture roscpp diff --git a/params/controller_params.yaml b/params/controller_params.yaml new file mode 100644 index 0000000..6e74536 --- /dev/null +++ b/params/controller_params.yaml @@ -0,0 +1,24 @@ +controller_params: + + pid: + x: + kp: 0.6 + kd: 0.4 + y: + kp: 0.7 + kd: 0.2 + z: + kp: 0.8 + ki: 0.2 + kd: 0.1 + roll: + kp: 0.3 + kd: 0.05 + pitch: + kp: 0.3 + kd: 0.05 + yaw: + kp: 3.2 + yaw_rate: + kp: 0.32 +