Changeset 45 in flair-src
- Timestamp:
- Jul 18, 2016, 4:13:56 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/CMakeLists.txt
r2 r45 19 19 20 20 FILE(GLOB FLAIRCORE_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") 21 21 message(${CMAKE_C_COMPILER}) 22 22 INCLUDE_DIRECTORIES( 23 23 ${LIBXML2_INCLUDE_DIR} … … 36 36 37 37 add_custom_target( 38 svn_rev39 COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/ svn_revision.sh $ENV{FLAIR_ROOT}/flair-src ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/svnversion.h38 compile_info 39 COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/compile_info.sh ${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/compile_info.h 40 40 ) 41 41 42 add_dependencies(FlairCore_rt svn_rev)43 add_dependencies(FlairCore_nrt svn_rev)42 add_dependencies(FlairCore_rt compile_info) 43 add_dependencies(FlairCore_nrt compile_info) -
trunk/lib/FlairCore/src/FrameworkManager.cpp
r15 r45 20 20 #include "IODevice.h" 21 21 #include "config.h" 22 #include " svnversion.h"22 #include "compile_info.h" 23 23 24 24 using std::string; … … 27 27 28 28 namespace { 29 flair::core::FrameworkManager *frameworkmanager = NULL;29 flair::core::FrameworkManager *frameworkmanager = NULL; 30 30 } 31 32 static void constructor() __attribute__((constructor)); 33 34 void constructor() { 35 compile_info("FlairCore"); 36 } 37 31 38 32 39 namespace flair { … … 55 62 } 56 63 57 Printf(SVN_REV);58 64 frameworkmanager = this; 59 65 pimpl_ = new FrameworkManager_impl(this, name); -
trunk/lib/FlairCore/src/FrameworkManager_impl.cpp
r20 r45 106 106 // Avoids memory swapping for this program 107 107 mlockall(MCL_CURRENT | MCL_FUTURE); 108 struct sigaction sa;109 108 110 109 // catch segfault … … 114 113 #ifdef __XENO__ 115 114 #ifdef SIGDEBUG 115 struct sigaction sa; 116 116 sigemptyset(&sa.sa_mask); 117 117 sa.sa_sigaction = warn_upon_switch; -
trunk/lib/FlairCore/src/GpsData.cpp
r42 r45 56 56 57 57 GpsData::GpsData(const Object *parent, std::string name, int n) 58 : io_data(parent, name, n), dataType( floatType) {58 : io_data(parent, name, n), dataType() { 59 59 if (n > 1) 60 60 Warn("n>1 not supported\n"); 61 61 62 AppendLogDescription(" raw_ax", floatType);63 AppendLogDescription(" raw_ay", floatType);64 AppendLogDescription(" raw_az", floatType);62 AppendLogDescription("latitude", floatType); 63 AppendLogDescription("longitude", floatType); 64 AppendLogDescription("altitude", floatType); 65 65 66 AppendLogDescription("raw_gx", floatType);67 AppendLogDescription("raw_gy", floatType);68 AppendLogDescription("raw_gz", floatType);69 66 70 AppendLogDescription("raw_mx", floatType);71 AppendLogDescription("raw_my", floatType);72 AppendLogDescription("raw_mz", floatType);73 67 } 74 68 -
trunk/lib/FlairCore/src/GpsData.h
r42 r45 32 32 class Type : public DataType { 33 33 public: 34 Type(ScalarType const &_elementDataType) 35 : elementDataType(_elementDataType) {} 36 ScalarType const &GetElementDataType() const { return elementDataType; } 34 Type(void){} 37 35 std::string GetDescription() const { return "gps data"; } 38 36 size_t GetSize() const { … … 41 39 42 40 private: 43 ScalarType const &elementDataType;44 41 }; 45 42 -
trunk/lib/FlairFilter/CMakeLists.txt
r7 r45 44 44 45 45 SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) 46 47 add_custom_target( 48 compile_info 49 COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/compile_info.sh ${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/compile_info.h 50 ) 51 52 add_dependencies(${PROJECT_NAME} compile_info) -
trunk/lib/FlairFilter/src/UavMultiplex.cpp
r15 r45 22 22 #include <Tab.h> 23 23 #include <GridLayout.h> 24 #include "compile_info.h" 24 25 25 26 using std::string; 26 27 using namespace flair::core; 27 28 using namespace flair::gui; 29 30 //todo: put it on seprate file, but not possible with static lib? 31 static void constructor() __attribute__((constructor)); 32 33 void constructor() { 34 compile_info("FlairFilter"); 35 } 36 28 37 29 38 namespace flair { -
trunk/lib/FlairMeta/CMakeLists.txt
r7 r45 44 44 45 45 SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) 46 47 add_custom_target( 48 compile_info 49 COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/compile_info.sh ${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/compile_info.h 50 ) 51 52 add_dependencies(${PROJECT_NAME} compile_info) -
trunk/lib/FlairMeta/src/UavFactory.cpp
r41 r45 18 18 #include "UavFactory.h" 19 19 #include "FrameworkManager.h" 20 //#include "ArDrone2.h"21 20 #include "SimuX4.h" 22 21 #include "SimuX8.h" 23 22 #include "HdsX8.h" 24 23 #include "XAir.h" 24 #include "compile_info.h" 25 25 26 26 using namespace std; … … 30 30 31 31 namespace { // anonymous 32 vector<flair::meta::Uav* (*)(FrameworkManager*,string,string,UavMultiplex*)> vectoroffunctions;32 vector<flair::meta::Uav* (*)(FrameworkManager*,string,string,UavMultiplex*)> *vectoroffunctions=NULL; 33 33 } 34 35 36 static void constructor() __attribute__((constructor)); 37 38 void constructor() { 39 compile_info("FlairMeta"); 40 } 41 34 42 35 43 Uav *CreateUav(FrameworkManager *parent, string uav_name, string uav_type, … … 37 45 38 46 Uav *uav; 39 for(int i=0;i<vectoroffunctions.size();i++) { 40 uav=vectoroffunctions.at(i)(parent, uav_name, uav_type,multiplex); 41 if(uav!=NULL) return uav; 47 48 if(vectoroffunctions!=NULL) { 49 for(int i=0;i<vectoroffunctions->size();i++) { 50 uav=vectoroffunctions->at(i)(parent, uav_name, uav_type,multiplex); 51 if(uav!=NULL) { 52 free(vectoroffunctions); 53 vectoroffunctions=NULL; 54 return uav; 55 } 56 } 42 57 } 43 58 … … 72 87 void RegisterUavCreator(flair::meta::Uav*(*func)(FrameworkManager *parent, string uav_name, string uav_type, 73 88 UavMultiplex *multiplex)) { 74 vectoroffunctions.push_back(func);89 if(vectoroffunctions==NULL) vectoroffunctions=(vector<flair::meta::Uav* (*)(FrameworkManager*,string,string,UavMultiplex*)>*)malloc(sizeof(vector<flair::meta::Uav* (*)(FrameworkManager*,string,string,UavMultiplex*)>)); 75 90 91 vectoroffunctions->push_back(func); 76 92 } -
trunk/lib/FlairMeta/src/UavStateMachine.cpp
r42 r45 181 181 ComputeThrust(); // logs are added to uz, so it must be updated at last 182 182 183 //check nan problems184 if( CheckIsNan(currentTorques.roll,"roll torque")185 || CheckIsNan(currentTorques.pitch,"pitch torque")186 || CheckIsNan(currentTorques.yaw,"yaw torque")187 || CheckIsNan(currentThrust,"thrust")) {183 //check nan/inf problems 184 if(IsValuePossible(currentTorques.roll,"roll torque") 185 || IsValuePossible(currentTorques.pitch,"pitch torque") 186 || IsValuePossible(currentTorques.yaw,"yaw torque") 187 || IsValuePossible(currentThrust,"thrust")) { 188 188 189 189 if(failSafeMode) { … … 218 218 } 219 219 220 bool UavStateMachine:: CheckIsNan(float value,std::string desc) {220 bool UavStateMachine::IsValuePossible(float value,std::string desc) { 221 221 if(isnan(value)) { 222 222 Warn("%s is not an number\n",desc.c_str()); 223 return true; 224 } else if(isinf(value)) { 225 Warn("%s is infinite\n",desc.c_str()); 223 226 return true; 224 227 } else { -
trunk/lib/FlairMeta/src/UavStateMachine.h
r42 r45 261 261 void Run(void); 262 262 void StopMotors(void); 263 bool CheckIsNan(float value,std::string desc);263 bool IsValuePossible(float value,std::string desc); 264 264 265 265 meta::Uav *uav; -
trunk/lib/FlairSensorActuator/CMakeLists.txt
r3 r45 43 43 FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/src/*.h") 44 44 INSTALL(FILES ${files} DESTINATION $ENV{FLAIR_ROOT}/flair-dev/include/${PROJECT_NAME}) 45 46 add_custom_target( 47 compile_info 48 COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/compile_info.sh ${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/compile_info.h 49 ) 50 51 add_dependencies(${PROJECT_NAME} compile_info) -
trunk/lib/FlairSensorActuator/src/Bldc.cpp
r15 r45 21 21 #include <DoubleSpinBox.h> 22 22 #include <sstream> 23 #include "compile_info.h" 24 25 //todo: put it on seprate file, but not possible with static lib? 26 static void constructor() __attribute__((constructor)); 27 28 void constructor() { 29 compile_info("FlairSensorActuator"); 30 } 23 31 24 32 using std::string; -
trunk/lib/FlairSimulator/CMakeLists.txt
r8 r45 22 22 ${CMAKE_CURRENT_SOURCE_DIR}/src 23 23 ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported 24 # $ENV{FLAIR_ROOT}/uav_dev/include25 24 ${CMAKE_CURRENT_SOURCE_DIR}/../FlairCore/src 26 25 ${CMAKE_CURRENT_SOURCE_DIR}/../FlairSensorActuator/src … … 34 33 SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) 35 34 35 add_custom_target( 36 compile_info 37 COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/compile_info.sh ${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/compile_info.h 38 ) 39 36 40 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/no_gl) 41 add_dependencies(FlairSimulator_nogl compile_info) 37 42 if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i686" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i586" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64") 38 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/gl) 43 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/gl) 44 add_dependencies(FlairSimulator_gl compile_info) 39 45 endif() -
trunk/lib/FlairSimulator/src/Gui.cpp
r15 r45 31 31 #include <algorithm> 32 32 #include <GL/gl.h> 33 #include "compile_info.h" 34 35 //todo: put it on seprate file, but not possible with static lib? 36 static void constructor() __attribute__((constructor)); 37 38 void constructor() { 39 compile_info("FlairSensorActuator"); 40 } 33 41 34 42 using namespace irr; -
trunk/tools/Dbt2csv/CMakeLists.txt
r40 r45 40 40 41 41 add_custom_target( 42 svn_rev43 COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/ svn_revision.sh $ENV{FLAIR_ROOT}/flair-src ${CMAKE_CURRENT_SOURCE_DIR}/src/svnversion.h42 compile_info 43 COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/compile_info.sh ${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/compile_info.h 44 44 ) 45 45 46 add_dependencies(${PROJECT_NAME} svn_rev) 47 46 add_dependencies(${PROJECT_NAME} compile_info) 48 47 49 48 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) -
trunk/tools/Dbt2csv/src/main.cpp
r16 r45 4 4 5 5 #include <stdio.h> 6 #include " svnversion.h"6 #include "unexported/compile_info.h" 7 7 #include "file_ui.h" 8 8 #include <QFileDialog> 9 9 10 10 int main(int argc, char *argv[]) { 11 printf(SVN_REV);11 compile_info("Dbt2Csv"); 12 12 13 13 QLocale::setDefault(QLocale::C); -
trunk/tools/FlairGCS/CMakeLists.txt
r40 r45 92 92 93 93 add_custom_target( 94 svn_rev95 COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/ svn_revision.sh $ENV{FLAIR_ROOT}/flair-src ${CMAKE_CURRENT_SOURCE_DIR}/src/svnversion.h94 compile_info 95 COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/compile_info.sh ${CMAKE_C_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/compile_info.h 96 96 ) 97 97 98 add_dependencies(${PROJECT_NAME} svn_rev)98 add_dependencies(${PROJECT_NAME} compile_info) 99 99 100 100 -
trunk/tools/FlairGCS/src/main.cpp
r15 r45 10 10 11 11 #include "Manager.h" 12 #include " svnversion.h"12 #include "unexported/compile_info.h" 13 13 14 14 using namespace TCLAP; … … 51 51 } 52 52 53 printf(SVN_REV);53 compile_info("FlairGCS"); 54 54 55 55 parseOptions(argc, argv);
Note:
See TracChangeset
for help on using the changeset viewer.