Skip to content

Commit

Permalink
upgrade sdk 1.9.0
Browse files Browse the repository at this point in the history
[new feature] support baudrate 57600 and 1382400, support HQ scan response
[bugfix] TCP channel doesn't work
[improvement] Print warning messages when deprecated APIs are called; imporve angular accuracy for ultra capsuled scan points
  • Loading branch information
kintzhao committed Aug 24, 2018
1 parent f30ea5e commit 36684a0
Show file tree
Hide file tree
Showing 12 changed files with 895 additions and 598 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
Changelog for package rplidar_ros
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1.9.0 (2018-08-24)
------------------
* Update RPLIDAR SDK to 1.9.0
* [new feature] support baudrate 57600 and 1382400, support HQ scan response
* [bugfix] TCP channel doesn't work
* [improvement] Print warning messages when deprecated APIs are called; imporve angular accuracy for ultra capsuled scan points
* Contributors: tony,kint

1.7.0 (2018-07-19)
------------------
* Update RPLIDAR SDK to 1.7.0
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ rplidar roswiki: http://wiki.ros.org/rplidar

rplidar HomePage: http://www.slamtec.com/en/Lidar

rplidar SDK: https://github.com/Slamtec/rplidar_sdk

rplidar Tutorial: https://github.com/robopeak/rplidar_ros/wiki

How to build rplidar ros package
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package>
<name>rplidar_ros</name>
<version>1.7.0</version>
<version>1.9.0</version>
<description>The rplidar ros package, support rplidar A2/A1 and A3</description>

<maintainer email="[email protected]">Slamtec ROS Maintainer</maintainer>
Expand Down
2 changes: 1 addition & 1 deletion sdk/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ This folder contains RPLIDAR SDK source code which is provided by RoboPeak.

RoboPeak Website: http://www.robopeak.com
SlamTec HomePage: http://www.slamtec.com
RPLIDAR_SDK_VERSION: 1.7.0
RPLIDAR_SDK_VERSION: 1.9.0
Note: The SDK version may not up-to-date.
rplidar product: http://www.slamtec.com/en/Lidar
2 changes: 1 addition & 1 deletion sdk/include/rplidar.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@

#include "rplidar_driver.h"

#define RPLIDAR_SDK_VERSION "1.7.0"
#define RPLIDAR_SDK_VERSION "1.9.0"
33 changes: 32 additions & 1 deletion sdk/include/rplidar_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@

#define RPLIDAR_CMD_GET_SAMPLERATE 0x59 //added in fw 1.17

#define RPLIDAR_CMD_HQ_MOTOR_SPEED_CTRL 0xA8

// Commands with payload and have response
#define RPLIDAR_CMD_EXPRESS_SCAN 0x82 //added in fw 1.17

#define RPLIDAR_CMD_HQ_SCAN 0x83 //added in fw 1.24
#define RPLIDAR_CMD_GET_LIDAR_CONF 0x84 //added in fw 1.24
#define RPLIDAR_CMD_SET_LIDAR_CONF 0x85 //added in fw 1.24
//add for A2 to set RPLIDAR motor pwm when using accessory board
Expand All @@ -77,12 +79,22 @@
//for ultra express working flag
#define RPLIDAR_ULTRAEXPRESS_SCAN_FLAG_STD 0x0001
#define RPLIDAR_ULTRAEXPRESS_SCAN_FLAG_HIGH_SENSITIVITY 0x0002

#define RPLIDAR_HQ_SCAN_FLAG_CCW (0x1<<0)
#define RPLIDAR_HQ_SCAN_FLAG_RAW_ENCODER (0x1<<1)
#define RPLIDAR_HQ_SCAN_FLAG_RAW_DISTANCE (0x1<<2)

typedef struct _rplidar_payload_express_scan_t {
_u8 working_mode;
_u16 working_flags;
_u16 param;
} __attribute__((packed)) rplidar_payload_express_scan_t;

typedef struct _rplidar_payload_hq_scan_t {
_u8 flag;
_u8 reserved[32];
} __attribute__((packed)) rplidar_payload_hq_scan_t;

typedef struct _rplidar_payload_get_scan_conf_t {
_u32 type;
_u8 reserved[32];
Expand All @@ -105,6 +117,8 @@ typedef struct _rplidar_payload_acc_board_flag_t {
#define RPLIDAR_ANS_TYPE_MEASUREMENT 0x81
// Added in FW ver 1.17
#define RPLIDAR_ANS_TYPE_MEASUREMENT_CAPSULED 0x82
#define RPLIDAR_ANS_TYPE_MEASUREMENT_HQ 0x83


// Added in FW ver 1.17
#define RPLIDAR_ANS_TYPE_SAMPLE_RATE 0x15
Expand All @@ -128,6 +142,9 @@ typedef struct _rplidar_response_acc_board_flag_t {

#define RPLIDAR_RESP_MEASUREMENT_SYNCBIT (0x1<<0)
#define RPLIDAR_RESP_MEASUREMENT_QUALITY_SHIFT 2

#define RPLIDAR_RESP_HQ_FLAG_SYNCBIT (0x1<<0)

#define RPLIDAR_RESP_MEASUREMENT_CHECKBIT (0x1<<0)
#define RPLIDAR_RESP_MEASUREMENT_ANGLE_SHIFT 1

Expand Down Expand Up @@ -156,6 +173,8 @@ typedef struct _rplidar_response_cabin_nodes_t {
#define RPLIDAR_RESP_MEASUREMENT_EXP_SYNC_1 0xA
#define RPLIDAR_RESP_MEASUREMENT_EXP_SYNC_2 0x5

#define RPLIDAR_RESP_MEASUREMENT_HQ_SYNC 0xA5

#define RPLIDAR_RESP_MEASUREMENT_EXP_SYNCBIT (0x1<<15)

typedef struct _rplidar_response_capsule_measurement_nodes_t {
Expand Down Expand Up @@ -189,12 +208,24 @@ typedef struct rplidar_response_measurement_node_hq_t {
_u8 flag;
} __attribute__((packed)) rplidar_response_measurement_node_hq_t;

typedef struct _rplidar_response_hq_capsule_measurement_nodes_t{
_u8 sync_byte;
_u64 time_stamp;
rplidar_response_measurement_node_hq_t node_hq[16];
_u32 crc32;
}__attribute__((packed)) rplidar_response_hq_capsule_measurement_nodes_t;


# define RPLIDAR_CONF_SCAN_COMMAND_STD 0
# define RPLIDAR_CONF_SCAN_COMMAND_EXPRESS 1
# define RPLIDAR_CONF_SCAN_COMMAND_HQ 2
# define RPLIDAR_CONF_SCAN_COMMAND_BOOST 3
# define RPLIDAR_CONF_SCAN_COMMAND_STABILITY 4
# define RPLIDAR_CONF_SCAN_COMMAND_SENSITIVITY 5

#define RPLIDAR_CONF_ANGLE_RANGE 0x00000000
#define RPLIDAR_CONF_DESIRED_ROT_FREQ 0x00000001
#define RPLIDAR_CONF_SCAN_COMMAND_BITMAP 0x00000002
#define RPLIDAR_CONF_MIN_ROT_FREQ 0x00000004
#define RPLIDAR_CONF_MAX_ROT_FREQ 0x00000005
#define RPLIDAR_CONF_MAX_DISTANCE 0x00000060
Expand Down
6 changes: 3 additions & 3 deletions sdk/include/rplidar_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class RPlidarDriver {
/// The interface will return RESULT_OPERATION_TIMEOUT to indicate that no complete 360-degrees' scan can be retrieved withing the given timeout duration.
///
/// \The caller application can set the timeout value to Zero(0) to make this interface always returns immediately to achieve non-block operation.
virtual u_result grabScanData(rplidar_response_measurement_node_t * nodebuffer, size_t & count, _u32 timeout = DEFAULT_TIMEOUT) = 0;
DEPRECATED(virtual u_result grabScanData(rplidar_response_measurement_node_t * nodebuffer, size_t & count, _u32 timeout = DEFAULT_TIMEOUT)) = 0;

/// Wait and grab a complete 0-360 degree scan data previously received.
/// The grabbed scan data returned by this interface always has the following charactistics:
Expand Down Expand Up @@ -281,7 +281,7 @@ class RPlidarDriver {
/// \param count The caller must initialize this parameter to set the max data count of the provided buffer (in unit of rplidar_response_measurement_node_t).
/// Once the interface returns, this parameter will store the actual received data count.
/// The interface will return RESULT_OPERATION_FAIL when all the scan data is invalid.
virtual u_result ascendScanData(rplidar_response_measurement_node_t * nodebuffer, size_t count) = 0;
DEPRECATED(virtual u_result ascendScanData(rplidar_response_measurement_node_t * nodebuffer, size_t count)) = 0;

/// Ascending the scan data according to the angle value in the scan.
///
Expand All @@ -299,7 +299,7 @@ class RPlidarDriver {
/// \param count Once the interface returns, this parameter will store the actual received data count.
///
/// The interface will return RESULT_OPERATION_TIMEOUT to indicate that not even a single node can be retrieved since last call.
virtual u_result getScanDataWithInterval(rplidar_response_measurement_node_t * nodebuffer, size_t & count) = 0;
DEPRECATED(virtual u_result getScanDataWithInterval(rplidar_response_measurement_node_t * nodebuffer, size_t & count)) = 0;

/// Return received scan points even if it's not complete scan
///
Expand Down
Loading

0 comments on commit 36684a0

Please sign in to comment.