New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[stabilization] helicopter indi controller #1752
Conversation
_out[i] = _in1[i] - _in2[i]; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be some functions that have this functionally, check sw/airborne/math/pprz_simple_matrix.h.
If you have time, you could add a math file which has the wrappers for the matrix computations for vectors. I think these functions would be interesting for others not just for indi, you would just make the INDI_DOF the input t the general function.
If you don't have time (or the interest) maybe make an issue for to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I can change the matrix thing to MAT_MUL_T
What would be the best location to add the vector functions (with length as variable), pprz_algebra.h?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in the pprz_simple_matrix.h. Or maybe in a pprz_vector.h. @flixr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are n-dim float_vect_x
functions in pprz_algebra_float.h, so I guess a fixedpoint equivalent should go into pprz_algebra_int.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not use MAT_MUL because it assigns a float zero. I'm not 100% sure about the double pointer stuff here. |
static inline void indi_apply_measurement_butterworth_filters(int32_t _out[], int32_t _in[]) | ||
{ | ||
for (uint8_t i = 0; i < INDI_DOF; i++) { | ||
_out[i] = update_butterworth_2_low_pass_int(&measurement_lowpass_filters[i], _in[i]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have twice the same function with a different filter struct? can that not be an argument?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, will change that. Also applies for the notch filters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed duplicate code for notch filters. Its not really trivial to make the filter struct an argument without reducing the flexibility. Like it is now, its easy to replace one filter with another.
Ok this is weird, from the failed build log:
|
…heli_indi_pr Conflicts: conf/airframes/TUDELFT/tudelft_walkera_genius_v2.xml
That happens sometimes in travis, no idea why... maybe a caching problem on their build farm... |
I think this is now mergable |
//_out[INDI_THRUST] = _in[INDI_THRUST]; | ||
} | ||
|
||
static inline void indi_apply_notch_filters(struct SecondOrderNotchFilter *filter, int32_t _out[], int32_t _in[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all these apply functions should not be inline, since you want to use pointers to these functions later...
Thanks! |
This is an INDI controller for a small helicopter. It was flight-tested on a walkera genius cp v2. When it is merged, I can add documentation to the wiki on how to use it. It is quite different from the other INDI controller, so therefore I suggest to not combine it with the other one.