roverc
¶
Rover data collection platform.
Supported sensors:
- Radar: TI AWR1843 / DCA1000EVM.
- IMU: XSens MTi-3.
- Lidar: Ouster lidar.
- Camera: Any UVC camera.
roverc.Camera
¶
Bases: Sensor
Video camera.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
idx
|
int
|
camera index in |
0
|
width
|
int
|
frame width, in pixels. |
1920
|
height
|
int
|
frame height, in pixels. |
1080
|
fps
|
float
|
camera framerate. Make sure the camera/capture card supports this exact framerate! |
60.0
|
name
|
str
|
sensor name, i.e. "camera". |
'camera'
|
Source code in collect/roverc/camera.py
capture
¶
capture(path: str) -> None
Create capture (while active
is set).
Source code in collect/roverc/camera.py
roverc.CameraCapture
¶
Bases: Capture
Camera capture data.
Source code in collect/roverc/camera.py
close
¶
roverc.Capture
¶
Bases: ABC
Capture data for a generic sensor stream.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
directory path to write data to. |
required |
fps
|
float
|
target framerate |
1.0
|
report_interval
|
float
|
interval for reporting sensor statistics, in seconds |
5.0
|
log
|
Logger | None
|
parent logger to use |
None
|
Source code in collect/roverc/common.py
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 |
|
close
¶
end
¶
Mark end of current frame processing.
Source code in collect/roverc/common.py
reset_stats
¶
Reset (and log) tracked statistics.
Four values are logged:
f
: frequency of the capture sensor, in Hz.u
: utilization of the capture, in percent.w
: WCET (worst-case execution time) of the capture, in ms.q
: maximum queue length.
The log message is usually info
, unless certain targets are violated:
error
: if the observed frequency drops below 90% of the target, or the WCET exceeds the deadline (i.e.T = D < C
).warning
: if the observed frequency drops below 99% of the target, or the WCET exceeds 90% of the deadline.
Source code in collect/roverc/common.py
start
¶
start(timestamp: float | None = None) -> None
Mark start of current frame processing.
- Records the current time as the timestamp for this frame, and
- Marks the start of time utilization calculation for this frame.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
timestamp
|
float | None
|
timestamp to use; if |
None
|
Source code in collect/roverc/common.py
roverc.IMU
¶
Bases: Sensor
Xsens IMU Sensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
port
|
str
|
serial port to use. Must have read/write permissions, e.g.
|
'/dev/ttyUSB0'
|
baudrate
|
int
|
serial baudrate. |
115200
|
fps
|
float
|
imu reading rate (Hz). |
100.0
|
name
|
str
|
sensor name, i.e. "imu". |
'imu'
|
Source code in collect/roverc/imu.py
capture
¶
capture(path: str) -> None
Create capture (while active
is set).
NOTE: we discard the first 100 samples due to rate instability, likely due to serial port read latency/batching.
Source code in collect/roverc/imu.py
roverc.IMUCapture
¶
Bases: Capture
IMU capture data.
Source code in collect/roverc/imu.py
close
¶
roverc.Lidar
¶
Bases: Sensor
Ouster Lidar sensor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
addr
|
Optional[str]
|
lidar IP address; found automatically via
|
None
|
port_lidar
|
int
|
lidar port; default 7502. |
7502
|
port_imu
|
int
|
integrated imu port; default 7503. |
7503
|
mode
|
str
|
lidar mode |
'2048x10'
|
beams
|
int
|
number of lidar beams. |
64
|
name
|
str
|
sensor name, i.e. "lidar". |
'lidar'
|
Source code in collect/roverc/lidar.py
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 |
|
capture
¶
capture(path: str) -> None
Create capture (while active
is set).
Source code in collect/roverc/lidar.py
get_ip
staticmethod
¶
get_ip() -> Optional[str]
Get IP address of ouster sensor.
Source code in collect/roverc/lidar.py
roverc.LidarCapture
¶
Bases: Capture
Lidar capture data.
Source code in collect/roverc/lidar.py
close
¶
roverc.Radar
¶
Bases: Sensor
TI AWR1843Boost Radar Sensor & DCA1000EVM capture card.
See XWRSystem
for arguments.
Source code in collect/roverc/radar.py
capture
¶
capture(path: str) -> None
Create capture (while active
is set).
Source code in collect/roverc/radar.py
roverc.RadarCapture
¶
Bases: Capture
Radar capture data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
directory path to write data to. |
required |
fps
|
float
|
target framerate |
1.0
|
report_interval
|
float
|
interval for reporting sensor statistics, in seconds |
5.0
|
log
|
Logger | None
|
parent logger to use |
None
|
shape
|
Sequence[int]
|
radar shape. |
[]
|
Source code in collect/roverc/radar.py
close
¶
write
¶
write(data: RadarFrame) -> None
roverc.Sensor
¶
Bases: ABC
Generic sensor channel.
Communicates using local AF_UNIX
sockets using the socket
/tmp/rover/{name}
with the provided sensor name.
Warning
Each sensor node should be initalized first.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
sensor name, e.g. lidar, camera, radar |
required |
addr
|
str
|
socket base address, i.e. |
'/tmp/rover'
|
report_interval
|
float
|
logging interval for statistics |
10.0
|
fps
|
float
|
expected framerate for this sensor, in frames per second. |
1.0
|
Source code in collect/roverc/common.py
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 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
|
close
¶
loop
¶
Main control loop (spins until exit
is received).