Go to Post "We've got more money than brains." - Travis Hoffman [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-01-2015, 11:27
nickmcski nickmcski is offline
Registered User
AKA: Nicholas McCurry
FRC #1482 (Grandin Ghosts)
Team Role: Alumni
 
Join Date: Nov 2012
Rookie Year: 2012
Location: Canada
Posts: 111
nickmcski has a spectacular aura aboutnickmcski has a spectacular aura aboutnickmcski has a spectacular aura about
Hot swapping code

Just wondering if anyone knows if the roboRIO supports hot swapping, or is it possible if I add some java parameters to the roboRIO to enable hot swapping. I have used hot swapping on my computer before but I don't know how the roboRIO VM works.
Reply With Quote
  #2   Spotlight this post!  
Unread 08-01-2015, 15:17
fsilberberg fsilberberg is offline
WPILib Developer
AKA: Fred Silberberg
FRC #0190
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Redmond
Posts: 146
fsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura about
Quote:
Originally Posted by nickmcski View Post
Just wondering if anyone knows if the roboRIO supports hot swapping, or is it possible if I add some java parameters to the roboRIO to enable hot swapping. I have used hot swapping on my computer before but I don't know how the roboRIO VM works.
Well, we use the standard Java se embedded JRE. You'll have to figure out how to get whatever environment you're using for hotswapping to connect to a remote JVM. The embedded profile we use is more limited than the full Java se, so you might have to create a custom JRE with more features.
This year, the code redeploy is really fast, like 7 seconds from compile to running. Is this really too slow that you need hotswapping?
Reply With Quote
  #3   Spotlight this post!  
Unread 09-01-2015, 10:28
Pratik Kunapuli's Avatar
Pratik Kunapuli Pratik Kunapuli is offline
Probably browning-out on Astro-Turf
FRC #1648 (G3 Robotics)(EWCP)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Atlanta, GA
Posts: 143
Pratik Kunapuli is a name known to allPratik Kunapuli is a name known to allPratik Kunapuli is a name known to allPratik Kunapuli is a name known to allPratik Kunapuli is a name known to allPratik Kunapuli is a name known to all
Re: Hot swapping code

We found that with 11 second compile times and 7 second reboots, we don't need to hot-swap anything.
__________________
Official Driving Record: 101-59-0
2012-2015 Student 341 Miss Daisy
2015-Current Mentor 1648 G3 Robotics
Reply With Quote
  #4   Spotlight this post!  
Unread 13-01-2015, 12:38
jtrv's Avatar
jtrv jtrv is offline
github.com/jhtervay
AKA: Justin
FRC #2791 (Shaker Robotics)
Team Role: College Student
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Latham, NY
Posts: 147
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
  #5   Spotlight this post!  
Unread 16-01-2015, 00:06
nickmcski nickmcski is offline
Registered User
AKA: Nicholas McCurry
FRC #1482 (Grandin Ghosts)
Team Role: Alumni
 
Join Date: Nov 2012
Rookie Year: 2012
Location: Canada
Posts: 111
nickmcski has a spectacular aura aboutnickmcski has a spectacular aura aboutnickmcski has a spectacular aura about
Re: Hot swapping code

Ah ha, I did some more digging and I found this in the debug launch for the roboRIO
Code:
/usr/local/frc/JRE/bin/java -XX:+UsePerfData -agentlib:jdwp=transport=dt_socket,address=8348,server=y,suspend=y -jar /home/lvuser/FRCUserProgram.jar
So if i'm correct you should be able to hotswap code if you connect to the roborio over port 8348, I haven't tested it yet but I will be sure to post my results when I get into school tomorrow.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 22:37.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi