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

Use correct yaw convention in motion commander #516

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gemenerik
Copy link
Member

@gemenerik gemenerik commented Feb 11, 2025

This PR updates the motion commander to use the correct yaw convention for yaw rate, aligning with the Crazyflie coordinate system. Specifically, it ensures that yaw rate follows the right-hand rule, as defined in the Crazyflie documentation.

To achieve this, it requires reverting commit f6c0e73 in crazyflie-firmware. That commit inverted the received yaw rates upon arrival, which is no longer necessary. The corresponding change is implemented in bitcraze/crazyflie-firmware#1456.

These two PRs must be merged together to avoid flipping the yaw rate (again). While we could consider maintaining compatibility, this was ultimately a bug—implemented incorrectly and inconsistently across different motion commander calls.

Fixes: #389

Requires reverting commit f6c0e73 in `crazyflie-firmware`, i.e., requires no longer inverting received yaw rates upon arrival in `crazyflie-firmware`
@ArisMorgens ArisMorgens requested review from ArisMorgens and removed request for ArisMorgens February 13, 2025 09:02
@ArisMorgens
Copy link
Member

Looks good!

… backward compatibility

The lib now checks the Crazyflie's CRTP version before sending velocity, zdistance, or hover setpoints. If the Crazyflie is outdated, it sends the legacy type with the original (negated) yaw to maintain compatibility. If the Crazyflie supports the new format, it sends the updated type with the correct yaw sign. This ensures a smooth transition when updating either the lib or Crazyflie separately. The legacy type will be deprecated in a future update.
@gemenerik
Copy link
Member Author

Latest commits to this and bitcraze/crazyflie-firmware#1456 ensure compatibility when updating either the Crazyflie or lib independently. The lib now checks the Crazyflie's CRTP version and sends either the legacy packet (with the original negated yaw) or the new packet type (with the corrected yaw sign). This allows for a smooth transition without breaking existing functionality. The legacy types will be deprecated in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

motion commander, start_linear_motion reverse yaw
2 participants