Nothing in the KOP can prepare me for you.
Home
Go Back   Chief Delphi > Technical > Programming
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 12-02-2017, 17:45
one4robots one4robots is offline
Registered User
AKA: Vince Wagner
FRC #2530 (Inconceivable)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Rochester, MN
Posts: 60
one4robots is on a distinguished road
NavX causing robot code to reboot

Hopefully CD can help!

The NavX we used successfully last year is causing our robot code to continually restart. If the NavX code is commented out, the code runs perfectly. We have just updated the NavX firmware. Any ideas what is causing this?

Thanks!
__________________


It's Inconceivable!
2016 Wisconsin Regional Alliance Captain and Team Spirit Award
2015 Wisconsin Regional Winner - Thanks 2826 and 2062!
2014 Wisconsin Regional Semi-finalist and Alliance Captain - Thanks 167 and 4296!
2014 MSHSL Finalist and Alliance Captain - Thanks 3018 and 4607!
2013 Northern Lights Gracious Professionalism Award
2012 MRI Champions - Thanks, 3883 and 3630!
2012 MSHSL State Tournament Semi-finalist
2012 10,000 Lakes Regional Finalist
2012 10,000 Lakes Regional Delphi Engineering Excellence Award
2012 Lake Superior Regional GM Industrial Design Award
2011 Minnesota Robotics Invitational (MRI) Champions - Thanks, 2052 and 2450!
2011 Inaugural Lake Superior Regional Finalist
2011 Lake Superior Regional Judges Award
Reply With Quote
  #2   Spotlight this post!  
Unread 12-02-2017, 19:11
slibert slibert is online now
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 374
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
Re: NavX causing robot code to reboot

Quote:
Originally Posted by one4robots View Post
Hopefully CD can help!

The NavX we used successfully last year is causing our robot code to continually restart. If the NavX code is commented out, the code runs perfectly. We have just updated the NavX firmware. Any ideas what is causing this?

Thanks!
That's the first I've heard of this symptom; I would suggest that providing more details about your configuration (language, which communication interface you're using), what else is going on in the robot application when the restarts occur, and any other things that might seem related could be helpful.
Reply With Quote
  #3   Spotlight this post!  
Unread 12-02-2017, 19:14
Poseidon5817's Avatar
Poseidon5817 Poseidon5817 is online now
Founder and CEO, DeadMemes Studios
AKA: Mitchel Stokes
FRC #5817 (Uni-Rex)
Team Role: Mentor
 
Join Date: Aug 2013
Rookie Year: 2014
Location: Clovis, CA
Posts: 426
Poseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud of
Re: NavX causing robot code to reboot

We've had issues with a NullPointerException getting thrown for the NavX not being detected when the robot code loads. Restarting the code or roborio usually fixes it.
__________________
My FRC History:

2014 - Team 1671: Central Valley Regional Finalist and Chairman's Award Winner, Sacramento Regional Finalist, Archimedes Quarterfinalist
2015 - Team 1671: Central Valley Regional Semifinalist, Sacramento Regional Semifinalist and Chairman's Award Winner, Newton Winner, Einstein Winner
2016 - Team 5817: Central Valley Regional Finalist and Rookie All-Star, Orange County Regional Quarterfinalist and Rookie All-Star, Newton Division
2017 - Team 5817: Return of the bench grinder


Reply With Quote
  #4   Spotlight this post!  
Unread 12-02-2017, 19:25
slibert slibert is online now
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 374
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
Re: NavX causing robot code to reboot

Quote:
Originally Posted by Poseidon5817 View Post
We've had issues with a NullPointerException getting thrown for the NavX not being detected when the robot code loads. Restarting the code or roborio usually fixes it.
Please post the stack trace for the exception next time you encounter it.

Last edited by slibert : Yesterday at 10:46.
Reply With Quote
  #5   Spotlight this post!  
Unread 12-02-2017, 21:04
Ginger Power's Avatar
Ginger Power Ginger Power is offline
The GreenHorns Team Lead
AKA: Ryan Swanson
FRC #4607 (C.I.S.)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Becker, Minnesota
Posts: 895
Ginger Power has a reputation beyond reputeGinger Power has a reputation beyond reputeGinger Power has a reputation beyond reputeGinger Power has a reputation beyond reputeGinger Power has a reputation beyond reputeGinger Power has a reputation beyond reputeGinger Power has a reputation beyond reputeGinger Power has a reputation beyond reputeGinger Power has a reputation beyond reputeGinger Power has a reputation beyond reputeGinger Power has a reputation beyond repute
Re: NavX causing robot code to reboot

We have had somewhat related problems with our NavX as well. We've been battling a communication issue for a really long time and we just figured it out.

We had the NavX in our C++ code and we didn't have it on our practice bot. Because of this, we could only connect to our Roborio 1 time. After the power was shut off and turned back on we could no longer connect. The only way we could connect was by reimaging the Roborio. After reimaging we could connect 1 more time.

The people on our team who actually know the details behind the problem are contacting NI and FIRST and making them aware of the problem. I believe they will also be posting their findings to CD.
__________________
Bison Robotics President
35 new FRC volunteers from Bison Robotics
The GreenHorns Project Lead:
Reveal Video
White Paper
Reply With Quote
  #6   Spotlight this post!  
Unread 12-02-2017, 22:17
Jonathan L.'s Avatar
Jonathan L. Jonathan L. is offline
Programmer alumnus, mentor, and CSA
FRC #1094 (Channel Cats)
 
Join Date: Jan 2013
Rookie Year: 2011
Location: St. Louis MO
Posts: 89
Jonathan L. is a jewel in the roughJonathan L. is a jewel in the roughJonathan L. is a jewel in the roughJonathan L. is a jewel in the rough
Re: NavX causing robot code to reboot

In 2015 we used the nav6 (predecessor of the navX). It used a serial connection to the roboRIO. We had issues with the roboRIO not working (not connecting or something like that). It seemed like we had to re-install the roboRIO firmware and re-image. Removing the nav6 from the robot fixed the issue. Anyway, we found that unchecking the "Console Out" checkbox in the roboRIO imaging tool allowed us to use the nav6 normally.
Reply With Quote
  #7   Spotlight this post!  
Unread Yesterday, 14:01
torzewsk torzewsk is offline
Registered User
FRC #2530
 
Join Date: Jan 2014
Location: Rochester, MN
Posts: 3
torzewsk is an unknown quantity at this point
Re: NavX causing robot code to reboot

Quote:
Originally Posted by slibert View Post
That's the first I've heard of this symptom; I would suggest that providing more details about your configuration (language, which communication interface you're using), what else is going on in the robot application when the restarts occur, and any other things that might seem related could be helpful.
We are using C++. The navX is plugged directly into the RoboRio and we are calling ahrs= new AHRS(SerialPort::kMXP); commenting this line out allows the code to continue, but of course our AHRS pointer is null. The line is called from Robot::RobotInit. I've tried commenting out almost the entire rest of the program to no effect. Thanks for thinking about this!
Reply With Quote
  #8   Spotlight this post!  
Unread Yesterday, 14:09
tr6scott's Avatar
tr6scott tr6scott is offline
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 547
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: NavX causing robot code to reboot

https://www.chiefdelphi.com/forums/s...d.php?t=154205

We are a labview team, we have also had strange issues with NAVX this year...
__________________
The sooner we get behind schedule, the more time we have to catch up.

Reply With Quote
  #9   Spotlight this post!  
Unread Yesterday, 14:14
torzewsk torzewsk is offline
Registered User
FRC #2530
 
Join Date: Jan 2014
Location: Rochester, MN
Posts: 3
torzewsk is an unknown quantity at this point
Re: NavX causing robot code to reboot

There is more going on. Subsystems were just constructed. I am suspicious that one could be using the navx before it is ready. Are default commands kicked off in parallel threads? I have a feeling this one subsystem is using the pointer too soon. I'll try commenting it out as soon as I get back to our robot.
Reply With Quote
  #10   Spotlight this post!  
Unread Yesterday, 14:24
Oblarg Oblarg is offline
Registered User
AKA: Eli Barnett
FRC #0449 (The Blair Robot Project)
Team Role: Mentor
 
Join Date: Mar 2009
Rookie Year: 2008
Location: Philadelphia, PA
Posts: 1,133
Oblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond repute
Re: NavX causing robot code to reboot

Quote:
Originally Posted by torzewsk View Post
Are default commands kicked off in parallel threads?
Unless C++ is implemented very differently from the Java version, AFAIK all commands (except for PIDCommand, which has an internal PIDController) are run synchronously from the main loop.
__________________
"Mmmmm, chain grease and aluminum shavings..."
"The breakfast of champions!"

Member, FRC Team 449: 2007-2010
Drive Mechanics Lead, FRC Team 449: 2009-2010
Alumnus/Technical Mentor, FRC Team 449: 2010-Present
Lead Technical Mentor, FRC Team 4464: 2012-2015
Technical Mentor, FRC Team 5830: 2015-2016
Reply With Quote
  #11   Spotlight this post!  
Unread Yesterday, 15:22
slibert slibert is online now
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 374
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
Re: NavX causing robot code to reboot

Quote:
Originally Posted by torzewsk View Post
We are using C++. The navX is plugged directly into the RoboRio and we are calling ahrs= new AHRS(SerialPort::kMXP); commenting this line out allows the code to continue, but of course our AHRS pointer is null. The line is called from Robot::RobotInit. I've tried commenting out almost the entire rest of the program to no effect. Thanks for thinking about this!
Thanks, the details help. The code you have shown is attempting to communicate via TTL UART serial port w/the sensor. Is that your intention?

Most teams that use navX-MXP use MXP-bus SPI (SPI:ort::kMXP).

navX-Micro is typically used w/USB. (SerialPort:ort::kUSB).

I'd recommend you review the port specification parameter to the AHRS class constructor. It's possible you're trying to specify a communication path that is invalid for your configuration.
Reply With Quote
  #12   Spotlight this post!  
Unread Yesterday, 15:43
slibert slibert is online now
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 374
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
Re: NavX causing robot code to reboot

Quote:
Originally Posted by tr6scott View Post
https://www.chiefdelphi.com/forums/s...d.php?t=154205

We are a labview team, we have also had strange issues with NAVX this year...
Hmmm, missed that thread. So I'm curious also when your robot application is initializing the MXP IO (if any), and if that might be contributing to some sort of collision. The best hypothesis I can come up with is a race condition when allocating the MXP IO resources that in turn causes the allocation of SPI and other comm resources to fail (except the first time after loading the app after reimaging). Does this seem plausible to you?
Reply With Quote
  #13   Spotlight this post!  
Unread Yesterday, 19:27
TylerHarmon's Avatar
TylerHarmon TylerHarmon is offline
Registered User
no team
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Westminster, CO
Posts: 28
TylerHarmon is an unknown quantity at this point
Re: NavX causing robot code to reboot

If your code is crashing when you try to initialize the NavX, it probably is not properly communicating with the roboRIO. If you try to read from it before it is booted, you will also get a Null Pointer Exception. Just check if the value you want from the NavX != null before you try to do anything with it.

Most likely from what I have read here, you are not properly communicating with the NavX on an electrical side, or it is wired properly but you are trying to communicate with the wrong protocol.
Reply With Quote
  #14   Spotlight this post!  
Unread Yesterday, 20:47
torzewsk torzewsk is offline
Registered User
FRC #2530
 
Join Date: Jan 2014
Location: Rochester, MN
Posts: 3
torzewsk is an unknown quantity at this point
Re: NavX causing robot code to reboot

We found it. PEBKAC
We had an obsolete version of AHRS.h in our include path, and it was not the right size. The adjacent memory allocation and the navx were wiping each other out. Thank you for your help, it got us thinking.

Tim T.
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 15:28.

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