rplidar_cmd.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2014, RoboPeak
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without 
00006  * modification, are permitted provided that the following conditions are met:
00007  *
00008  * 1. Redistributions of source code must retain the above copyright notice, 
00009  *    this list of conditions and the following disclaimer.
00010  *
00011  * 2. Redistributions in binary form must reproduce the above copyright notice, 
00012  *    this list of conditions and the following disclaimer in the documentation 
00013  *    and/or other materials provided with the distribution.
00014  *
00015  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
00016  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
00017  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
00018  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 
00019  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
00020  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
00021  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 
00022  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
00023  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
00024  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
00025  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026  *
00027  */
00028 /*
00029  *  RoboPeak LIDAR System
00030  *  Data Packet IO packet definition for RP-LIDAR
00031  *
00032  *  Copyright 2009 - 2014 RoboPeak Team
00033  *  http://www.robopeak.com
00034  *  
00035  */
00036 
00037 
00038 #pragma once
00039 
00040 #include "rplidar_protocol.h"
00041 
00042 // Commands
00043 //-----------------------------------------
00044 
00045 // Commands without payload and response
00046 #define RPLIDAR_CMD_STOP               0x25
00047 #define RPLIDAR_CMD_SCAN               0x20
00048 #define RPLIDAR_CMD_FORCE_SCAN         0x21
00049 #define RPLIDAR_CMD_RESET              0x40
00050 
00051 
00052 // Commands without payload but have response
00053 #define RPLIDAR_CMD_GET_DEVICE_INFO      0x50
00054 #define RPLIDAR_CMD_GET_DEVICE_HEALTH    0x52
00055 
00056 #if defined(_WIN32)
00057 #pragma pack(1)
00058 #endif
00059 
00060 
00061 // Response
00062 // ------------------------------------------
00063 #define RPLIDAR_ANS_TYPE_MEASUREMENT      0x81
00064 
00065 #define RPLIDAR_ANS_TYPE_DEVINFO          0x4
00066 #define RPLIDAR_ANS_TYPE_DEVHEALTH        0x6
00067 
00068 
00069 #define RPLIDAR_STATUS_OK                 0x0
00070 #define RPLIDAR_STATUS_WARNING            0x1
00071 #define RPLIDAR_STATUS_ERROR              0x2
00072 
00073 #define RPLIDAR_RESP_MEASUREMENT_SYNCBIT        (0x1<<0)
00074 #define RPLIDAR_RESP_MEASUREMENT_QUALITY_SHIFT  2
00075 #define RPLIDAR_RESP_MEASUREMENT_CHECKBIT       (0x1<<0)
00076 #define RPLIDAR_RESP_MEASUREMENT_ANGLE_SHIFT    1
00077 
00078 typedef struct _rplidar_response_measurement_node_t {
00079     _u8    sync_quality;      // syncbit:1;syncbit_inverse:1;quality:6;
00080     _u16   angle_q6_checkbit; // check_bit:1;angle_q6:15;
00081     _u16   distance_q2;
00082 } __attribute__((packed)) rplidar_response_measurement_node_t;
00083 
00084 typedef struct _rplidar_response_device_info_t {
00085     _u8   model;
00086     _u16  firmware_version;
00087     _u8   hardware_version;
00088     _u8   serialnum[16];
00089 } __attribute__((packed)) rplidar_response_device_info_t;
00090 
00091 typedef struct _rplidar_response_device_health_t {
00092     _u8   status;
00093     _u16  error_code;
00094 } __attribute__((packed)) rplidar_response_device_health_t;
00095 
00096 #if defined(_WIN32)
00097 #pragma pack()
00098 #endif


rplidar_ros
Author(s):
autogenerated on Fri Aug 28 2015 12:46:43