- Invert logic using early returns to limit indenting.
- Use write instead of fwrite to avoid leak to do fdopen which needs to
be left open because fclose would also close the file descriptor.
- Only try to set up SiK radios if it has been detected based on the
RADIO_STATUS message that is sent.
Signed-off-by: Julian Oes <julian@oes.ch>
The _control_mode_current wasn't updated otherwise, and only done so by luck
because we already set the current type to SETPOINT_TYPE_POSITION.
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
- double required max consecutive counts
- don't continuously complain about round trip time (RTT) unless
there's been at least one acceptable round trip (latency < 100 ms)
Before this fix, the time_utc_usec output from blending was always 0.
This means that you wouldn't get a valid vehicle_gps_position/time_utc_usec
With this commit, UTC timestamps are blended according to weights for
all GPSes with a nonzero UTC timestamp value.
It would be possible to simply use the first valid UTC timestamp instead
of blending, but since the system timestamps are blended, it seems
suitable to blend UTC timestamps as well.
- This fixes the force call on SensorSelectionUpdate
- In contrary to the rest of the codebase, this method also takes a timestamp: When you call SensorSelectionUpdate(true), time_now_us is actually set to 1 and force stays false, as this is the default value for in the method.
wait_until_altitude() checks for absolute altitude being
close so checking for 1m below the setpoint can fail
if the speedup results in no sample inside the altitude
window being checked.
Ideally the test could check if the takeoff is done directly
instead of comparing altitudes in the first place.
-remove external init, and instead always (but only) init when dt is too large
-init the controller params correctly
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
The control params (eg min/max pitch) are used before they are
correctly set by TECS::update(). While this is an issue we should fix,
it also doesn't hurt to set them to more reasobale values (eg 30° limit).
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
As discussed in the maintainer call we should adhere to the
parameter naming scheme that makes it clear what vehicle type the
configuration is good for.
by only applying the sqrt linear drag when brakeing.
It was originally not done this way to avoid discontinuities and
the exact speed bewlo 1m/s didn't matter. With the position slow mode
the exact slow speeds now matter. And the discontinuities are avoided by
reusing the brake boost filter.