[prosv5]Can you publish a copy of the source code of the gyro class?

  1. 3 weeks ago

    3038922

    Dec 22 china ares
    Edited 3 weeks ago by 3038922

    I want to rewrite a GYRO class. But I have no idea. Can you open the source code of a GYRO class with PROS?
    This is my GYRO library that mimics PROS COTEX, but it's wrong because I didn't write initialization calculations.
    1.jpg

  2. jpearman

    Dec 22 Moderator, ROBOTC Tech Support, V5 Beta Moderator Los Angeles 8888

    It's a bit more difficult to do this with the V5, the gyro integration is done in the firmware, specifically in the firmware for the micro controller that supervises the legacy ports. So PROS gets the value of the gyro from vexos and passes it through, not much more. You could set the legacy port as an analog input and attempt integration yourself, but you will only get a new sample at best every 10mS, that's probably not fast enough.

  3. 3038922

    Dec 23 china ares

    @jpearman It's a bit more difficult to do this with the V5, the gyro integration is done in the firmware, specifically in the firmware for the micro controller that supervises the legacy ports. So PROS gets the value of the gyro from vexos and passes it through, not much more. You could set the legacy port as an analog input and attempt integration yourself, but you will only get a new sample at best every 10mS, that's probably not fast enough.

    It's too imprecise to get the GYRO value of OS directly. Can you tell me how to initialize it in the constructor?

  4. edjubuh

    Dec 24 V5 Beta Moderator West Lafayette, IN

    @3038922 It's too imprecise to get the GYRO value of OS directly. Can you tell me how to initialize it in the constructor?

    Can you elaborate? You'll just use the ADIGyro class instead of ADIAnalogIn

  5. 3038922

    Dec 25 china ares
    Edited 3 weeks ago by 3038922

    @edjubuh Can you elaborate? You'll just use the ADIGyro class instead of ADIAnalogIn

    i want to know loopTime of ADI GYRO.
    Then I plan to fuse GYRO and ENCODER's angle values.
    Or I spend more time initializing, recording the gyroscope's drift law in the forbidden state, subtracting the drift law every iteration.
    The current version may have too short initialization time. The self-increasing drift of gyroscope is not fixed after each initialization, which makes the program difficult to write.
    The advantage is that I can prevent the gyroscope from drifting.

    I wrote an odometer.The requirement of accuracy is very high.
    mmexport1545289764540.jpg

  6. 3038922

    Dec 25 china ares

    @edjubuh Can you elaborate? You'll just use the ADIGyro class instead of ADIAnalogIn

    prosv5 gyro value is 0-360
    In my architecture, I recalculated the angle of change for each LOOP.

    If the robot makes a circle, the integral value will change to a maximum of 360.

    How to solve this problem?

    In practice, I input 180 degrees. The robot will keep turning around.
    What if you don't want to use gyro. reset ()?

 

or Sign Up to reply!