SICKAG / sick_scan_xd

Based on the sick_scan drivers for ROS1, sick_scan_xd merges sick_scan, sick_scan2 and sick_scan_base repositories. The driver supports both Linux (native, ROS1, ROS2) and Windows (native and ROS2).
Apache License 2.0
90 stars 83 forks source link

picoScan API related questions #270

Closed HCHChen closed 3 months ago

HCHChen commented 5 months ago

Hello,

  1. When using the SickScanApiWaitNextPolarPointCloudMsg API, the returned value (ret) is consistently 5 (timeout), as shown in the image below. image image

  2. Is there a method to use a callback function to determine if the scan has completed transmitting the entire cycle of data? image

  3. Is there a way to disable API packet logging in the build definition?

Best Regards, -Henry

rostest commented 5 months ago

Thanks for your feedback. SickScanApiWaitNextPolarPointCloudMsg should return with SICK_SCAN_API_SUCCESS, unless the lidar did not repond within the given timeout. Did you call SickScanApiWaitNextPolarPointCloudMsg with a value message_timeout > 0?

We recommend to register a callback via function SickScanApiRegisterPolarPointCloudMsg instead of calling one of the WaitNext-functions in a loop. See Minimalistic usage example in Python and Complete usage example in Python for a usage example.

Currently the INFO-messages from MsgPack/Compact-Exporter can not be disabled by build definition. We will add an API-function to set the log level.

rostest commented 5 months ago

We have added API-functions SickScanApiSetVerboseLevel and SickScanApiGetVerboseLevel to set resp. get the verbose level in branch feature/api_logging on https://github.com/SICKAG/sick_scan_xd/tree/feature/api_logging .

SickScanApiSetVerboseLevel and SickScanApiGetVerboseLevel sets resp. returns the verbose level. The verbose level can be 0=DEBUG, 1=INFO, 2=WARN, 3=ERROR, 4=FATAL or 5=QUIET (equivalent to ros::console::levels). Default verbose level is 1 (INFO), i.e. sick_scan_xd prints informational, warnings and error messages on the console. Logging callbacks registered with SickScanApiRegisterLogMsg will receive all informational, warnings and error messages independant of the verbose level. Call SickScanApiSetVerboseLevel(sick_scan_library, api_handle, 2) to disable sick_scan_xd info messages. See https://github.com/SICKAG/sick_scan_xd/blob/feature/api_logging/doc/sick_scan_api/sick_scan_api.md#diagnostic for details.

Note that the WaitNext-functions of the API just return the next received message. For multiScan and picoScan, this can be a scan segment (i.e. a part of the full scan) or a fullframe poincloud (i.e. all scan points of a 360 degree scan). Depending on the timing, you may not receive all messages, i.e. you may e.g. receive scan points of different segments. We therefore recommend to register a message callback instead of a WaitNext-function. With a registered message callback, you will get all fullframe and segment pointcloud messages.