psiphi75/ahrs

Possible variable wrong?

Closed this issue · 3 comments

rclai commented

These three variables and these three variables have different values. The quarternion variable naming number assignment (q0, q1) that we have is one less number than the original (q1, q2), but those specific three are using completely different quaternion values.

The JavaScript code uses variables q0 ... q3, where as the original C code uses q1 ... q4. But the algorithm should be the same. I don't see the issue here. If you do find the algorithm is different, let me know.

rclai commented

I think you're right. Interestingly, though the code was not ported identically, it still yields the same result.

Thanks. I first started porting the original code, it worked, but then I based it on the code here, although the code was rather messy, so I created my own repo. But the ZiCog repo was good for testing purposes.