Go to Post As mentors we need to be good role models for students. Because like it or not, we will be role models. - mathking [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 04-21-2014, 02:11 PM
JohnGilb JohnGilb is offline
Programming Mentor, Drive Mentor
FRC #0488
 
Join Date: Mar 2011
Rookie Year: 2003
Location: Redmond, WA
Posts: 114
JohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura about
Quick Reboot - is it possible?

As part of another thread, I had a thought - is there a way to very quickly restart the main robot process?

Right now, you can
  • Hard reset the robot (turn the main breaker off, then on). This often takes over a minute before everything is back.
  • Soft reset the robot (from the driver station, reboot the cRIO). 30-70 seconds until robot is fully operational.

But is there a way to just remotely kill the robot program and restart it? I would hope that would be much faster than either option above.
Reply With Quote
  #2   Spotlight this post!  
Unread 04-21-2014, 07:26 PM
vgdude999 vgdude999 is offline
Programmer/Driver
FRC #1751 (Comsewogue Warriors)
Team Role: Programmer
 
Join Date: Aug 2013
Rookie Year: 2012
Location: Port Jefferson Station, NY
Posts: 25
vgdude999 is an unknown quantity at this point
Fastest way I know of is resetting the crio with either the driver station or the reset button like you said, but it usually takes about 20 seconds, not 30-70.
__________________
2013: Rookie year, programmer-in-training; SBPLI Regional Finalists
2014: Co-Captain, Programmer, Driver; Seeded 15th
2015: Co-Captain, Programmer, Driver
Reply With Quote
  #3   Spotlight this post!  
Unread 04-22-2014, 02:58 AM
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: Quick Reboot - is it possible?

I think you're looking for a way to "reset" your program without rebooting the crio. As far as I know, this isn't something built in. You could do this in software in a few different ways though.
__________________
All opinions are my own.
Reply With Quote
  #4   Spotlight this post!  
Unread 04-22-2014, 11:30 AM
JesseK's Avatar
JesseK JesseK is offline
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,608
JesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond repute
Re: Quick Reboot - is it possible?

To give you an idea - I have yet to professionally work on a project with less than 500k lines of code.

"Quick" reboot is a myth in complex integrated applications, even in the OSGI framework. There is always something that forces a full application reboot.
__________________

Drive Coach, 1885 (2007-present)
CAD Library Updated 5/1/16 - 2016 Curie/Carver Industrial Design Winner
GitHub
Reply With Quote
  #5   Spotlight this post!  
Unread 04-22-2014, 04:23 PM
JohnGilb JohnGilb is offline
Programming Mentor, Drive Mentor
FRC #0488
 
Join Date: Mar 2011
Rookie Year: 2003
Location: Redmond, WA
Posts: 114
JohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura about
Re: Quick Reboot - is it possible?

joelg236, could you elaborate?

JesseK, I think I don't understand what you're saying. I would like to restart the process (or process analogue on the cRIO, whatever that is) without rebooting the entire OS. When you say "application," what are you referring to?
Reply With Quote
  #6   Spotlight this post!  
Unread 04-22-2014, 08:02 PM
Aaron.Graeve Aaron.Graeve is offline
Registered User
FRC #1477 (Texas Torque)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: College Station, Texas
Posts: 103
Aaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to all
Re: Quick Reboot - is it possible?

For 99.9% of FRC teams, a quick re-loading of the code is not possible. This is due to the user code running in kernal space in VxWorks (the operating system for the cRIO). For thise not familliar with the term, the kernal is the core section of the operating system that mediates between software applications and hardware/drivers. Whenever the user code changes and needs to be restarted, the whole kernal needs to be removed from memory and reloaded. That takes time. It is the equivalent of rebooting your computer everytime you want to start Steam. This is not the best way, and is probably not the the smartest way, but it is the only way as of now. Rumor from the roboRIO alpha testers says the reboot time is very low now. Chatting with Greg McKaskle from NI a few months ago, he mentioned there was some thought of moving the user code from kernal space to user space (reloading only the robot code instead of the whole kernal everytime a code change ocurrs). My guess is that change is what is decreasing the reload time.

For the .1% the reboot is not nesessary. I trust some team(s) have figured out how to have a script file on the cRIO that contains the logic thand IO configuration they want to run in the robot. It would get a bit wierd with the FPGA and encoder inputs, but it would be possible. For these teams, changing code would be as easy as changing the file, FTP transfering it over to the cRIO, and sending a command to the cRIO to read the file and use the logic contained within.

This is just what I know. If any of the software giants of CD wish to elaborate on, correct, or discuss this post, feel free.

I did not expect the post to grow this large. My apologies about that.
__________________

2016:
Alamo, Bayou, and Lone Star Regional FTAA
2015:
Dallas, Alamo, Bayou, and Lone Star Regional FTAA
2014:
Alamo, Dallas, and Lone Star Regional FTAA
Alamo Regional Robot Inspector
2013:
Einstein Champion and 2013 World Champion (Thanks 1241 & 610), Galileo Division Champion, Razorback Regional Winner, Alamo Regional Semifinalist, Bayou Regional Semifinalist, Lone Star Regional Quarterfinialist
2012:
Curie Division Semifinalist, Lone Star Regional Finalist, Bayou Regional Winner, Alamo Regional Winner
Reply With Quote
  #7   Spotlight this post!  
Unread 04-22-2014, 08:19 PM
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,069
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Quick Reboot - is it possible?

While it would be nice during debugging and integration to be able to just FTP a new executable and say "GO!", the seconds that this would save us don't justify the effort of making it so.

Many teams already use scripting tools for things like constants and autonomous modes. This lets you use a workflow of:

1. Edit on laptop.
2. FTP to cRIO.
3. Send reset signal (ex. a button press during Disabled) to re-load file.
4. GO!

This pattern lets you realize most of the benefits of a quick reboot (plus other benefits) without having to dive into system-level code.
Reply With Quote
  #8   Spotlight this post!  
Unread 04-27-2014, 01:06 PM
Fletch1373's Avatar
Fletch1373 Fletch1373 is offline
Registered User
AKA: Fletch
FRC #3181 (Panthers)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2004
Location: Rochester, NY
Posts: 247
Fletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud of
Re: Quick Reboot - is it possible?

Quote:
Originally Posted by Aaron.Graeve View Post
For 99.9% of FRC teams, a quick re-loading of the code is not possible. This is due to the user code running in kernal space in VxWorks (the operating system for the cRIO). For thise not familliar with the term, the kernal is the core section of the operating system that mediates between software applications and hardware/drivers. Whenever the user code changes and needs to be restarted, the whole kernal needs to be removed from memory and reloaded. That takes time. It is the equivalent of rebooting your computer everytime you want to start Steam. This is not the best way, and is probably not the the smartest way, but it is the only way as of now. Rumor from the roboRIO alpha testers says the reboot time is very low now. Chatting with Greg McKaskle from NI a few months ago, he mentioned there was some thought of moving the user code from kernal space to user space (reloading only the robot code instead of the whole kernal everytime a code change ocurrs). My guess is that change is what is decreasing the reload time.

For the .1% the reboot is not nesessary. I trust some team(s) have figured out how to have a script file on the cRIO that contains the logic thand IO configuration they want to run in the robot. It would get a bit wierd with the FPGA and encoder inputs, but it would be possible. For these teams, changing code would be as easy as changing the file, FTP transfering it over to the cRIO, and sending a command to the cRIO to read the file and use the logic contained within.

This is just what I know. If any of the software giants of CD wish to elaborate on, correct, or discuss this post, feel free.

I did not expect the post to grow this large. My apologies about that.
As a CSA at champs, I had plenty of opportunities to play with the roboRIO that NI had set up. One of these tests was a boot time test. With a stopwatch app, we discovered that it still takes approximately 22 secs to boot to a state where the networking process is running, and an additional 3-4 seconds(totalling ~25s) for user code to finish loading. This was done with 2014 cRIO firmware ported to the roboRIO, and as such, isnt a perfect representation of how it will work next year.
__________________
Student:
<04: FRC0213> <05-08: FRC1373>
Mentor:
<09-10: FRC0809> <11-12: FRC3555> <12-14: FRC0073> <15-??: FRC3181>
Volunteer:
<FTAA> <CSA> <Defense Coordinator> <Scorekeeper> <Robot Inspector> <Official Scorer>
2016 Tour:
CTWAT [DefCoord] > Pittsburgh[Mentor/DefCoord] > TVR[FTAA] > FLR[CSA] > NE DCMP[CSA] > CMP[CSA]
Reply With Quote
  #9   Spotlight this post!  
Unread 04-27-2014, 02:11 PM
Aaron.Graeve Aaron.Graeve is offline
Registered User
FRC #1477 (Texas Torque)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: College Station, Texas
Posts: 103
Aaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to all
Re: Quick Reboot - is it possible?

Quote:
Originally Posted by Fletch1373 View Post
As a CSA at champs, I had plenty of opportunities to play with the roboRIO that NI had set up. One of these tests was a boot time test. With a stopwatch app, we discovered that it still takes approximately 22 secs to boot to a state where the networking process is running, and an additional 3-4 seconds(totalling ~25s) for user code to finish loading. This was done with 2014 cRIO firmware ported to the roboRIO, and as such, isnt a perfect representation of how it will work next year.
Was this test run with the roboRIO powering up or was it already on (i.e. hard reboot vs soft reboot)? Did the test you see require a full reboot after loading code? My message was more directed at the time to load and run code after the roboRIO is already running and was based on what I have heard. I wanted to be at Champs this year so I could talk to some of the alpha testing teams in person, but college work prevented me.

Even considering, a ~25 seconds from boot to code running is very nice and better than what we have now. I have hope the roboRIO firmware will reduce this time even further. (Keeping my fingers crossed for user code in user space)
__________________

2016:
Alamo, Bayou, and Lone Star Regional FTAA
2015:
Dallas, Alamo, Bayou, and Lone Star Regional FTAA
2014:
Alamo, Dallas, and Lone Star Regional FTAA
Alamo Regional Robot Inspector
2013:
Einstein Champion and 2013 World Champion (Thanks 1241 & 610), Galileo Division Champion, Razorback Regional Winner, Alamo Regional Semifinalist, Bayou Regional Semifinalist, Lone Star Regional Quarterfinialist
2012:
Curie Division Semifinalist, Lone Star Regional Finalist, Bayou Regional Winner, Alamo Regional Winner
Reply With Quote
  #10   Spotlight this post!  
Unread 04-27-2014, 11:01 PM
vgdude999 vgdude999 is offline
Programmer/Driver
FRC #1751 (Comsewogue Warriors)
Team Role: Programmer
 
Join Date: Aug 2013
Rookie Year: 2012
Location: Port Jefferson Station, NY
Posts: 25
vgdude999 is an unknown quantity at this point
Quote:
Originally Posted by Aaron.Graeve View Post
Was this test run with the roboRIO powering up or was it already on (i.e. hard reboot vs soft reboot)? Did the test you see require a full reboot after loading code? My message was more directed at the time to load and run code after the roboRIO is already running and was based on what I have heard. I wanted to be at Champs this year so I could talk to some of the alpha testing teams in person, but college work prevented me.

Even considering, a ~25 seconds from boot to code running is very nice and better than what we have now. I have hope the roboRIO firmware will reduce this time even further. (Keeping my fingers crossed for user code in user space)
During one match our power wire for our crio(8 slot) became loose. It rebooted several times because the wire kept making and breaking contact. I noticed that it was somewhere around 20-30 seconds reboot time. 25 seconds isn't really an improvement, so I hope that time was strongly influenced by the fact that the test was done using ported firmware.
__________________
2013: Rookie year, programmer-in-training; SBPLI Regional Finalists
2014: Co-Captain, Programmer, Driver; Seeded 15th
2015: Co-Captain, Programmer, Driver
Reply With Quote
  #11   Spotlight this post!  
Unread 04-28-2014, 12:33 AM
Fletch1373's Avatar
Fletch1373 Fletch1373 is offline
Registered User
AKA: Fletch
FRC #3181 (Panthers)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2004
Location: Rochester, NY
Posts: 247
Fletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud of
Re: Quick Reboot - is it possible?

Quote:
Originally Posted by Aaron.Graeve View Post
Was this test run with the roboRIO powering up or was it already on (i.e. hard reboot vs soft reboot)? Did the test you see require a full reboot after loading code? My message was more directed at the time to load and run code after the roboRIO is already running and was based on what I have heard. I wanted to be at Champs this year so I could talk to some of the alpha testing teams in person, but college work prevented me.

Even considering, a ~25 seconds from boot to code running is very nice and better than what we have now. I have hope the roboRIO firmware will reduce this time even further. (Keeping my fingers crossed for user code in user space)
The test was run as a hard reboot with existing code on the robot.
__________________
Student:
<04: FRC0213> <05-08: FRC1373>
Mentor:
<09-10: FRC0809> <11-12: FRC3555> <12-14: FRC0073> <15-??: FRC3181>
Volunteer:
<FTAA> <CSA> <Defense Coordinator> <Scorekeeper> <Robot Inspector> <Official Scorer>
2016 Tour:
CTWAT [DefCoord] > Pittsburgh[Mentor/DefCoord] > TVR[FTAA] > FLR[CSA] > NE DCMP[CSA] > CMP[CSA]
Reply With Quote
  #12   Spotlight this post!  
Unread 04-29-2014, 10:55 PM
tech2077 tech2077 is offline
Registered User
AKA: Matthew Skolaut
FRC #3847 (Spectrum 3847)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Houston
Posts: 21
tech2077 is an unknown quantity at this point
Re: Quick Reboot - is it possible?

Quote:
Originally Posted by Aaron.Graeve View Post
Was this test run with the roboRIO powering up or was it already on (i.e. hard reboot vs soft reboot)? Did the test you see require a full reboot after loading code? My message was more directed at the time to load and run code after the roboRIO is already running and was based on what I have heard. I wanted to be at Champs this year so I could talk to some of the alpha testing teams in person, but college work prevented me.

Even considering, a ~25 seconds from boot to code running is very nice and better than what we have now. I have hope the roboRIO firmware will reduce this time even further. (Keeping my fingers crossed for user code in user space)
From research on the new roboRIO, as it runs a linux distro with real time extensions, in addition to the changes in the programming environments to be fully user level (such as now using Java SE) the robot code will be running as a userlevel application under the linux kernel, now allowing for fast software soft-loading which is as simple as restarting an application.
Reply With Quote
  #13   Spotlight this post!  
Unread 05-07-2014, 09:19 PM
Cel Skeggs Cel Skeggs is offline
Robot Software Manager Alumnus
AKA: Previously known as Colby
FRC #1540 (The Flaming Chickens)
Team Role: Alumni
 
Join Date: Feb 2013
Rookie Year: 2009
Location: Portland, Oregon, USA
Posts: 107
Cel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of lightCel Skeggs is a glorious beacon of light
Re: Quick Reboot - is it possible?

Quote:
Originally Posted by tech2077 View Post
From research on the new roboRIO, as it runs a linux distro with real time extensions, in addition to the changes in the programming environments to be fully user level (such as now using Java SE) the robot code will be running as a userlevel application under the linux kernel, now allowing for fast software soft-loading which is as simple as restarting an application.
I went to one of the booths at the World Championships, and they had a bunch of the roboRIOs there. Brad Miller (the person in charge of WPILib) showed that with the new version, it would take ~5 seconds from pressing download to having the new code running. It's MUCH better than it previously was.
__________________
Software manager alumnus. Developer of the CCRE, a powerful robot code framework based on dataflow and composibility.
Refer to as she/her/hers. Years of FRC: 2012, 2013, 2014, 2015, 2016. FLL for a few years beforehand.
Team 1540: The Flaming Chickens | Portland, Oregon | Twitter | Facebook
Reply With Quote
  #14   Spotlight this post!  
Unread 05-09-2014, 04:44 PM
JohnGilb JohnGilb is offline
Programming Mentor, Drive Mentor
FRC #0488
 
Join Date: Mar 2011
Rookie Year: 2003
Location: Redmond, WA
Posts: 114
JohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura about
Re: Quick Reboot - is it possible?

This has been a really productive and interesting conversation - thanks to everybody for the valuable feedback! I was under the mistaken impression that our code ran in user space - to learn otherwise was valuable.

Looking forward to the 2015 control system!
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 04:49 AM.

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