pros_sys/distance.rs
1use core::ffi::*;
2
3extern "C" {
4 /** Get the currently measured distance from the sensor in mm
5
6 This function uses the following values of errno when an error state is
7 reached:
8 ENXIO - The given value is not within the range of V5 ports (1-21).
9 ENODEV - The port cannot be configured as an Distance Sensor
10
11 \param port The V5 Distance Sensor port number from 1-21
12 \return The distance value or PROS_ERR if the operation failed, setting
13 errno.*/
14 pub fn distance_get(port: u8) -> i32;
15 /** Get the confidence in the distance reading
16
17 This is a value that has a range of 0 to 63. 63 means high confidence,
18 lower values imply less confidence. Confidence is only available
19 when distance is > 200mm (the value 10 is returned in this scenario).
20
21 This function uses the following values of errno when an error state is
22 reached:
23 ENXIO - The given value is not within the range of V5 ports (1-21).
24 ENODEV - The port cannot be configured as an Distance Sensor
25
26 \param port The V5 Distance Sensor port number from 1-21
27 \return The confidence value or PROS_ERR if the operation failed, setting
28 errno.*/
29 pub fn distance_get_confidence(port: u8) -> i32;
30 /** Get the current guess at relative object size
31
32 This is a value that has a range of 0 to 400.
33 A 18" x 30" grey card will return a value of approximately 75
34 in typical room lighting.
35
36 This function uses the following values of errno when an error state is
37 reached:
38 ENXIO - The given value is not within the range of V5 ports (1-21).
39 ENODEV - The port cannot be configured as an Distance Sensor
40
41 \param port The V5 Distance Sensor port number from 1-21
42 \return The size value or PROS_ERR if the operation failed, setting
43 errno.*/
44 pub fn distance_get_object_size(port: u8) -> i32;
45 /** Get the current guess at relative object size
46
47 This is a value that has a range of 0 to 400.
48 A 18" x 30" grey card will return a value of approximately 75
49 in typical room lighting.
50
51 This function uses the following values of errno when an error state is
52 reached:
53 ENXIO - The given value is not within the range of V5 ports (1-21).
54 ENODEV - The port cannot be configured as an Distance Sensor
55
56 \param port The V5 Distance Sensor port number from 1-21
57 \return The size value or PROS_ERR if the operation failed, setting
58 errno.*/
59 pub fn distance_get_object_velocity(port: u8) -> c_double;
60}