Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SickScanApi-Functions error handling #260

Closed
cblesing opened this issue Jan 17, 2024 · 2 comments
Closed

SickScanApi-Functions error handling #260

cblesing opened this issue Jan 17, 2024 · 2 comments

Comments

@cblesing
Copy link

Hi everyone,

according to the comments in the header file, there shoul be a possibility to check if the api functions return successfully or not. There is an enum called SickApiErrorCodes which should be used to cover that behavior.

In our application we use the SickScanApiInitByCli-Method and the SickScanApiRegisterCartesianPointCloudMsg-Method to get the scanner up. But even if I disconnect the scanner (LMS1000) in a physical way the first named Method allways returned 0 which means SICK_SCAN_API_SUCCESS. The fact that the callback method could be registered successfully is fine, because the callback is there.

My question is how to do this right, so that we receive error codes in case that the scanner is not physicaly connected?

Best regards,
Christian

@rostest
Copy link
Collaborator

rostest commented Jan 17, 2024

Thanks for your feedback. SickScanApiInitByCli starts the lidar initialization, including background threads to handle TCP communication, lidar setup and reconnection after connection failures. In case of SICK_SCAN_API_SUCCESS, this process has started successfully.

Currently the API does not provide functions to query the current lidar state resp. to get error messages and error codes in case of failures. We will provide these functions in a future release.

To detect errors of any kind, you can monitor the receipt of pointcloud messages within your application.

@rostest
Copy link
Collaborator

rostest commented Jan 23, 2024

@cblesing Please find an update in branch https://github.com/SICKAG/sick_scan_xd/tree/feature/api_diagnostics, which exports diagnostic status and messages via the API. You can now register callbacks using SickScanApiRegisterDiagnosticMsg and SickScanApiRegisterLogMsg, or query the current status with function SickScanApiGetStatus. A callback function registered with SickScanApiRegisterDiagnosticMsg will be called, whenever the status changed (INIT, EXIT or OK) or an error occured (WARN or ERROR). See the diagnostic API description and example sick_scan_xd_api_test.cpp for details.
Note that this update is a cumulative update with multiple changes.

@rostest rostest closed this as completed Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants