Common Module
measure
Measure
Class that represents a single measurement from the RPLidar.
Source code in devices\raspberry_pi_5\src\common\measure.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
|
angle
property
writable
Get the angle of the measure.
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
Angle of the measure. |
distance
property
writable
Get the distance of the measure.
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
Distance of the measure. |
quality
property
writable
Get the quality of the measure.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
Quality of the measure. |
__init__(angle, distance, quality)
Initialize the Measure instance.
Source code in devices\raspberry_pi_5\src\common\measure.py
17 18 19 20 21 22 23 |
|
__repr__()
String representation of the Measure object for debugging.
Source code in devices\raspberry_pi_5\src\common\measure.py
34 35 36 37 38 |
|
__str__()
String representation of the Measure object.
Source code in devices\raspberry_pi_5\src\common\measure.py
25 26 27 28 29 30 31 32 |
|
from_string(measure_str)
classmethod
Create a Measure object from a string representation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
measure_str
|
str
|
String representation of the measure. |
required |
Returns:
Name | Type | Description |
---|---|---|
Measure |
Optional[Measure]
|
Measure object created from the string. |
Source code in devices\raspberry_pi_5\src\common\measure.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
from_string_to_measures(measures_str)
classmethod
Convert a string representation of measures back to a list of Measure objects.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
measures_str
|
str
|
String representation of measures. |
required |
Returns:
Name | Type | Description |
---|---|---|
List |
List
|
List of Measure objects. |
Source code in devices\raspberry_pi_5\src\common\measure.py
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
|
get_properties_from_string(measure_str)
classmethod
Get the properties of a Measure object from its string representation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
measure_str
|
str
|
String representation of the measure. |
required |
Returns:
Name | Type | Description |
---|---|---|
tuple |
tuple
|
A tuple containing the angle, distance, and quality of the measure. |
Source code in devices\raspberry_pi_5\src\common\measure.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
|
measures_to_string(measures)
classmethod
Convert a list of Measure objects to a string representation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
measures
|
List
|
List of Measure objects. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
String representation of the measures. |
Source code in devices\raspberry_pi_5\src\common\measure.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
|