Go to Post We are reluctant to deprive you of the experience of learning how to do your own research. - Alan Anderson [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
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 05-02-2017, 11:15
trycatch's Avatar
trycatch trycatch is offline
Registered User
FRC #5858
 
Join Date: Nov 2015
Rookie Year: 2015
Location: AL
Posts: 44
trycatch is on a distinguished road
Switch between RobotMaps based on RoboRio somehow?

I'm trying to come up with a clever way to switch between RobotMaps based on what RoboRIO your code is initialized on, so you can have a test board with different motor controllers, things on different ports, etc., and a real robot with a different configuration, and the RobotMap set up / initialize different stuff based on it, and flag a constant telling you which board you're on that you can use elsewhere in your code.

The issue is knowing which board you're on - I can't really track down a good way of determining what roboRIO you're on. The roboRIO runs Linux, so in theory I could SSH into it and find some unique something (the MAC address, a serial number in the CPU, etc.) and use some kind of OS call from Java to get it, our touch a file that includes a "name" on each, and branch off that, but I was curious if anyone has ever done this before / found a simpler way?
Reply With Quote
  #2   Spotlight this post!  
Unread 05-02-2017, 11:17
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,107
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: Switch between RobotMaps based on RoboRio somehow?

Quote:
Originally Posted by trycatch View Post
I'm trying to come up with a clever way to switch between RobotMaps based on what RoboRIO your code is initialized on, so you can have a test board with different motor controllers, things on different ports, etc., and a real robot with a different configuration, and the RobotMap set up / initialize different stuff based on it, and flag a constant telling you which board you're on that you can use elsewhere in your code.

The issue is knowing which board you're on - I can't really track down a good way of determining what roboRIO you're on. The roboRIO runs Linux, so in theory I could SSH into it and find some unique something (the MAC address, a serial number in the CPU, etc.) and use some kind of OS call from Java to get it, our touch a file that includes a "name" on each, and branch off that, but I was curious if anyone has ever done this before / found a simpler way?
There are lots of way's You definitely could touch a file one one of the rios, and check if it exists a bootup. There should be some Java instructions on how to do this. Another way is if you have an extra DIO, jump the spare dio to ground on one of the boards. Then at bootup if you detect that DIO is low, load the 2nd map.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
Reply With Quote
  #3   Spotlight this post!  
Unread 05-02-2017, 13:43
trycatch's Avatar
trycatch trycatch is offline
Registered User
FRC #5858
 
Join Date: Nov 2015
Rookie Year: 2015
Location: AL
Posts: 44
trycatch is on a distinguished road
Re: Switch between RobotMaps based on RoboRio somehow?

Ahhhh, the boot up DIO trick is BRILLIANT!
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 19:29.

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