- Timestamp:
- Jan 16, 2015, 5:01:19 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CMakeLists.txt
r72 r74 84 84 # ======================================== 85 85 # add_subdirectory(Alasca) 86 #add_subdirectory(CanGateway)86 add_subdirectory(CanGateway) 87 87 #add_subdirectory(PtGreyCameras) 88 88 # add_subdirectory(Dualshock) … … 91 91 #add_subdirectory(StereoVisionDisparity) 92 92 #add_subdirectory(SensorsApplication) 93 #add_subdirectory(StdDbtPlayerComponents)93 add_subdirectory(StdDbtPlayerComponents) 94 94 # add_subdirectory(Wifibot) 95 #add_subdirectory(Gps) 95 add_subdirectory(Gps) 96 #add_subdirectory(OpencvVideo) 96 97 #add_subdirectory(SpanCPTComponent) 97 #add_subdirectory(NMEA0183)98 #add_subdirectory(OpencvVideo)98 add_subdirectory(NMEA0183) 99 add_subdirectory(VelodyneComponent) 99 100 # ======================================== 100 101 # Summary -
trunk/CanGateway/Win32CanInterface.h
r63 r74 17 17 // we use the Vector driver 18 18 #ifdef WIN32 19 # define CAN_DRIVER_TYPE VECTOR_CAN_DRIVER20 //# define CAN_DRIVER_TYPE VECTOR_CANXL_DRIVER19 //# define CAN_DRIVER_TYPE VECTOR_CAN_DRIVER 20 # define CAN_DRIVER_TYPE VECTOR_CANXL_DRIVER 21 21 //# define CAN_DRIVER_TYPE PEAK_CAN_DRIVER_WIN 22 22 #else -
trunk/Sick/SickLMSData.h
r61 r74 166 166 */ 167 167 int rssi_len1; 168 168 //int rssi_len1_8; 169 169 /*! 170 170 * \brief Energy values for the first reflected pulse … … 173 173 uint16_t* rssi1; 174 174 175 //uint8_t* rssi1_8; 176 175 177 /*! 176 178 * \brief Number of samples in rssi2. … … 178 180 */ 179 181 int rssi_len2; 180 182 //int rssi_len2_8; 181 183 /*! 182 184 * \brief Energy values for the second reflected pulse … … 184 186 */ 185 187 uint16_t* rssi2; 188 //uint8_t* rssi2_8; 186 189 } scanData; 187 190 … … 229 232 int rssi_len2; //!< Number of energy values (2nd echo). 230 233 uint32_t dataPos_rssi2; //!< Energy of the returned pulse (2nd echo). @b LMS1xx @b only. 234 //chunlei 235 //int rssi_len1_8; //!< Number of energy values (1st echo). 236 //uint32_t dataPos_rssi1_8; //!< Energy of the returned pulse (1st echo). @b LMS1xx @b only. 8bit 237 //int rssi_len2_8; 238 //uint32_t dataPos_rssi2_8; //!< Energy of the returned pulse (1st echo). @b LMS1xx @b only. 8bit 231 239 }SickLMS_dbt; 232 240 -
trunk/Sick/SickLMSSensor.cpp
r72 r74 110 110 // sprintf(buf, "%c%s%c", 0x02, "sMN SetAccessMode 03 F4724744", 0x03); 111 111 // S_socket->sendToServer(QString(buf)); 112 113 114 // sprintf(buf, "%c%s%c", 0x02, "sWN LMDscandatacfg 03 00 1 1 0 00 00 0 0 0 0 1 1", 0x03); 112 // 113 // //sprintf(buf, "%c%s%c", 0x02, "sMN mLMPsetscancfg 2500 1 2500 300000 1500000", 0x03);//chunlei to configure the angle of the sensor 114 // //S_socket->sendToServer(QString(buf)); 115 // 116 // sprintf(buf, "%c%s%c", 0x02, "sWN LMDscandatacfg 01 01 1 1 0 00 00 0 0 0 0 1 1", 0x03); 115 117 // S_socket->sendToServer(QString(buf)); 116 118 // 117 119 //// sprintf(buf, "%c%s%c", 0x02, "sWN FREchoFilter 1", 0x03); 118 120 //// S_socket->sendToServer(QString(buf)); 119 121 // 122 // 120 123 /////// SAVE PERMANENT 121 124 // sprintf(buf, "%c%s%c", 0x02, "sMN mEEwriteall", 0x03); 122 125 // S_socket->sendToServer(QString(buf)); 123 126 // 124 127 //// /// LOGOUT 125 128 // sprintf(buf, "%c%s%c", 0x02, "sMN Run", 0x03); 126 129 // S_socket->sendToServer(QString(buf)); 127 130 //// 128 131 129 132 // Start measurement … … 367 370 msg->data.rssi_len2 = 0; 368 371 369 370 372 // for(std::vector<std::string>::iterator it = msg->splitMessage->begin(); it != msg->splitMessage->end(); it++){ 371 373 // printf("%s ", (*it).c_str()); … … 397 399 msg->data.scanFrequency = xstol(msg->splitMessage->at(16)); 398 400 LOG_TRACE("(Parsing) Scan frequency "<< msg->data.scanFrequency <<" [1/100 Hz]"); 399 401 //LOG_INFO("(Parsing) Scan frequency "<< msg->data.scanFrequency <<" [1/100 Hz]"); 400 402 // 17 //MeasurementFrequency 401 403 … … 403 405 int NumberEncoders = xstol(msg->splitMessage->at(18)); 404 406 LOG_TRACE("(Parsing) Number Encoders "<< NumberEncoders); 405 407 //LOG_INFO("(Parsing) Number Encoders "<< NumberEncoders); 406 408 for (int i = 0; i < NumberEncoders; i++) { 407 409 // //EncoderPosition … … 449 451 scalingFactor = 2; 450 452 LOG_TRACE("(Parsing 16bit channel #"<<i<<") Scaling factor x"<< scalingFactor); 451 453 //LOG_INFO("(Parsing 16bit channel #"<<i<<") Scaling factor x"<< scalingFactor); 452 454 // 19+NumberEncoders*2+i*6+totalData16+3 //ScalingOffset 453 455 // 19+NumberEncoders*2+i*6+totalData16+4 //Starting angle 454 456 msg->data.startAngle = xstol(msg->splitMessage->at(19+NumberEncoders*2+i*6+totalData16+4)); 455 457 LOG_TRACE("(Parsing 16bit channel #"<<i<<") Start angle "<< msg->data.startAngle << " [1/10000 degree]"); 456 458 //LOG_INFO("(Parsing 16bit channel #"<<i<<") Start angle "<< msg->data.startAngle << " [1/10000 degree]"); 457 459 // 19+NumberEncoders*2+i*6+totalData16+5 //Angular step width 458 460 msg->data.angleResolution = xstol(msg->splitMessage->at(19+NumberEncoders*2+i*6+totalData16+5)); 459 461 LOG_TRACE("(Parsing 16bit channel #"<<i<<") Angular step width "<< msg->data.angleResolution<<" [1/10000 degree]"); 460 462 //LOG_INFO("(Parsing 16bit channel #"<<i<<") Angular step width "<< msg->data.angleResolution<<" [1/10000 degree]"); 461 463 // 19+NumberEncoders*2+i*6+totalData16+6 //NumberData 462 464 NumberData = xstol(msg->splitMessage->at(19+NumberEncoders*2+i*6+totalData16+6)); … … 501 503 int NumberChannels8Bit = xstol(msg->splitMessage->at(19+NumberEncoders*2+NumberChannels16Bit*6+totalData16+1)); 502 504 LOG_TRACE("(Processing) Number channels 8Bit : "<<NumberChannels8Bit); 503 505 //LOG_INFO("(Processing) Number channels 8Bit : "<<NumberChannels8Bit); 504 506 LOG_INFO("(Parsing) 8bit channel not implemented yet !"); 505 507 506 /* 508 507 509 // int totalData8 = 0; 508 // for (int i = 0; i < NumberChannels8Bit; i++) { 509 510 // for (int i = 0; i < NumberChannels8Bit; i++) 511 // { 512 // 510 513 // int type = -1; 511 514 // 512 515 // std::string content = msg->splitMessage->at(21+NumberEncoders*2+NumberChannels16Bit*6+totalData16+totalData8+i*6); 513 516 // LOG_TRACE("(Parsing 8bit channel) Measured Data Content : " << content); 514 // if (content == " DIST1") {517 // if (content == "RSSI1") { 515 518 // type = 0; 516 // } else if (content==" DIST2") {519 // } else if (content=="RSSI2") { 517 520 // type = 1; 518 // } else if (content=="RSSI1") { 521 // } 522 // /* else if (content=="RSSI1") { 519 523 // type = 2; 520 524 // } else if (content == "RSSI2") { 521 525 // type = 3; 522 526 // } 523 527 // */ 528 // 529 // LOG_INFO("(Parsing 8bit channel #"<<i<<") Scaling factor x"<< 21+NumberEncoders*2+NumberChannels16Bit*6+totalData16+totalData8+i*6+1); 530 //// 19+NumberEncoders*2+i*6+totalData16+3 //ScalingOffset 531 //// 19+NumberEncoders*2+i*6+totalData16+4 //Starting angle 532 // 533 // LOG_INFO("(Parsing 8bit channel #"<<i<<") Start angle "<< 21+NumberEncoders*2+NumberChannels16Bit*6+totalData16+totalData8+i*6+3 << " [1/10000 degree]"); 534 //// 19+NumberEncoders*2+i*6+totalData16+5 //Angular step width 535 // 536 // LOG_INFO("(Parsing 8bit channel #"<<i<<") Angular step width "<< 21+NumberEncoders*2+NumberChannels16Bit*6+totalData16+totalData8+i*6+4<<" [1/10000 degree]"); 537 ///* 524 538 // 21+NumberEncoders*2+NumberChannels16Bit*6+totalData16+i*6+1 //ScalingFactor 525 539 // 21+NumberEncoders*2+NumberChannels16Bit*6+totalData16+i*6+2 //ScalingOffset … … 527 541 // 21+NumberEncoders*2+NumberChannels16Bit*6+totalData16+i*6+4 //Angular step width 528 542 // 21+NumberEncoders*2+NumberChannels16Bit*6+totalData16+i*6+5 //NumberData 529 543 //*/ 530 544 // int NumberData = xstol(msg->splitMessage->at(21+NumberEncoders*2+NumberChannels16Bit*6+totalData16+totalData8+i*6+5)); 531 // LOG_TRACE("(Parsing 16bit channel) Number Data for "<<content<<" : "<<NumberData);532 533 // sscanf(tok, "%X", &NumberData);534 535 // LOG_TRACE("(Processing) Number data : "<< NumberData); 536 545 // LOG_TRACE("(Parsing 8bit channel) Number Data for "<<content<<" : "<<NumberData); 546 // 547 // //sscanf(tok, "%X", &NumberData); 548 // 549 // LOG_TRACE("(Processing) Number data : "<< NumberData); //19+NumberEncoders*2+i*6+totalData16+6 550 // LOG_INFO("(Parsing 8bit channel #"<<i<<") Number data "<< NumberData); 537 551 // if (type == 0) { 538 // msg->data. dist_len1 = NumberData;552 // msg->data.rssi_len1 = NumberData; 539 553 // } else if (type == 1) { 540 // msg->data.dist_len2 = NumberData;541 // } else if (type == 2) {542 // msg->data.rssi_len1 = NumberData;543 // } else if (type == 3) {544 554 // msg->data.rssi_len2 = NumberData; 555 // } 556 // 557 // uint8_t* remissionPoints = (uint8_t*) malloc(NumberData * sizeof(uint8_t)); 558 // for (int j = 0; j < NumberData; j++) { 559 // remissionPoints[j] = xstol(msg->splitMessage->at(21 + NumberEncoders*2 + NumberChannels16Bit*6 + totalData16 + totalData8 + i*6 + 6 + j)); //19+NumberEncoders*2+i*6+totalData16+7+j 560 // } 561 // //for (int i = 0; i < NumberData; i++) { 562 // //int dat; 563 // //tok = strtok(NULL, " "); //data 564 // //sscanf(tok, "%X", &dat); 565 // 566 // if (type == 0) { 567 // msg->data.rssi1_8 = remissionPoints; 568 // msg->data.rssi_len1_8 = NumberData; 569 // } else if (type == 1) { 570 // msg->data.rssi2_8 = remissionPoints; 571 // msg->data.rssi_len2_8 = NumberData; 545 572 // } 546 // for (int i = 0; i < NumberData; i++) { 547 // int dat; 548 // tok = strtok(NULL, " "); //data 549 // sscanf(tok, "%X", &dat); 550 551 // if (type == 0) { 552 // msg->data.dist1[i] = dat; 553 // } else if (type == 1) { 554 // msg->data.dist2[i] = dat; 555 // } else if (type == 2) { 556 // msg->data.rssi1[i] = dat; 557 // } else if (type == 3) { 558 // msg->data.rssi2[i] = dat; 559 // } 560 // } 561 } // 8bit channel 562 */ 573 // //} 574 // totalData8 += NumberData; 575 // } // 8bit channel 576 // 563 577 564 578 return 0; … … 588 602 entry.rssi_len2 = entry.dataPos_rssi2 = 0; 589 603 604 //entry.rssi_len1_8 = entry.dataPos_rssi1_8 = 0; 605 //entry.rssi_len2_8 = entry.dataPos_rssi2_8 = 0; 606 590 607 if(msg.data.dist_len1){ 591 608 entry.dist_len1 = msg.data.dist_len1; … … 658 675 free(msg.data.rssi2); 659 676 } 677 //if(msg.data.rssi_len1_8){ 678 // entry.rssi_len1_8 = msg.data.rssi_len1_8; 679 // entry.dataPos_rssi1_8 = dataFile_.tellp(); 680 681 // for (unsigned int i = 0 ; i < msg.data.rssi_len1_8; ++i) { 682 // dataFile_.write(reinterpret_cast<char*>(&(msg.data.rssi1_8[i])), sizeof(uint8_t)); 683 // } 684 685 // free(msg.data.rssi1_8); 686 // } 687 // if(msg.data.rssi_len2_8){ 688 // entry.rssi_len2_8 = msg.data.rssi_len2_8; 689 // entry.dataPos_rssi2_8 = dataFile_.tellp(); 690 691 // for (unsigned int i = 0 ; i < msg.data.rssi_len2_8; ++i) { 692 // dataFile_.write(reinterpret_cast<char*>(&(msg.data.rssi2_8[i])), sizeof(uint8_t)); 693 // } 694 695 // free(msg.data.rssi2_8); 696 // } 660 697 // add a magic word to delimit the block of data 661 698 int32_t utcMagicWord = UTC_MAGIC_WORD; -
trunk/StdDbtPlayerComponents/CMakeLists.txt
r52 r74 3 3 ################################################################################ 4 4 add_definitions( -DSTDDBTPLAYERCOMPONENTS_EXPORTS ) 5 5 add_definitions( -DDBTPLYSICK_EXPORTS) 6 add_definitions( -DDBTPLYSICK_EXPORTS) 6 7 # ======================================== 7 8 # Include directories … … 22 23 set(HDRS 23 24 StdDbtPlayerComponentsConfig.h 24 #DbtPlySickLMSManager.h25 #DbtPlySickLDMRSManager.h25 DbtPlySickLMSManager.h 26 DbtPlySickLDMRSManager.h 26 27 ) 27 28 … … 32 33 set( 33 34 PROJECT_SRCS 34 #DbtPlySickLMSManager.cpp35 #DbtPlySickLDMRSManager.cpp35 DbtPlySickLMSManager.cpp 36 DbtPlySickLDMRSManager.cpp 36 37 ${HDRS} 37 38 ${PLUGIN_CPP} -
trunk/StdDbtPlayerComponents/DbtPlySickLDMRSManager.cpp
r50 r74 59 59 DbtPlyFileManager::configureComponent(config); 60 60 61 mDataFilename = param.getProperty("binFile");61 mDataFilename = config.getProperty("binFile"); 62 62 63 63 return ComponentBase::CONFIGURED_OK; -
trunk/StdDbtPlayerComponents/DbtPlySickLMSManager.cpp
r43 r74 17 17 #include <string> 18 18 19 #include "kernel/Log.h" 20 #include "PacpusTools/ShMem.h" 21 19 #include "Pacpus/kernel/Log.h" 20 #include "Pacpus/PacpusTools/ShMem.h" 21 22 #include <Pacpus/kernel/InputOutputInterface.h> 23 24 #include <math.h> 22 25 23 26 #define UTC_MAGIC_WORD 0x55544300 24 27 #define PI 3.1415936 25 28 26 29 namespace pacpus { … … 59 62 DbtPlyFileManager::configureComponent(config); 60 63 61 mDataFilename = param.getProperty("binFile");62 64 //mDataFilename = param.getProperty("binFile"); 65 mDataFilename = config.getProperty("binFile"); 63 66 return ComponentBase::CONFIGURED_OK; 64 67 } … … 96 99 mDataFile.close(); 97 100 } 101 98 102 99 103 ////////////////////////////////////////////////////////////////////////// … … 115 119 mSickDbt.scanFrequency = sickLMS_dbt->scanFrequency; 116 120 mSickDbt.angleResolution = sickLMS_dbt->angleResolution; 117 mSickDbt.startAngle = sickLMS_dbt->startAngle; 121 mSickDbt.startAngle = sickLMS_dbt->startAngle; 122 123 std::cout << "start angle is " << mSickDbt.startAngle << std::endl; 124 std::cout << "angle step is " << mSickDbt.angleResolution << std::endl; 118 125 mSickDbt.time = t; 119 126 mSickDbt.timerange = tr; 120 127 121 122 int sizes[7];128 /*int sizes[7];*/ 129 int sizes[9]; 123 130 sizes[0] = mSickDbt.dist_len1 = sickLMS_dbt->dist_len1; 124 131 sizes[1] = mSickDbt.dist_len2 = sickLMS_dbt->dist_len2; … … 129 136 sizes[6] = mSickDbt.rssi_len2 = sickLMS_dbt->rssi_len2; 130 137 131 uint32_t pos[7]; 138 //sizes[7] = mSickDbt.rssi_len1 = sickLMS_dbt->rssi_len1_8; 139 //sizes[8] = mSickDbt.rssi_len2 = sickLMS_dbt->rssi_len2_8; 140 //uint32_t pos[7]; 141 uint32_t pos[9]; 132 142 pos[0] = mSickDbt.dataPos_dist1 = sickLMS_dbt->dataPos_dist1; 133 143 pos[1] = mSickDbt.dataPos_dist2 = sickLMS_dbt->dataPos_dist2; … … 138 148 pos[6] = mSickDbt.dataPos_rssi2 = sickLMS_dbt->dataPos_rssi2; 139 149 150 //pos[7] = mSickDbt.dataPos_rssi1 = sickLMS_dbt->dataPos_rssi1_8; 151 //pos[8] = mSickDbt.dataPos_rssi2 = sickLMS_dbt->dataPos_rssi2_8; 152 140 153 LOG_TRACE("(ScanPointsInfo) dist1 points\tSize : " << mSickDbt.dist_len1 <<"\tPos. : "<< mSickDbt.dataPos_dist1); 141 154 LOG_TRACE("(ScanPointsInfo) dist2 points\tSize : " << mSickDbt.dist_len2 <<"\tPos. : "<< mSickDbt.dataPos_dist2); … … 147 160 148 161 162 149 163 uint16_t* data[7]; 150 164 uint8_t* remission_8[2]; 151 165 int sumSizes = 0; 152 166 153 167 LOG_TRACE("Reading UTC file ... "); 154 for(int i = 0; i<7; ++i){ 155 156 if(sizes[i]){ 168 for(int i = 0; i<7; ++i) 169 { 170 171 if(sizes[i]) 172 { 157 173 mDataFile.seekg(pos[i]); // set the get pointer to the correct place 158 174 // // then copy the data contained in the binary file 159 175 data[i] = (uint16_t*) malloc(sizes[i]*sizeof(uint16_t)); 160 for (size_t j = 0; j < sizes[i]; ++j) { 176 for (size_t j = 0; j < sizes[i]; ++j) 177 { 161 178 mDataFile.read(reinterpret_cast<char*>(data[i]+j), sizeof(uint16_t)); 162 if(j%500==0){ 179 if(j%500==0) 180 { 163 181 LOG_TRACE("Data : " << (uint16_t) *(data[i] + j)); 164 182 } 183 if(i == 0) 184 { 185 186 //std::cout << mSickLMSScan.point[j].distance << std::endl; 187 } 188 if(i == 5) 189 { 190 191 std::cout << *(data[i]+j) << std::endl; 192 } 165 193 } 166 } 167 sumSizes += sizes[i]; 168 } 169 194 195 } 196 sumSizes += sizes[i]; 197 } 198 199 // for(int i = 7; i<9; ++i) 200 //{ 201 202 // if(sizes[i]) 203 // { 204 // mDataFile.seekg(pos[i]); // set the get pointer to the correct place 205 // // // then copy the data contained in the binary file 206 // remission_8[i] = (uint8_t*) malloc(sizes[i]*sizeof(uint8_t)); 207 // for (size_t j = 0; j < sizes[i]; ++j) 208 // { 209 // mDataFile.read(reinterpret_cast<char*>(remission_8[i]+j), sizeof(uint8_t)); 210 // if(j%500==0) 211 // { 212 // LOG_TRACE("Data : " << (uint16_t) *(remission_8[i] + j)); 213 // } 214 // if(i == 0) 215 // { 216 217 // //std::cout << mSickLMSScan.point[j].distance << std::endl; 218 // } 219 // if(i == 7) 220 // { 221 222 // std::cout << "the 8 bit remission" << *(remission_8[i]+j) << std::endl; 223 // } 224 // } 225 226 // } 227 // sumSizes += sizes[i]; 228 // } 229 // 170 230 171 231 // verify that the last value is the UTC magic word … … 181 241 182 242 /**********************************/ 183 /* TODO : Send data ! */ 243 244 184 245 /**********************************/ 185 246 } … … 198 259 199 260 200 for(int i=0; i<7; ++i){ 201 free(data[i]); 261 for(int i=0; i<7; ++i) 262 { 263 if(sizes[i]) 264 { 265 free(data[i]); 266 } 202 267 } 203 268 }
Note:
See TracChangeset
for help on using the changeset viewer.