Detecting elevation inside range

Hi,
I’m trying to combine two elevation detectors to detect events when the elevation of a spacecraft falls into a certain range [low, high]. E1 is an ElevationDetector with const elevation high, and E2 is an ElevationDetector with const elevation low.
Tried to combine them using andCombine([E2, notCombine(E1)]). Should this work?

BTW, I’m pleased with all the help you have provided in these formus.

Hello @5tardust,

This should Indeed do the trick ! Just be careful with the “maxCheck” setting as your combined detector could miss the event if the range is small.

We are happy to help :+1:

Cheers,
Vincent

Hi there,

Note that combining detectors is not performant in the sense that elevation will be computed twice (might not be a problem for your application). You could create your own detector with g like that:
g = (el - el_min) * (el - el_max)
You can check out in ElevationDetector how the elevation is obtained from the state.

Cheers,
Romain.

2 Likes