RoboSense-LiDAR / rslidar_sdk

RoboSense LiDAR SDK for ROS & ROS2
Other
457 stars 219 forks source link

can't play the ros2 bag with topic rslidar_packets #112

Closed KusabiSun closed 1 year ago

KusabiSun commented 1 year ago

Hi, I have a problem to record and play the ros2 bag for robosense M1. I update the rslidar sdk and rslidar msg to the version 1.5.8. And I follow the official Dokument to set config.yaml file to record and play the ros2 bag and I took care of the indentation of yaml file. I can record the ros2 bag, but cant play it. The ros2bag info is this:

Files: rosbag2_2023_01_19-23_12_50_0.db3 Bag size: 190.8 MiB Storage id: sqlite3 Duration: 22.875s Topic information: Topic: /rslidar_packets | Type: rslidar_msg/msg/RslidarPacket | Count: 144110 | Serialization Format: cdr

When I run the rslidar_sdk and want to see the point cloud on rivz2. I can't see the cloud point on rivz2. But if i record and play the topic /rslidar_point and change no setting, i can see the point cloud on rivz2. I am not sure what I forget to set and why happens this problem. I can't find similar Problem in Internet and the most case is my setting is somewhere wrong.

Thanks for any replies. Kusabi

YitianShi commented 1 year ago

I got the same problem either. Could anyone give a solution?

ming45 commented 1 year ago

Because **spin** is not called to process the callback queue, the callback function is not fired and the packets cannot be resolved.
Add rclcpp::spin(noed) after initialization. (You have to get the nodes yourself)

KusabiSun commented 1 year ago

Thank you for your answer. We find another way to solve this problem. But thank you very much. I will close this issue. If anyone has questions, reopen it again

atauzki commented 1 year ago

it doesn't receive any packet at all. but calling rclcpp::spin() in the packet subscriber node and publisher node just make subscriber work. Then the buffer overflows. How can I solve this problem?