-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[guidance] Expansion of the guided protocol #1694
Conversation
} | ||
guidance_h_set_guided_vel(x, y); | ||
} else { // position setpoint | ||
if ((flags & 3) == 0) { // set absolute position setpoint |
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.
use bit_is_set
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 wanted to check the two bits at the same time... ok, wilco
Kirk
On 01/06/16 13:32, Roland Meertens wrote:
In sw/airborne/firmwares/rotorcraft/autopilot.c
#1694 (comment):+{
- /* only update setpoints when in guided mode */
- if (autopilot_mode != AP_MODE_GUIDED) {
- return;
- }
- // handle x,y
- if (bit_is_set(flags, 5)) { // velocity setpoint
- if (bit_is_set(flags, 1)) { // set velocity in body frame
float psi = stateGetNedToBodyEulers_f()->psi;
x = cosf(-psi) \* x + sinf(-psi) \* y;
y = -sinf(-psi) \* x + cosf(-psi) \* y;
- }
- guidance_h_set_guided_vel(x, y);
- } else { // position setpoint
- if ((flags & 3) == 0) { // set absolute position setpoint
use bit_is_set
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/paparazzi/paparazzi/pull/1694/files/c64e3d95546f612c5d16ce11f85c54caea57da84#r65343865,
or mute the thread
https://github.com/notifications/unsubscribe/ACtEQ1EHhyipyiInPJf_FvBC94nl6C9aks5qHW26gaJpZM4IqAR-.
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 know ;)
Kudo's for knowing this trick 👍
@rmeertens thanks for the comment, think its cleaner this way. Do you have time to test this this tomorrow with me as I don't know how the python scripts work? |
line 606: bit is set needs to have the flags ;) |
5e7dcb2
to
eec1361
Compare
e2263ca
to
9ab30d4
Compare
Ok, this seems to be good now. Tested and working as we would expect. @flixr how does it look to you? |
@@ -576,6 +575,77 @@ bool autopilot_guided_move_ned(float vx, float vy, float vz, float heading) | |||
return false; | |||
} | |||
|
|||
/* Set guided mode setpoint |
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.
please use doxygen style comments so it actually ends up in the generated documentation....
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.
ah, ok, doxygen comment in the header file...
Looks good to me :-) Also we should probably add |
I just updated the python script slightly and tested it as is on a parrot ardrone and it works pretty well! |
oh, oops you already merged it, haha. I will make a new request to update the script. |
no, this is not merged yet... only the changes in pprzlink are merged... |
We expanded the message flag definition to facilitate updating the horizontal and vertical setpoints in different reference frames as well as separate definitions of whether the setpoints are position or velocity commands. Also added a heading rate setpoint.
This is a draft pull request, I still need to test it (especially the new rate setpoint) before it can be approved. Feedback is welcome @rmeertens.
continues/replaces #1686