Coroutines make robot code easy
bvisness.me
Coroutines make robot code easy
1–10 of 127 posts
Re: Coroutines make robot code easy
#2Re: Coroutines make robot code easy
#3Java's not the easiest to pick up in high school unless you really make a big after-school effort. Something like Lua is probably better.
Re: Coroutines make robot code easy
#4If you want to make it easy for high schoolers, just don't use java in the first place...
Re: Coroutines make robot code easy
#5If you want to make it easy for high schoolers, just don't use java in the first place...
(We've now switched to Lua, integrated with the official C++, but it's a lot more work behind the scenes.)
Re: Coroutines make robot code easy
#6Funnily enough I have used the command pattern before to automate sequences of steps in a workflow. Back then I kind of stumbled on it - it is super effective for certain kinds of things.
Re: Coroutines make robot code easy
#7Thankfully a piece that emphasizes that coroutines are functions that pause. Java frameworks like Quasar became focused on other goals besides that basic capability and lost their way (IMHO). Java's not the easiest to pick up in high school unless you really make a big after-school effort. Something like Lua is probably better.
Re: Coroutines make robot code easy
#8 IEnumerable MyRobotBrain()
{
while(drivetrain.getDistanceInches() > -48)
{
yield drivetrain.arcadeDrive(0.5, 0);
}
yield shooter.shoot();
}Re: Coroutines make robot code easy
#9Re: Coroutines make robot code easy
#10yes, new Java(new Java(1), new ...) is bad, and asynchronous programming paradigms are usually fitting for robotics, but abstractions are good.