Skip to content
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

Merged
merged 13 commits into from Jun 28, 2016

Conversation

bartslinger
Copy link
Contributor

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.

_out[i] = _in1[i] - _in2[i];
}
}

Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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?

Copy link
Member

@flixr flixr Jun 21, 2016

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bartslinger
Copy link
Contributor Author

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]);
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@bartslinger
Copy link
Contributor Author

Ok this is weird, from the failed build log:

$ sudo add-apt-repository ppa:paparazzi-uav/ppa -y
$ sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa -y
Cannot add PPA: 'ppa:team-gcc-arm-embedded/ppa'.
Please check that the PPA name or format is correct.
The command "sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa -y" failed and exited with 1 during .

…heli_indi_pr

Conflicts:
	conf/airframes/TUDELFT/tudelft_walkera_genius_v2.xml
@flixr
Copy link
Member

flixr commented Jun 28, 2016

That happens sometimes in travis, no idea why... maybe a caching problem on their build farm...
Restarting the build usually does the trick...

@bartslinger
Copy link
Contributor Author

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[])
Copy link
Member

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...

@flixr
Copy link
Member

flixr commented Jun 28, 2016

Thanks!

@flixr flixr merged commit 84162e1 into paparazzi:master Jun 28, 2016
@bartslinger bartslinger deleted the heli_indi_pr branch June 29, 2016 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants