Skip to content

Commit

Permalink
[update]1.修复解包中去掉异常包中的潜在bug;
Browse files Browse the repository at this point in the history
2. 更新README
  • Loading branch information
ldrobotsensor committed Mar 1, 2022
1 parent 6d42413 commit 9b4ac0b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
4 changes: 2 additions & 2 deletions src/lipkg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -210,7 +210,7 @@ void LiPkg::ToLaserscan(std::vector<PointData> 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();
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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] <product_name>: %s,<topic_name>: %s,<port_name>: %s,<frame_id>: %s",
product_name.c_str(), topic_name.c_str(), port_name.c_str(), frame_id.c_str());

Expand Down

0 comments on commit 9b4ac0b

Please sign in to comment.