View Single Post
  #4   Spotlight this post!  
Unread 13-01-2015, 12:38
jtrv's Avatar
jtrv jtrv is online now
github.com/jhtervay
AKA: Justin
FRC #2791 (Shaker Robotics)
Team Role: College Student
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Latham, NY
Posts: 148
jtrv is a name known to alljtrv is a name known to alljtrv is a name known to alljtrv is a name known to alljtrv is a name known to alljtrv is a name known to all
Re: Hot swapping code

if you really wanted to, you could just make the 2 versions of code you want, say code A and B, separated by packages.

In the robot main class outside of packages A and B, run an init method to detect from the RIO a .txt file with a single character: A or B.

If A, call the Package A main class in teleopPeriodic(), etc.
If B, call the Package B main class.

This would only work with iterative, i don't know if it will work with Command or Simple.

This way you can just change a .txt file on the RIO and you don't have to recompile or rebuild, since both packages will be on the RIO. Dunno about memory usage though.


edit: you could also just do something on smartdashboard. that simplifies the whole txt file thing.
__________________
2791 (2012-2017)

Last edited by jtrv : 13-01-2015 at 12:42.
Reply With Quote