Table of Contents
rplidar_read
Returns information about the RPLidar.
Description
The rplidar_read function returns information about the RPLidar ranging sensor, such as the hardware and firmware version numbers and the model number.
Prototype
t_error rplidar_get_device_information(t_ranging_sensor sensor, t_ranging_sensor_information* information);
Parameters
t_ranging_sensor sensor
A handle to the sensor, as returned by rplidar_open.
t_ranging_sensor_information * information
A pointer to a variable to receive the sensor device information. The returned structure has the following fields:
Data Type |
Field |
Description |
---|---|---|
t_version |
hardware_version |
The hardware version. |
t_version |
firmware_version |
The firmware version. |
t_uint16 |
model |
The model number of the device. |
Return value
Returns zero on success. Otherwise a
negative error code is returned. Error codes are
defined in quanser_errors.h
. A suitable error message
may be retrieved using msg_get_error_message.
Error codes
QERR_INVALID_ARGUMENT
One of the arguments is invalid.
Requirements
Include Files |
Libraries |
---|---|
quanser_ranging_sensor.h |
quanser_devices.lib;quanser_communications.lib;quanser_runtime.lib;quanser_common.lib |
Examples
t_ranging_sensor lidar; t_error result = rplidar_open("serial-cpu://localhost:1?baud='256000',word='8',parity='none',stop='1',flow='none',dsr='on'", RANGING_DISTANCE_LONG, &lidar); if (result == 0) { t_ranging_sensor_information information; result = rplidar_get_device_information(lidar, &information); ... rplidar_close(lidar); } else { TCHAR message[512]; msg_get_error_message(NULL, result, message, sizeof(message)); _tprintf(_T("Failed to open RPLidar. %s (error %d)\n"), message, -result); }
See Also
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.