Very good video. I hope to see more. Just some questions did you manually create the arcade drive when you could use the differentialDrive class. Also in teleop periodic isint it best practice to instead define the variables once and then update them in perodic?
Hi, thanks for the feedback, this video aims to create a more intuitive code rather the most efficient one. I think it is good to have rookies think about what arcade drive is actually doing and not to just blindly use libraries.
You're not wrong, but they seem to be taking the approach of showing how things work to build understanding, rather than just giving beginning programmers black-box classes to work with. There are other approaches shown here that I would advise differently, but for a beginner video it is fine. Also, you should define variables at the scope they need to be used, usually. For ex, the startTime variable is defined at the class level because it needs to be used by 2 functions.
@@curtisrozeboom6112 While it is typical best practice to define the variable where it is used, it's different when running highly repetitive methods like teleop periodic. When periodic runs repeatedly at high speed, if you define a variable within the method it will create it every time, then have to garbage collect it every time which is expensive. For one variable in one method for a simple example code it's not a big deal, but get a bunch of stuff stored that way and you can end up with performance issues. In things like robot programming or game programing it's common practice to move variables in this type of code to a reusable location.
@@FloatingCoder Yep, you've stated my point a little better. Upon re-reading this, I see I got the point about 'usually' defining variables at scope mixed up in a way that implies it wouldn't be better here to make them class variables.
Why did you stop working on this series after PID? You said you would talk about Pure Pursuit, which seems interesting, and also position tracking goes along with it.
Thank you for the tutorial! I don't have the hardware with me rn and I don't know if you will see this comment but am I right by saying that this can also directly be applied to the TimedRobot template? Also, the method for giving the motor controller the speed on my end is supposed to take in two parameters. For example: motorController.set(ControlMode.PercentOutput, 0.5); Any possibility that you could explain if this is important?
The motor controller you are using has multiple control modes, and by adding PercentOutput, you are telling it to simply apply a percentage instead of using PID, motion magic, etc. If you are interested in learning about them, check out our episode 3 and 4!