From 9b4ac0b7da3a88864f04a6ae0c572eca294ae9a3 Mon Sep 17 00:00:00 2001 From: DavidHu Date: Tue, 1 Mar 2022 15:24:09 +0800 Subject: [PATCH] =?UTF-8?q?[update]1.=E4=BF=AE=E5=A4=8D=E8=A7=A3=E5=8C=85?= =?UTF-8?q?=E4=B8=AD=E5=8E=BB=E6=8E=89=E5=BC=82=E5=B8=B8=E5=8C=85=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E6=BD=9C=E5=9C=A8bug;=202.=20=E6=9B=B4=E6=96=B0README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- src/lipkg.cpp | 4 ++-- src/main.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3583c6e..3631b0f 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ source devel/setup.bash > The code was tested under ubuntu16.04 ROS kinetic、ubuntu18.04 ROS melodic、ubuntu20.04 ROS noetic, using rviz visualization. -- new a terminal (Ctrl + Alt + T) and use Rviz2 tool,open the `ldlidar.rviz` file below the rviz folder of the readme file directory +- new a terminal (Ctrl + Alt + T) and use Rviz tool,open the `ldlidar.rviz` file below the rviz folder of the readme file directory ```bash rosrun rviz rviz ``` diff --git a/src/lipkg.cpp b/src/lipkg.cpp index abb5695..8d010a5 100644 --- a/src/lipkg.cpp +++ b/src/lipkg.cpp @@ -126,7 +126,7 @@ bool LiPkg::Parse(const uint8_t *data, long len) { if (AnalysisOne(data[i])) { // parse a package is success double diff = (pkg.end_angle / 100 - pkg.start_angle / 100 + 360) % 360; - if (diff > (double)pkg.speed * POINT_PER_PACK / 2300 * 3 / 2) { + if (diff > (double)pkg.speed * POINT_PER_PACK / kPointFrequence * 3 / 2) { error_times_++; } else { speed_ = pkg.speed; // Degrees per second @@ -210,7 +210,7 @@ void LiPkg::ToLaserscan(std::vector src) { angle_max = ANGLE_TO_RADIAN(src.back().angle); range_min = 0.02; range_max = 12; - angle_increment = ANGLE_TO_RADIAN(speed_ / 4500); + angle_increment = ANGLE_TO_RADIAN(speed_ / kPointFrequence); static uint16_t last_times_stamp = 0; uint16_t dealt_times_stamp = 0; uint16_t tmp_times_stamp = GetTimestamp(); diff --git a/src/main.cpp b/src/main.cpp index 1502cb8..051b66c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -42,7 +42,7 @@ int main(int argc, char **argv) { n.getParam("port_name", port_name); n.getParam("frame_id", frame_id); - ROS_INFO("[ldrobot] SDK Pack Version is v2.2.4"); + ROS_INFO("[ldrobot] SDK Pack Version is v2.2.5"); ROS_INFO("[ldrobot] : %s,: %s,: %s,: %s", product_name.c_str(), topic_name.c_str(), port_name.c_str(), frame_id.c_str());