Changeset 99 in pacpussensors for trunk/VelodyneComponent


Ignore:
Timestamp:
Oct 15, 2015, 2:47:01 PM (9 years ago)
Author:
nguyenhu
Message:

compilation under linux with 0.2.X framework

Location:
trunk/VelodyneComponent
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/VelodyneComponent/CMakeLists.txt

    r66 r99  
     1#########################quick start############################################
     2#cmake ../ -G "CodeBlocks - Unix Makefiles"
     3#make
     4#make install
     5#make clean
     6################################################################################
    17project(Velodyne)
     8set(${PROJECT_NAME}_VERSION_MAJOR 0)
     9set(${PROJECT_NAME}_VERSION_MINOR 1)
     10add_definitions( -DVELODYNEHDL64S2_EXPORTS )
     11################################################################################
     12create_export(EXPORT_HDR ${PROJECT_NAME})
     13pacpus_plugin(PLUGIN_CPP PLUGIN_HDR ${PROJECT_NAME})
     14add_definitions (${QT_DEFINITIONS})
    215
     16find_package(Qt5Network REQUIRED)
    317################################################################################
    4 add_definitions( -DVELODYNEHDL64S2_EXPORTS )
    5 
    6 
    7 
    8 # ========================================
    9 # Configure qt4
    10 # ========================================
    11 if(QT4_FOUND)
    12   set(QT_USE_QTXML true)
    13   set(QT_USE_QTNETWORK true)
    14   include(${QT_USE_FILE})
    15 else()
    16   message(ERROR "Qt4 needed")
    17 endif()
    18 
    19 # ========================================
    20 # Compiler definitions
    21 # ========================================
    22 add_definitions(
    23   ${QT_DEFINITIONS}
    24 )
    25 
    26 # ========================================
    27 # Include directories
    28 # ========================================
    29 include_directories(
    30   ${PROJECT_BINARY_DIR}
    31   ${QT_INCLUDE_DIR}
     18# DIRECTORIES
     19include_directories(
     20    ${PROJECT_BINARY_DIR}
     21    ${QT_INCLUDE_DIR}
     22    ${PACPUS_INCLUDE_DIR}
     23    ${PACPUS_INCLUDE_DIR}/Pacpus/
    3224)
    3325
     
    3527# Link directories
    3628# ========================================
    37 link_directories( ${PACPUS_LIB_DIR}
     29link_directories(
     30        ${PACPUS_LIB_DIR}
    3831)
    3932
    4033
    41 pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
    42 
    43 # ========================================
    44 # List of sources
    45 # ========================================
    46 set(
    47     PROJECT_SRCS
    48         VelodyneComponent.cpp
    49         VelodyneComponent.h
     34################################################################################
     35# FILES
     36set(PROJECT_HDRS
     37    ${EXPORT_HDR}
     38    VelodyneComponent.h
     39    structure_velodyne.h
     40    ${PROJECT_NAME}.xml
     41    ${PROJECT_NAME}_d.xml
     42)
     43set(PROJECT_SRCS
    5044    ${PLUGIN_CPP}
     45    VelodyneComponent.cpp 
    5146)
    5247
    53 # ========================================
    54 # Files to MOC
    55 # ========================================
    56 set(
    57     FILES_TO_MOC
    58     VelodyneComponent.h
    59     ${PLUGIN_H}
     48set(FILES_TO_MOC
     49    ${PLUGIN_HDR}
     50    VelodyneComponent.h
    6051)
    6152
    62 set(
    63     UI_FILES
    64 
     53set(UI_FILES
    6554)
    6655
    67 # ========================================
    68 # Call MOC
    69 # ========================================
    70 qt4_wrap_cpp(
    71     PROJECT_MOC_SRCS
     56################################################################################
     57# Qt: call moc, uic
     58qt_wrap_cpp(PROJECT_MOC_SRCS
    7259    ${FILES_TO_MOC}
    7360)
    7461
    75 qt4_wrap_ui(
    76     PROJECT_UI_SRCS
     62qt_wrap_ui(PROJECT_UI_SRCS
    7763    ${UI_FILES}
    7864)
    7965
    80 # ========================================
    81 # Build a library
    82 # ========================================
    83 pacpus_add_library(
    84     ${PROJECT_NAME} SHARED
     66################################################################################
     67# BUILD and LINK
     68pacpus_add_library(${PROJECT_NAME} SHARED
     69    ${PROJECT_HDRS}
    8570    ${PROJECT_SRCS}
    8671    ${PROJECT_MOC_SRCS}
     
    8873)
    8974
    90 message(STATUS  ${PACPUS_DEPENDENCIES_LIB} )
    9175
     76# ========================================
     77# Libraries
     78# ========================================
    9279set(LIBS
    9380    optimized FileLib debug FileLib_d
     
    10087    )
    10188endif()
    102 
    103 # ========================================
    104 # Libraries
    105 # ========================================
    106 # All the platform
    107 target_link_libraries(
    108     ${PROJECT_NAME}
    109     ${PACPUS_LIBRARIES}
    110     ${QT_LIBRARIES}
    111         ${PACPUS_DEPENDENCIES_LIB}
    112         ${LIBS}
    113 )
    114 
     89# LINK
     90target_link_libraries(${PROJECT_NAME}
     91                      ${PACPUS_LIBRARIES}
     92                      ${PACPUS_DEPENDENCIES_LIB}
     93                      ${LIBS}
     94                      ${QT_LIBRARIES}
     95                     )
     96qt5_use_modules(${PROJECT_NAME} Network)
     97################################################################################
     98# FOLDERS
    11599pacpus_folder(${PROJECT_NAME} "components")
    116 
    117 # ========================================
    118 # Install
    119 # ========================================
    120 pacpus_install(${PROJECT_NAME})
     100################################################################################
     101# INSTALL
     102pacpus_install(${PROJECT_NAME})
  • trunk/VelodyneComponent/VelodyneComponent.cpp

    r66 r99  
    55//  author:     Gerald Dherbomez
    66//              Copyright Heudiasyc UMR UTC/CNRS 6599
    7 // 
     7//
    88//  version:    $Id: $
    99//
     
    2020
    2121#include <QtEndian>
    22 #include <QUdpSocket>
     22#include <QtNetwork/QUdpSocket>
    2323#include <string>
    2424
     
    4949{
    5050    LOG_TRACE("constructor(" << name << ")");
    51    
    52     ComponentManager * mgr = ComponentManager::getInstance();
    53     LOG_DEBUG("manager = " << mgr);
     51
     52    //ComponentManager * mgr = ComponentManager::getInstance();
     53    //LOG_DEBUG("manager = " << mgr);
    5454
    5555    setRecording (true);
     
    8686/// TODO: doc
    8787void VelodyneComponent::run()
    88 { 
     88{
    8989    initialize();
    9090    exec(); // launch the exec loop, blocking until receiving exit() signal ...
     
    197197//////////////////////////////////////////////////////////////////////////
    198198/// new data coming from Velodyne sensor
    199 void VelodyneComponent::readPendingDatagrams() 
     199void VelodyneComponent::readPendingDatagrams()
    200200{
    201201    // get a timestamp
     
    338338            //*/
    339339                        }
    340                        
     340
    341341            mVelodyneData->range = mBlockIndex+(lastBlockIndex - 1);
    342342            LOG_DEBUG("range = " << mVelodyneData->range);
  • trunk/VelodyneComponent/VelodyneComponent.h

    r66 r99  
    77#define VELODYNECOMPONENT_H
    88
    9 #include <qhostaddress.h>
     9#include <QtNetwork/qhostaddress.h>
    1010#include <qthread.h>
    1111
Note: See TracChangeset for help on using the changeset viewer.