资源简介

激光雷达图像采集程序及数据,激光雷达型号UTM-30LX

资源截图

代码片段和文件信息

/*!
  \file
  \brief Sample to get URG data using Win32

  \author Satofumi KAMIMURA

  $Id: capture_sample.cpp 1724 2010-02-25 10:43:11Z satofumi $

  Compling and execute process
  - In case of Visual Studio
  - Select capture_sample.sln from capture_sample.zip
  - When Visual Studio is started press F5 to build and execute.
  - If COM port is not found then change the com_port in main function.

  - In case of MinGW Cygwin
  - % g++ capture_sample.cpp -o capture_sample
  - % ./capture_sample
  - If COM port is not found then change the com_port in main function.

  \attention Change com_port com_baudrate values in main() with relevant values.
  \attention We are not responsible for any loss or damage occur by using this program
  \attention We appreciate the suggestions and bug reports
*/

#define _CRT_SECURE_NO_WARNINGS

#include 
#include 
#include 
#include 
#include 

using namespace std;


// To record the output of SCIPdefine RAW_OUTPUT
//#define RAW_OUTPUT

#if defined(RAW_OUTPUT)
static FILE* Raw_fd_ = NULL;
#endif


enum {
  Timeout = 1000               // [msec]
  EachTimeout = 2              // [msec]
  LineLength = 64 + 3 + 1 + 1 + 1 + 16
};

static HANDLE HCom = INVALID_HANDLE_VALUE;
static int ReadableSize = 0;
static char* ErrorMessage = “no error.“;


/*!
  \brief Manage sensor information
*/
typedef struct
{
  enum {
    MODL = 0                   //!< Sensor model information
    DMIN                       //!< Minimum measurable distance [mm]
    DMAX                       //!< Maximum measurable distance [mm]
    ARES                       //!< Angle of resolution
    AMIN                       //!< Minimum measurable area
    AMAX                       //!< Maximum measurable area
    AFRT                       //!< Front direction value
    SCAN                       //!< Standard angular velocity
  };
  string model;                 //!< Obtained MODL information
  long distance_min;            //!< Obtained DMIN information
  long distance_max;            //!< Obtained DMAX information
  int area_total;               //!< Obtained ARES information
  int area_min;                 //!< Obtained AMIN information
  int area_max;                 //!< Obtained AMAX information
  int area_front;               //!< Obtained AFRT information
  int scan_rpm;                 //!< Obtained SCAN information

  int first;                    //!< Starting position of measurement
  int last;                     //!< End position of measurement
  int max_size;                 //!< Maximum size of data
  long last_timestamp;          //!< Time stamp when latest data is obtained
} urg_state_t;


// Delay
static void delay(int msec)
{
  Sleep(msec);
}


static int com_changeBaudrate(long baudrate)
{
  DCB dcb;

  GetCommState(HCom &dcb);
  dcb.BaudRate = baudrate;
  dcb.ByteSize = 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件       17538  2013-01-28 10:40  capture_sample.cpp
     文件        5482  2013-01-28 10:41  data_001.csv
     文件        5483  2013-01-28 10:41  data_002.csv
     文件        5482  2013-01-28 10:41  data_003.csv
     文件        5482  2013-01-28 10:41  data_004.csv
     文件        5482  2013-01-28 10:41  data_005.csv
     文件        5482  2013-01-28 10:41  data_006.csv
     文件        5482  2013-01-28 10:41  data_007.csv
     文件        5478  2013-01-28 10:41  data_008.csv
     文件        5482  2013-01-28 10:41  data_009.csv
     文件        5483  2013-01-28 10:41  data_010.csv

评论

共有 条评论