Skip to content

Commit 5a31cbf

Browse files
committed
added how-to on using passthrough estimator
1 parent d5a8092 commit 5a31cbf

File tree

1 file changed

+145
-0
lines changed

1 file changed

+145
-0
lines changed
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
---
2+
title: Passthrough estimator
3+
pagination_label: Using the passthrough estimator within MRS system
4+
description: A guide on how to use the passthrough estimator within MRS system
5+
---
6+
7+
# Passthrough Estimator
8+
9+
By default, the MRS system uses a state estimator running as a plugin within the `estimation_manager` nodelet to provide the full state estimate required for the feedback control of the UAV.
10+
The state estimator supplies the state estimate at the frequency required for stable flight and verifies whether measurements from all fused sensors/algorithms are coming, have correct timestamp, etc.
11+
12+
Is some cases it might be necessary to bypass the state estimation altogether.
13+
Example use cases include conserving computational power on low-power CPUs, and enabling agile flights that require minimal delay in the estimated state.
14+
In such cases, the passthrough estimator can be used to pass an odometry message from an algorithm into the MRS system.
15+
However, the health checks, filtering, outlier rejection, and other processing steps normally performed by the estimation manager will not occur when the passthrough estimator is used.
16+
Additionally, the `world_origin` frame will not be available while using the passthrough estimator, as it is designed for use both with and without GNSS (which is required to specify `world_origin`).
17+
18+
## ⚠️ Important Warning
19+
20+
**The quality control and sanitization of data when using the passthrough estimator is the responsibility of the user!
21+
Using unhealthy data can be extremely dangerous (e.g., sudden jumps in variables, inconsistent time intervals, velocities in incorrect frames, etc.)!
22+
Be sure to fully understand the implications and always verify functionality in simulation and handheld flight before deployment.**
23+
24+
## Minimal Odometry Quality Checks
25+
26+
The odometry used as input for the passthrough estimator must satisfy at least the following conditions:
27+
28+
* Sufficient Rate — The odometry must be provided at a rate that meets or exceeds the control manager’s requirements for each [control modality](https://github.com/ctu-mrs/mrs_uav_managers/blob/da86b6229468a4dcf2e7d0f4da7c4e18808bdfc2/src/control_manager/control_manager.cpp#L1566C1-L1590C6) :
29+
* Actuators commands, control group: 250 Hz
30+
* *Attitude rate, attitude* (most common): 100 Hz
31+
* Acceleration + heading rate, acceleration + heading: 40 Hz
32+
* Velocity + heading rate, velocity + heading, position + heading: 20 Hz
33+
* Consistent dt — The dt between messages should remain stable
34+
* 0.01 s between all messages for 100 Hz odometry is good
35+
* 0.01 s between some messages but sometimes 0.05 s for 100 Hz odometry is bad
36+
* Smooth state variables — No sudden jumps between messages
37+
* e.g. if a position suddenly jumps 2 meters due to a loop closure, it is bad
38+
* Body-frame velocities — The linear and angular velocities are in the body (FCU) frame of the UAV
39+
* The frame must be specified in the `child_frame_id` of the odometry message (e.g., `uav1/fcu`)
40+
* Consistend pose and velocity — The pose should correspond with integrated velocities (up to some reasonable drift)
41+
42+
## Running the Passthrough Estimator
43+
44+
The passthrough estimator is available in the MRS system by default; it only needs to be set up and activated.
45+
Follow these steps to run the passthrough estimator in simulation:
46+
47+
1. Specify the passthrough estimator parameters in the `custom_config.yaml` of your tmux session:
48+
49+
```yaml
50+
mrs_uav_managers:
51+
estimation_manager:
52+
# loaded state estimator plugins
53+
state_estimators: [
54+
"passthrough",
55+
]
56+
57+
initial_state_estimator: "passthrough" # will be used as the first state estimator
58+
agl_height_estimator: "" # only slightly filtered height for checking min height (not used in control feedback)
59+
60+
passthrough:
61+
max_flight_z: 100.0 # [m] maximum allowed flight Z (in the estimator frame)
62+
message:
63+
topic: "hw_api/odometry" # the topic of the odometry that should be passed through
64+
```
65+
66+
2. Specify the constraints and gains for the passthrough estimator in the `custom_config.yaml`:
67+
68+
```yaml
69+
mrs_uav_managers:
70+
constraint_manager:
71+
72+
estimator_types: [
73+
"passthrough"
74+
]
75+
76+
constraints: [
77+
"slow",
78+
"medium",
79+
"fast"
80+
]
81+
82+
# list of allowed gains per odometry mode
83+
allowed_constraints:
84+
passthrough: ["slow", "medium", "fast"]
85+
86+
# those gains will be used automatically when a localization mode switches
87+
# and the current gains are not in the allowed list (next paragraphs)
88+
default_constraints:
89+
passthrough: "slow"
90+
91+
gain_manager:
92+
93+
estimator_types: [
94+
"passthrough"
95+
]
96+
97+
gains: [
98+
"soft"
99+
]
100+
101+
# list of allowed gains per odometry mode
102+
allowed_gains:
103+
passthrough: ["soft"]
104+
105+
# those gains will be used automatically when a localization mode switches
106+
# and the current gains are not in the allowed list (next paragraphs)
107+
default_gains:
108+
passthrough: "soft"
109+
```
110+
111+
3. Specify the safety area in `world_config.yaml` in the `local_origin` frame:
112+
113+
```yaml
114+
safety_area:
115+
116+
enabled: true
117+
118+
horizontal:
119+
120+
# the frame of reference in which the points are expressed
121+
frame_name: "local_origin"
122+
123+
# polygon
124+
#
125+
# x, y [m] for any frame_name except latlon_origin
126+
# x = latitude, y = longitude [deg] for frame_name=="latlon_origin"
127+
points: [
128+
-50, -50,
129+
50, -50,
130+
50, 50,
131+
-50, 50,
132+
]
133+
134+
vertical:
135+
136+
# the frame of reference in which the max&min z is expressed
137+
frame_name: "local_origin"
138+
139+
max_z: 30.0
140+
min_z: 0.5
141+
```
142+
143+
## Example Simulation Session
144+
145+
An example simulation session for running the passthrough estimator is located [here](https://github.com/ctu-mrs/mrs_core_examples/tree/tmux/tmux/passthrough_estimator).

0 commit comments

Comments
 (0)