How do you get the Angular Velocity on a Pigeon 2?

What method do we use to obtain the Angular Velocity on a Pigeon 2? I see there’s a getRawGyro method with some parameter for an array to store values in degrees per second, but I’m not sure how to use that method.

I haven’t used this function, but based on the docs, it looks like you should be able to access the gyro rates like this:

// Create a new array and allocate memory for 3 values
double rates[] = new double[3];
// Fill the array using getRawGyro
pigeon.getRawGyro(rates);
// Use the values in the array - units are degrees per second
double x = rates[0];
double y = rates[1];
double z = rates[2];
1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.