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

Understanding the format of a behavior: trigger axis #13

Closed
durka opened this issue Dec 26, 2021 · 2 comments
Closed

Understanding the format of a behavior: trigger axis #13

durka opened this issue Dec 26, 2021 · 2 comments

Comments

@durka
Copy link

durka commented Dec 26, 2021

The bf behavior is defined as:

const char bf[] PROGMEM = {
-8, 0, 0, 1,
5, 8, 1,
0, 0, 0, 0, 0, 0, 0, 0, 75, 75, 75, 75, -55, -55, -40, -40, 10, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 30, 30, -20, -20, -55, -55, 60, 60, 0, 4, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 30, 30, 5, 5, 60, 60, 40, 40, 0, 2, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 25, 25, 45, 45, 60, 60, 35, 35, 0, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 60, 60, 45, 45, 60, 60, 30, 30, 0, 0, 1,-10,
0, 0, 0, 0, 0, 0, 0, 0, 60, 60, 110, 110, -55, -55, 100, 100, 0, 3, 0,127,
0, 0, 0, 0, 0, 0, 0, 0, -20, -20, 100, 100, -75, -75, -60, -60, 0, 3, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 45, 45, 127, 127, 0, 0, -70, -70, 0, 3, 0, 0,
};

If I understand correctly, the fifth frame is triggered by a pitch angle of -10 degrees. The sixth frame seems to have the trigger axis set to zero (i.e. no trigger axis) but there is an angle value. It seems that the 127 will never be read because the axis is tested first and you can't trigger on yaw:

OpenCat/OpenCat.ino

Lines 740 to 742 in f1013ce

if (motion.dutyAngles[18 + c * frameSize]) {
int triggerAxis = motion.dutyAngles[18 + c * frameSize];
int triggerAngle = motion.dutyAngles[19 + c * frameSize];

Is this meant to be ignored, or an error, or do I misinterpret the format?

@borntoleave
Copy link
Collaborator

borntoleave commented Dec 26, 2021 via email

@durka
Copy link
Author

durka commented Dec 26, 2021

OK, so indeed that 127 doesn't do anything but doesn't hurt anything by being there. Thanks for confirming!

@durka durka closed this as completed Dec 26, 2021
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

No branches or pull requests

2 participants