Changeset 72 in pacpussensors for trunk/Sick
- Timestamp:
- Dec 4, 2014, 1:02:02 PM (10 years ago)
- Location:
- trunk/Sick
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Sick/AbstractSickSensor.h
r37 r72 15 15 #define ABSTRACTSICKSENSOR_H 16 16 17 #include <Q Thread>17 #include <QObject> 18 18 #include "SickSocket.h" 19 19 … … 45 45 * interfaces using SickComponent, used with the PACPUS Framework. 46 46 */ 47 class AbstractSickSensor : public Q Thread47 class AbstractSickSensor : public QObject 48 48 { 49 49 Q_OBJECT 50 50 public: 51 void run(){}52 51 53 52 virtual void stopActivity() = 0 ; /*!< to stop the processing thread */ -
trunk/Sick/SickLDMRSSensor.cpp
r71 r72 322 322 // we have a complete message available that we can add to the list 323 323 MessageLDMRS msg; 324 memcpy(msg.body, pendingBytes.data.c_str() + index, msgSize); 325 324 if (msgSize <= sizeof(msg.body)) 325 memcpy(msg.body, pendingBytes.data.c_str() + index, msgSize); 326 else 327 LOG_ERROR("Impossible to copy the pending bytes in the MessageLDMRS, checked the size of the body in the code! Data might be corrupted..."); 326 328 // msg->body = messageData; 327 329 -
trunk/Sick/SickLDMRSSensor.h
r71 r72 26 26 #include <string> 27 27 28 #define BODY_MAX_SIZE 10000 28 // Constants for Sick LDMRS 29 static const uint32_t DATA_HEADER_SIZE = 24; // in bytes 30 static const uint32_t SCAN_HEADER_SIZE = 44; // in bytes 31 static const uint32_t MEASURED_POINT_DATA_SIZE = 10; // in bytes 32 // @12.5Hz, the sensor has a multiresolution: 33 // - lateral range (50 to 30 degrees and -30 to -60 degrees): 0.5 degrees 34 // - medium range (30 to 10 degrees and -10 to -30 degrees): 0.25 degrees 35 // - central range (10 to -10 degrees): 0.125 degrees 36 // So theorically, the max number of points per layer is (20+30)/0.5 + (20+20)/0.25 + 20/0.125 + 1 = 321 37 static const uint32_t MAX_SCAN_POINT_PER_LAYER = 321; 38 static const uint32_t MAX_SCAN_POINT = 4 * MAX_SCAN_POINT_PER_LAYER; // 4 layers sensor 39 static const uint32_t BODY_MAX_SIZE = DATA_HEADER_SIZE + SCAN_HEADER_SIZE + MEASURED_POINT_DATA_SIZE * MAX_SCAN_POINT; // 12 908 29 40 30 41 // Export macro for SickLDMRS DLL for Windows only … … 82 93 /** This array pointer points to allocated in memory (basically, in heap (malloc)) and then must be freed (free) when the whole message is decoded and stored. */ 83 94 char body[BODY_MAX_SIZE]; 84 95 85 96 //! Time when the message is received. 86 97 road_time_t time; … … 120 131 ~SickLDMRSSensor(); 121 132 122 void run() {}123 133 124 134 void stopActivity(); /*!< To stop the processing thread */ -
trunk/Sick/SickLMSSensor.cpp
r71 r72 321 321 message->splitMessage = new std::vector<std::string>(); 322 322 323 for(int i ; i < message->msgSize; ++i){323 for(int i=0; i < message->msgSize; ++i){ 324 324 std::string* str = new std::string(); 325 325 while(message->body[i] != ' ' && i < message->msgSize){ -
trunk/Sick/SickLMSSensor.h
r42 r72 104 104 ~SickLMSSensor(); 105 105 106 void run() {}107 108 106 void stopActivity(); /*!< To stop the processing thread. */ 109 107 void startActivity(); /*!< To start the processing thread. */ -
trunk/Sick/SickSocket.cpp
r42 r72 80 80 81 81 frame->size = socket->read(frame->msg, (qint64) frame->size); 82 83 SickFrameEvent *e = new SickFrameEvent;82 83 SickFrameEvent *e = new SickFrameEvent; 84 84 e->frame = frame; 85 85 QCoreApplication::postEvent((QObject*)myParent, e);
Note:
See TracChangeset
for help on using the changeset viewer.