Skip to content

Commit c57f693

Browse files
committed
Add doc for tracker plugin interface
1 parent 98d272c commit c57f693

File tree

4 files changed

+70
-7
lines changed

4 files changed

+70
-7
lines changed

docs/45-plugin-interface/02-trackers.md

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: Tracker plugins
3+
pagination_label: API for the tracker plugins
4+
description: API for the tracker plugins
5+
---
6+
7+
# The Tracker plugin interface
8+
9+
10+
The Tracker plugin receives the high-level references from a Mission \& navigation software and provides the UAV state reference to the [Feedback controller](https://ctu-mrs.github.io/docs/features/controllers/) that ensure the UAV follows the reference.
11+
In general, the high-level referene received from the Mission \& navigation software can be
12+
13+
* a single position and heading reference,
14+
* a trajectory, consisting of several position and heading references separated by a fixed time constant.
15+
16+
Diagram below shows the data architecture of the MRS system where the block containing the Tracker plugin is marked in red.
17+
18+
The tracker plugin is compiled as [ROS plugins](http://wiki.ros.org/pluginlib) with the [interface](https://github.com/ctu-mrs/mrs_uav_managers/blob/master/include/mrs_uav_managers/tracker.h) defined by the [control manager](https://github.com/ctu-mrs/mrs_uav_managers).
19+
A tracker plugin from any ROS package can be loaded dynamically by the [control manager](https://github.com/ctu-mrs/mrs_uav_managers) without it being present during [control manager](https://github.com/ctu-mrs/mrs_uav_managers)'s compile time.
20+
Loaded trackers can be switched by the [control manager](https://github.com/ctu-mrs/mrs_uav_managers) in mid-flight, which allows safe testing of new trackers and adds flexibility the [MRS UAV system](https://github.com/ctu-mrs/mrs_uav_system).
21+
![](./fig/diagram_of_system_architecture.jpg)
22+
23+
## Tracker plugin - outputs
24+
The tracker plugin can output the combination following references:
25+
26+
* Acceleration
27+
* Jerk
28+
* Snap
29+
* Attitude rate
30+
* Heading
31+
* Heading rate
32+
* Heading acceleration
33+
* Heading jerk
34+
* Orientation
35+
* Throttle
36+
* Full state prediction
37+
38+
In the tracker plugin source code, you can decide which references should be considered by the [Feedback controller](https://ctu-mrs.github.io/docs/features/controllers/).
39+
If you develop your own [controller plugin](https://ctu-mrs.github.io/docs/plugin-interface/controllers/), ensure that your controller supports the required tracker references.
40+
41+
## Example tracker plugin
42+
43+
An example of a cutom tracker plugin can be found at [this link](https://github.com/ctu-mrs/mrs_core_examples/tree/master/cpp/tracker_plugin).
44+
It is highly reccomended to base your tracker plugin on this example.
45+
In the example, there is also a [tmux folder](https://github.com/ctu-mrs/mrs_core_examples/tree/master/cpp/tracker_plugin/tmux) containing a script that starts the simulation of a UAV in the [MRS multirotor simulator](https://github.com/ctu-mrs/mrs_multirotor_simulator), where the UAV uses the [example tracker plugin](https://github.com/ctu-mrs/mrs_core_examples/tree/master/cpp/tracker_plugin).
46+
You have to install [MRS UAV system](https://github.com/ctu-mrs/mrs_uav_system) first to run the example.
47+
To load the tracker plugin into the [MRS UAV system](https://github.com/ctu-mrs/mrs_uav_system), you need to provide a custom config file to the [MRS UAV Core](https://github.com/ctu-mrs/mrs_uav_core) containing the parameters for the tracker plugin.
48+
The custom config file should contain the following lines (taken from [custom config file of example tracker plugin](https://github.com/ctu-mrs/mrs_core_examples/blob/master/cpp/tracker_plugin/tmux/config/custom_config.yaml)):
49+
```yaml
50+
mrs_uav_managers:
51+
52+
control_manager:
53+
54+
ExampleTracker:
55+
address: "example_tracker_plugin/ExampleTracker"
56+
namespace: "example_tracker"
57+
human_switchable: true
58+
59+
# list of names of dynamically loaded trackers
60+
trackers : [
61+
"ExampleTracker",
62+
]
63+
```
64+
65+
### Parameter description for tracker plugin
66+
67+
```address: "example_tracker_plugin/ExampleTracker``` : Specifies the address of the plugin to be loaded into the interface as a tracker.
68+
```namespace: "example_tracker"``` : Specifies the namespace of the tracker as per the package description in the plugin.
69+
```human_switchable: true``` : Specifies whether the tracker can be switched by the user during flight.
70+
Loading

0 commit comments

Comments
 (0)