Changeset 71 in pacpussensors for trunk


Ignore:
Timestamp:
Nov 19, 2014, 10:24:51 AM (10 years ago)
Author:
DHERBOMEZ Gérald
Message:

Correction of Sick LIDAR LDMRS code: problem when decoding the points cloud (with Chunlei Yu).
Correction of a small bug in Win32SerialPort when receiving RX_FLAG.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Sick/CMakeLists.txt

    r61 r71  
    1616  message(ERROR "Qt4 needed")
    1717endif()
    18 
     18find_package(OpenGL REQUIRED)
    1919# ========================================
    2020# Compiler definitions
     
    122122    ${QT_LIBRARIES}
    123123        ${PACPUS_DEPENDENCIES_LIB}
     124        ${OPENGL_LIBRARIES}
    124125        ${LIBS}
    125126)
  • trunk/Sick/SickLDMRSData.h

    r61 r71  
    3333
    3434namespace pacpus{
     35static const uint32_t MAX_SICKSCAN_POINT = 1100;
     36static const uint32_t MAX_SCAN_POINT_PER_LAYER = 1100;
    3537
    3638/*!
     
    108110                                //!< 4 MSB : Echo
    109111    uchar flags;
    110     uint16_t angle;            //!< Angle in number of ticks. You can easily compute the real angle :
     112    int16_t angle;            //!< Angle in number of ticks. You can easily compute the real angle :
    111113                                //!< \f$ angle (degree) = \frac{angle (ticks)}{ScanHeader.ticksPerRot}\f$ @see ScanHeader
    112114
     
    141143} SickLDMRS_dbt;
    142144
    143 
    144 
    145145#ifdef SICKLDMRS_SH_MEM
    146146/// Structure to write in shared memory, followed by the points.
  • trunk/Sick/SickLDMRSSensor.cpp

    r61 r71  
    126126        LOG_TRACE("(Recording) Not recording...");
    127127
    128 
    129128#ifdef SICKLDMRS_SH_MEM
    130129    shmem_ = new ShMem(kSickMemoryName.c_str(), sizeof(ScanSickData));
     
    323322        // we have a complete message available that we can add to the list
    324323        MessageLDMRS msg;
    325 
    326         // we copy the bytes in the body message
    327 //        char* messageData = (char*)malloc(msgSize);
    328 //        if(messageData == NULL){
    329 //            LOG_FATAL("(Packet reconstitution) Malloc FAILED. Packet lost.");
    330 //            return;
    331 //        }
    332324        memcpy(msg.body, pendingBytes.data.c_str() + index, msgSize);
    333325
     
    375367            scanPoints[i].layerEcho = *((uchar*)(msg.body + index));
    376368            scanPoints[i].flags = *((uchar*)(msg.body + index + 1));
    377             scanPoints[i].angle = *((uint16_t*)(msg.body + index + 2));
     369            scanPoints[i].angle = *((int16_t*)(msg.body + index + 2));
    378370            scanPoints[i].distance = *((uint16_t*)(msg.body + index + 4));
    379371            scanPoints[i].echoPulseWidth = *((uint16_t*)(msg.body + index + 6));
    380         }
    381 
    382         memcpy(msg.body, scanPoints, sizeof(ScanPoint) * msg.hScan.numPoints);
     372                        index+=10;
     373                }
     374                memcpy(msg.body, scanPoints, sizeof(ScanPoint) * msg.hScan.numPoints);
    383375
    384376                delete[] scanPoints;
     
    392384        // TODO
    393385    }
    394 
    395 
    396386    return msg.hData.dataType;
    397387}
  • trunk/Sick/SickLDMRSSensor.h

    r61 r71  
    2222#include "AbstractSickSensor.h"
    2323#include "SickLDMRSData.h"
    24 
     24#include "AlascaViewer3D.h"
    2525#include <fstream>
    2626#include <string>
     
    199199    SickSocket * S_socket;
    200200
     201signals:
     202  void refreshDisplay();
     203
    201204private:
    202205    /// Name is used to recognize between several sensors and store data into .dbt and utc files.
     
    255258    std::ofstream dataFile_; //!< UTC file.
    256259
    257 
    258260#ifdef SICKLDMRS_SH_MEM
    259261    ShMem * shmem_;
  • trunk/Sick/SickLMSSensor.cpp

    r61 r71  
    562562*/
    563563
     564                return 0;
    564565}
    565566
  • trunk/driver/win32SerialPort.cpp

    r59 r71  
    477477
    478478    if ( evtMask & EV_RXCHAR ) {
     479                //printf("%s EV_RXCHAR\n",portName);
    479480        if ((numberBytesToRead = nbBytesToRead()) > 0) {
    480481            receivedBuffer_.resize(numberBytesToRead);
     
    485486
    486487
    487     if ( evtMask & EV_RXFLAG )
    488         //printf("%s EV_RXFLAG\n",portName);
     488    if ( evtMask & EV_RXFLAG ) {
     489        printf("%s EV_RXFLAG\n",portName);
     490        }
    489491
    490492        if ( evtMask & EV_TXEMPTY )
Note: See TracChangeset for help on using the changeset viewer.