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

Add full state setpoints #382

Merged
merged 13 commits into from
Aug 29, 2023
Merged

Add full state setpoints #382

merged 13 commits into from
Aug 29, 2023

Conversation

knmcguire
Copy link
Member

So this adds the possibility to send full state set-point from the CFlib to the Crazyflie. This is in the light of that the decoders on the crazyflie crtp receiving should always be reflected in the cflib.

This includes a

  • send_full_state_setpoint() function
  • a demo script that tests this
  • renamed fp16.py in utils to encoding.py to make it more generic .

It's in draft for now. I'm not sure if the compressing really works, and I get a packet is too large error so got to look at this as well. Btw, I based the compressing function on the cpp library by @whoenig

@knmcguire
Copy link
Member Author

so now it flies with the demo script, but I think something still is off with the unpacking since it flies to 1.0 and still has a velocity.

@knmcguire
Copy link
Member Author

hmm if I use this full state setpoint for PID, it takes off, and it glides towards one direction, perhaps because the setpoint of roll pitch and yaw is 20 degrees in the beginning before showing the right setpoint at 0 degrees. It doesn't seem to be due to the compression. I haven't tested mellinger in flight yet but perhaps that doesn't happen?

@whoenig is fullstatesetpoint suppose to work with PID as well or with mellinger alone?

@whoenig
Copy link
Contributor

whoenig commented Feb 17, 2023

I think it should work with PID. Internally all it sets is position control in the setpoint struct (with feed-forward terms for velocity/acceleration, which the PID controller might ignore).

@knmcguire
Copy link
Member Author

that's what I thought... not sure where this would come from then especially since with PID, the attitude setpoint will get overwritten anyway, or else I would have thought that the compressing still goes wrong somewhere. So more investigation is necessary

@knmcguire
Copy link
Member Author

so I confirm, for mellinger, this does not work either. So more investigation is necessary!

Next step:

  • unit tests for the compress decompress
  • Test to see how the setpoints are changed on the crazyflie-firmware side.

@knmcguire knmcguire closed this Apr 11, 2023
@knmcguire knmcguire linked an issue Apr 12, 2023 that may be closed by this pull request
@krichardsson
Copy link
Contributor

Fixing the last parts

@krichardsson krichardsson reopened this Aug 29, 2023
@krichardsson krichardsson marked this pull request as ready for review August 29, 2023 11:45
@tobbeanton tobbeanton merged commit a6c7045 into master Aug 29, 2023
1 check passed
@tobbeanton tobbeanton deleted the add-setpoints branch August 29, 2023 12:23
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.

Fullstate setpoint implementation
4 participants