GithubHelp home page GithubHelp logo

Comments (2)

lhmcgann avatar lhmcgann commented on June 29, 2024

When I first created the robot project, I created a Command-Based project, which creates the Robot class and automatically inherits from a Robot type. At the time, I had not yet updated my FRC plugins so the auto-inherit was IterativeRobot. To test, I just now created a new blank Command-Based robot project (my FRC plugins are updated to 2018) and the auto-inherit was TimedRobot. So basically that's why our project is currently and IterativeRobot.

From reading (https://wpilib.screenstepslive.com/s/currentCS/m/cpp/l/241853-choosing-a-base-class), there is no difference to the structure that we see in Robot, so we could just change the class signature to "extends TimedRobot". From the same website, they recommend making this change due to slight differences in the way each type updates it periodic methods.

From my understanding, IterativeRobot updates its periodic methods "each time new data arrives from the Driver Station", meaning its updated at irregular time intervals (whenever the data changes + variance "depending on CPU load on the roboRIO, the driver station laptop, or network traffic"). On the other hand, TimedRobot updates its periodic methods "at a predictable time interval", the default setting being 20ms. If the data has not changed in this time period, it updates its methods with the most recent previous data.

Now, after that long-winded response, conclusion: I don't see much harm in switching to TimedRobot: no structure change, recommended to be better (and seems so - more reliable/consistent), would take approximately 10s to change.

from robotcode2018.

brettle avatar brettle commented on June 29, 2024

Why IterativeRobot instead of the new TimedRobot base class?

from robotcode2018.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.