Gyroscope doesn't seem to work with PROS

Hey guys,
I’m having trouble with getting a Gyroscope to work with PROS. For some reason, I’m not able to input any values from the Gyro. Methods like get_value() and reset() don’t seem to work. I tried using the same Gyro with VCS and it worked perfectly, so the problem isn’t with the GYRO. When try to read the values in the V5 cortex, I get values like 65535 (1600%) when I turn the robot clockwise. Also, when I turn the robot counter-clockwise for one full turn, the cortex then reads values from 0-3600, but PROS still can’t read or reset the values in the Gyro. I need help ASAP!!!

How are you initializing the gyro?

1 Like
#include "main.h"
#include "Motors.hpp"

Controller master (E_CONTROLLER_MASTER);
Motor RightFront (9, E_MOTOR_GEARSET_18, true, E_MOTOR_ENCODER_DEGREES);
Motor RightBack (10, E_MOTOR_GEARSET_18, true, E_MOTOR_ENCODER_DEGREES);
Motor LeftFront (11, E_MOTOR_GEARSET_18, false, E_MOTOR_ENCODER_DEGREES);
Motor LeftBack (12, E_MOTOR_GEARSET_18, false, E_MOTOR_ENCODER_DEGREES);
Motor FlyWheel1 (16, E_MOTOR_GEARSET_18, true, E_MOTOR_ENCODER_ROTATIONS);
Motor FlyWheel2 (17, E_MOTOR_GEARSET_18, false, E_MOTOR_ENCODER_ROTATIONS);
Motor Intake (5, E_MOTOR_GEARSET_18, false, E_MOTOR_ENCODER_DEGREES);
Motor Arm (4, E_MOTOR_GEARSET_18, false, E_MOTOR_ENCODER_DEGREES);
pros::ADIGyro Gyro('B', 1); <<<-------

void setup_bot()
{
  Gyro.reset();
  FlyWheel1.set_brake_mode(E_MOTOR_BRAKE_COAST);
  FlyWheel2.set_brake_mode(E_MOTOR_BRAKE_COAST);
  //Arm.tare_position();
  FlyWheel1.move_velocity(0);
  FlyWheel2.move_velocity(0);
}

Like the above. I also tried using the methods .get() and .getRemapping() with the okapi library, it still doesn’t work.

For future reference, this is how you should post code on this forum:
Tutorial

UPDATE: I decided to output the value of the Gyro on my v5 controller on opcontrol.cpp. It’s under a while true loop so the value of the Gyro is constantly updated and showed on the controller. It only displays zero.
Tried the same thing with VCS, the values actually change when you turn the robot.

open you terminal
input :
prosv5 c p
prosv5 c f kernel@3.1.5
prosv5 c a --force-apply kernel@3.1.5
update you kernel.

Just tried it. No luck! Same Problem!

Were you ever able to resolve this? I have kernel 3.1.6 and am seeing the same thing. If I turn counter-clockwise the value counts down from 65535. However, if I cycle it one full turn counter-clockwise past 3600, it will then function normally.

Well first of all, try upgrading your kernel.
Secondly, I don’t think anyone knows why this is happening for you, as generally people seem to have no problems with gyro.
Show us your code, and make sure this is related to PROS and not some hardware issue by testing with another software.