ros.node
This file contains the estimator node for ROS 2.
Essentially this file provides a wrapper for the estimators to be used with ROS data. The estimates get published to ROS as well.
TODO Subscribed and published topics...
MPEstimator(settings, stop_event=None)
¶
This class starts a batched estimator for all drones in settings.drone_names and the necessary subscribers and publishers.
Note: Since all results are published individually, one might want to synchronize on the receiving end. For that see https://docs.ros.org/en/rolling/p/flex_sync/ https://github.com/ros2/message_filters
In the future, a custom message type might be advantageous. However, to keep it simple, we use standard message types.
Start the subscriber and publisher processes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
settings
|
Munch
|
The estimator settings, including the names of all drones in the batch. |
required |
stop_event
|
Event | None
|
Event that stops the estimator and its processes once set. If None, a new event is created. |
None
|
Source code in drone_estimators/ros/node.py
close()
¶
Stop the subscriber and publisher processes and save the data if enabled.
Source code in drone_estimators/ros/node.py
run()
¶
Main estimator loop.
Source code in drone_estimators/ros/node.py
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 | |
launch_estimators(estimators)
¶
Launch one process per batch of estimators and block until a keyboard interrupt.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
estimators
|
dict
|
The settings of each estimator, keyed by name. Estimators with identical settings (except for the drone name) are run as one batch. |
required |
Source code in drone_estimators/ros/node.py
launch_node(settings, stop_event)
¶
Run an estimator node until the stop event is set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
settings
|
Munch
|
The estimator settings, including the names of all drones in the batch. |
required |
stop_event
|
Event
|
Event that stops the estimator and its processes once set. |
required |