View Single Post
  #8   Spotlight this post!  
Unread 11-01-2015, 22:10
alopex_rex's Avatar
alopex_rex alopex_rex is offline
Rainbow Professionalism Dash
AKA: Scott Morton
FRC #0830 (The RatPack)
Team Role: Alumni
 
Join Date: Dec 2014
Rookie Year: 2012
Location: Ann Arbor, MI
Posts: 92
alopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond reputealopex_rex has a reputation beyond repute
Re: Multiple Autonomous Programs

Just today our team put together a way of selecting autonomous programs through the SmartDashboard. We're not using a command-based framework, so we made it work using pointers to functions. You just make a function for each possible autonomous mode, use a SendableChooser to pick a function, and have the actual AutonPeriodic function just run the chosen function. Anyone who's curious can check it out on github here.

Function pointers are unholy magic though, so stick to Commands if you're not lazy and old-fashioned like us.
__________________
Ratpack programming lead 2013 - 2015

ἔκλαγξαν δ᾽ ἄρ᾽ ὀϊστοὶ ἐπ᾽ ὤμων χωομένοιο / αὐτοῦ κινηθέντος: ὃ δ᾽ ἤϊε νυκτὶ ἐοικώς. (Ancient Greek nerds unite!)