FIRST-Tech-Challenge / SkyStone

FTC SDK
https://www.firstinspires.org/robotics/ftc/what-is-first-tech-challenge
274 stars 1.04k forks source link

Clarification on the Gamepad class #275

Open novabansal opened 3 years ago

novabansal commented 3 years ago

Hi devs, I'm a programmer on Team 7149. Recently, we've been doing a deep dive into the FTC SDK and we were wondering how the Gamepad class updates during loops. We noticed that in EventLoopManager, the gamepad.fromByteArray() method is called instead of one of the update() functions. How does the fromByteArray method work? How did you determine what hex values to use?

Thanks, Team 7149

novabansal commented 3 years ago

(Ignore my computer glitching out haha)

Windwoes commented 3 years ago

fromByteArray() is called to fill the object with the serialized gamepad data sent over from the Driver Station. Since the gamepads are not connected to the Robot Controller, it would make sense that update() is not used in the RC side code; most likely it is only used on the DS side. (Shared codebase)

novabansal commented 3 years ago

@FROGbots-4634 Thanks! That's what we thought.