Simplified FTC Odometry. Part 4: Robot Class

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ม.ค. 2025

ความคิดเห็น •

  • @remusserediuc9896
    @remusserediuc9896 2 หลายเดือนก่อน +2

    Mr Phil you are the goat! I started this year and seeing how difficult odometry is really intimidated me, but your approach is perfect, easy to understand, and tweakable! Not that it doesn't come with its own challenges, but it definitely feels doable now, unlike before where I was considering skipping it entirely. You definitely deserve more recognition!

  • @theashbot4097
    @theashbot4097 23 วันที่ผ่านมา

    I watched a few videos to understand how PID controllers work, but seeing real code really helped me. Thank you soo much!

  • @lindnergt
    @lindnergt 3 หลายเดือนก่อน

    Mr. Phil, Thanks for posting these videos! I have been trying to run it on my robot. No what the power setting for the drive motors, they go full speed, even when the telemetry says they are at 0.2. Any ideas? Gary Lindner

    • @mwhall4127
      @mwhall4127 2 วันที่ผ่านมา

      We just started working through this and had the same problem randomly it turns out motor polarity matters for this. Any motors plugged in reverse would just move at full speed no matter what

  • @MeeraR-f4b
    @MeeraR-f4b 10 หลายเดือนก่อน

    Thanks for the video it was really informational! In the beginning, you mentioned the values for the gains, tolerances, acceleration, etc. had to be tuned to our robot. How do we tune these values specifically to our robot? Do I have to run any specific tuning opmodes for this, if so where can I find these opmodes?

    • @GEARSinc
      @GEARSinc  10 หลายเดือนก่อน

      The gains etc are all constants in the beginning of the robot class. eg: Start with tuning the heading control. Use the values in the tutorial. Then rin the dample uto. Look at how well the robot goes to a new heading. If it shakes back and forth, reduce the gain. If it it too slow, or does not reach the heading, reduce the gains. This would be the Yaw gain, seen here:
      YAW_GAIN = 0.018; // Strength of Yaw position control

    • @MeeraR-f4b
      @MeeraR-f4b 10 หลายเดือนก่อน

      @@GEARSinc Thank you!

  • @danielcortez9007
    @danielcortez9007 7 หลายเดือนก่อน

    How did you calculate the inches per count? I’m wanting to do this using revs drive encoders which have a different wheel size and more ticks per revolution so how would I go about calculating that?

    • @GEARSinc
      @GEARSinc  6 หลายเดือนก่อน

      That's both a simple and complicated question. The simple answer is you can measure it. The complicated answer is you can caluculate it based on your chosen motor, external gear reduction and wheel size. I like to do a first-cut calculation, and then fine tune the result with an actual measurment. To do a measuremnt you simply eed to display the encoder values while you move the robot a fixed amount. Power up the robot while it's up against a wall. The encoder should start out at zero. Slowly drive (or push) the robot a fixed distance (like 100 inches). then simply divide the distance by the final encoder value. inches/count. To do the more engineering method of calculation, you must relate everything back to the circumfrence of the wheel and the total motor gear reduction. Essentially, when the motor does one rotation (look up the number of counts this is for the motor) decide how many revolutions of the drive wheel this is, and then convert this into distance traveled by multiplying by the wheel. circumfrence...

  • @MeeraR-f4b
    @MeeraR-f4b 10 หลายเดือนก่อน

    One more question, if I wanted to increase the speed of my robot in autonomous would I just increase the STRAFE_MAX_AUTO and DRIVE_MAX_AUTO or do I have to edit other values?

    • @GEARSinc
      @GEARSinc  10 หลายเดือนก่อน

      That's correct. These values are use by the control loops to set the upper limit to the speed (%) that they will request. The max values for these are 1.0. If your robot does not get up to speed fast enough for your liking, you can also slowly increase the DRIVE_ACCEL and STRAFE_ACCEL values. If these get too high, you may start seeing slippage or non-straight driving. I'd do this in small steps, like 0.1 at a time to see what impact it has.

    • @MeeraR-f4b
      @MeeraR-f4b 10 หลายเดือนก่อน

      Thanks!

  • @AndresDelReal-t3o
    @AndresDelReal-t3o ปีที่แล้ว +1

    Followed instructions but getting these along with others....Build started at Wed Dec 13 2023 13:06:56 GMT-0800 (Pacific Standard Time) org/firstinspires/ftc/teamcode/SampleAutonomous.java line 29, column 16: ERROR: constructor Robot in class org.firstinspires.ftc.teamcode.SampleAutonomous.Robot cannot be applied to given types; required: com.qualcomm.robotcore.eventloop.opmode.LinearOpMode found: no arguments reason: actual and formal argument lists differ in length org/firstinspires/ftc/teamcode/SampleAutonomous.java line 155, column 9:

    • @GEARSinc
      @GEARSinc  ปีที่แล้ว

      Hi. Thanks for reaching out. So, those lines (28 and 155) don't exist in the original samples, so you must have added more code, yes? If so, have you tried just building the oringinal samples? Don't forget if you are using OnBotJava, you need to add both the SampleAutonomous.java opmode AND the Robot.java files to the teamcode folder. Robot.java just gets added as a non-opmode because it's a dedicated class.

    • @AndresDelReal-t3o
      @AndresDelReal-t3o ปีที่แล้ว

      If it is ok, can I have your email?@@GEARSinc

    • @AndresDelReal-t3o
      @AndresDelReal-t3o ปีที่แล้ว

      We load the Robot.java and compile with no errors. We add the SampleAutonomous.java and get those errors among others. @@GEARSinc

    • @AndresDelReal-t3o
      @AndresDelReal-t3o ปีที่แล้ว

      Build started at Wed Dec 13 2023 13:06:56 GMT-0800 (Pacific Standard Time) org/firstinspires/ftc/teamcode/SampleAutonomous.java line 29, column 16: ERROR: constructor Robot in class org.firstinspires.ftc.teamcode.SampleAutonomous.Robot cannot be applied to given types; required: com.qualcomm.robotcore.eventloop.opmode.LinearOpMode found: no arguments reason: actual and formal argument lists differ in length org/firstinspires/ftc/teamcode/SampleAutonomous.java line 155, column 9: ERROR: cannot find symbol symbol: class List location: class org.firstinspires.ftc.teamcode.SampleAutonomous.Robot org/firstinspires/ftc/teamcode/SampleAutonomous.java line 199, column 9: ERROR: cannot find symbol symbol: class YawPitchRollAngles location: class org.firstinspires.ftc.teamcode.SampleAutonomous.Robot org/firstinspires/ftc/teamcode/SampleAutonomous.java line 200, column 9: ERROR: cannot find symbol symbol: class AngularVelocity location: class org.firstinspires.ftc.teamcode.SampleAutonomous.Robot org/firstinspires/ftc/teamcode/SampleAutonomous.java line 200, column 71: ERROR: cannot find symbol symbol: variable AngleUnit location: class org.firstinspires.ftc.teamcode.SampleAutonomous.Robot org/firstinspires/ftc/teamcode/SampleAutonomous.java line 202, column 42: ERROR: cannot find symbol symbol: variable AngleUnit location: class org.firstinspires.ftc.teamcode.SampleAutonomous.Robot org/firstinspires/ftc/teamcode/SampleAutonomous.java line 447, column 22: ERROR: cannot find symbol symbol: variable Range location: class org.firstinspires.ftc.teamcode.SampleAutonomous.ProportionalControl Build FAILED! Build finished in 2 seconds