pf-robotics / kachaka-api

スマートファニチャープラットフォーム「カチャカ」API
https://kachaka.zendesk.com/hc/ja/articles/7660222791183-%E3%82%AB%E3%83%81%E3%83%A3%E3%82%ABAPI
Apache License 2.0
85 stars 24 forks source link

[LiDAR] Scan Data lenght is not constant and header might be incorrect #115

Open MrKeith99 opened 1 month ago

MrKeith99 commented 1 month ago

[ENG] We are experiencing issues with obtaining a correct scan data from the LiDAR which is being published on the /kachaka/lidar/scan topic.

Scan Data Header content:

Scan Data Length Variation:

It would be beneficial to access the raw LiDAR data and any additional sensor data (e.g., TOF) independently.


[日本語] /kachaka/lidar/scan トピックでパブリッシュされているLiDARのスキャンデータに不整合が見られます。

スキャンデータヘッダの内容:

スキャンデータの変動:

生のLiDARデータと他のセンサーデータ (TOFなど) に個別にアクセスできる方法があれば、ご教示ください。

Additional Information:

Here we share the information got with ros2 topic echo /kachaka/lidar/scan:

header:
  stamp:
    sec: 1723212284
    nanosec: 860031000
  frame_id: laser_frame
angle_min: -3.1415927410125732
angle_max: 3.1415927410125732
angle_increment: 0.00998916570097208
time_increment: 0.00019924482330679893
scan_time: 0.12532499432563782
range_min: 0.10000000149011612
range_max: 10.0
ranges:
- 0.0
- 5.0329999923706055
- 5.044000148773193
- 0.0
- 5.057000160217285
- 5.071000099182129
- ...

Where ranges length over the scans seems to be similar to this:

[INFO] [1723212225.861439148] [lidar_length_node]: Length of LiDAR ranges: 646
[INFO] [1723212225.959220199] [lidar_length_node]: Length of LiDAR ranges: 661
[INFO] [1723212226.079582270] [lidar_length_node]: Length of LiDAR ranges: 669
[INFO] [1723212226.188875728] [lidar_length_node]: Length of LiDAR ranges: 672
[INFO] [1723212226.406561765] [lidar_length_node]: Length of LiDAR ranges: 665
[INFO] [1723212226.527574158] [lidar_length_node]: Length of LiDAR ranges: 659
[INFO] [1723212226.631671547] [lidar_length_node]: Length of LiDAR ranges: 652
[INFO] [1723212226.741832658] [lidar_length_node]: Length of LiDAR ranges: 645
[INFO] [1723212226.862682051] [lidar_length_node]: Length of LiDAR ranges: 636
[INFO] [1723212226.982428452] [lidar_length_node]: Length of LiDAR ranges: 634
...
terakoji-pfr commented 1 month ago

With kachaka, rearward scan data cannot be acquired because the LiDAR is blocked by the docking unit.

Also, the number of scan points varies depending on the rotation speed of the motor.

MrKeith99 commented 2 weeks ago

@terakoji-pfr Thank you for your prompt replay.

With kachaka, rearward scan data cannot be acquired because the LiDAR is blocked by the docking unit.

We could imagine that it was because of the docking unit. However, is it possible to know the actual detecting range of the LiDAR? I believe is not angle_min: -3.1415927410125732, angle_max: 3.1415927410125732.

Also, the number of scan points varies depending on the rotation speed of the motor.

I see! We have tried with other LiDAR sensors, and it was the first time to observe this phenomenon. I will have a look how we can process the data so that we can obtain a constant number of points for processing.

atinfinity commented 1 day ago

@terakoji-pfr LaserScanのmsg仕様におけるangle_min、angle_maxについてはhttps://docs.ros2.org/latest/api/sensor_msgs/msg/LaserScan.htmlに情報があります。

もし、カチャカの2D LiDARが前方しか見ていないとしたら、現状のカチャカROS 2ブリッジで配信されるscanトピックで設定されているangle_min、angle_maxは360度見ていることになっているので、実状と即していないのではないかという質問だと思います。 また、https://github.com/pf-robotics/kachaka-api/issues/115#issue-2458915708で書かれているように

スキャンデータの変動:

  • スキャンデータの ranges 配列の長さがスキャンごとに変わっています。
  • 他のセンサー (TOFセンサーなど) のデータとマージされているからだと考えられます。

とあります。通常、angle_min、angle_max、角度分解能は固定なのでranges配列長は固定なことが多いのですが、カチャカROS 2ブリッジで配信されるscanトピックではangle_min、angle_maxが固定なのに対してranges配列長が変動するので、ユーザー側でscanを使った実装ができないという問題もありそうです。

一度ご確認頂きたいです。