Go to Post Dang! The 2008 game piece was supposed to be a secret. - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 25-03-2012, 14:52
enrique's Avatar
enrique enrique is offline
Registered User
FRC #1251 (Tech Tigers)
Team Role: Electrical
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Florida
Posts: 87
enrique will become famous soon enough
Send a message via Yahoo to enrique
Gyro code causes a crash

The code below causes the crio FRC program to crash. Anyone know why:

CONFIGURATION:
One KOP gyro hooked up to port 6 of the analog break out. The module is on slot 1. I tried passing the slot number 1 in, but it made no difference.

CODE:
class RobotDemo : public SimpleRobot
{
Gyro TheGyro;

public:
RobotDemo(void):
TheGyro(6)
{

float TheAngle = TheGyro.GetAngle();
printf("The Angle is %f \n", TheAngle);
}


CONSOLE OUTPUT:
>>>>ERROR: A parameter is out of range.: moduleNumber and/or channel (must be accumulator channel) ...in InitGyro() in C:/WindRiver/workspace/WPILib/Gyro.cpp at line 32
dDistance is 21.347803

program
Exception current instruction address: 0x00000000
Machine Status Register: 0x0008b012
Condition Register: 0x28000484
Task: 0x11e49e8 "FRC_RobotTask"
0x11e49e8 (FRC_RobotTask): task 0x11e49e8 has had a failure and has been stopped.
0x11e49e8 (FRC_RobotTask): fatal kernel task-level exception!
Reply With Quote
  #2   Spotlight this post!  
Unread 25-03-2012, 14:58
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 987
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Gyro code causes a crash

The gyro can only be used with the channels that have an accumulator assigned to them in FPGA. I believe this is currently channels 1 and 2 on slot 1 (I know Slot 1 channel 1, I believe the other is on slot 1 channel 2)
Reply With Quote
  #3   Spotlight this post!  
Unread 25-03-2012, 15:09
enrique's Avatar
enrique enrique is offline
Registered User
FRC #1251 (Tech Tigers)
Team Role: Electrical
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Florida
Posts: 87
enrique will become famous soon enough
Send a message via Yahoo to enrique
Re: Gyro code causes a crash

awesome! that did it, thanks.

However, I got back 1784.183105

What is that suppose to be?
Reply With Quote
  #4   Spotlight this post!  
Unread 25-03-2012, 15:14
enrique's Avatar
enrique enrique is offline
Registered User
FRC #1251 (Tech Tigers)
Team Role: Electrical
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Florida
Posts: 87
enrique will become famous soon enough
Send a message via Yahoo to enrique
Re: Gyro code causes a crash

It's working ok, not sure why I got that big value at first.
Reply With Quote
  #5   Spotlight this post!  
Unread 17-08-2012, 03:08
nightpool's Avatar
nightpool nightpool is offline
robotRectifier
AKA: Evan
no team (formerly of CORE 2062)
Team Role: Alumni
 
Join Date: Oct 2011
Rookie Year: 2011
Location: Waukesha, WI
Posts: 81
nightpool is on a distinguished road
Re: Gyro code causes a crash

Quote:
Originally Posted by enrique View Post
It's working ok, not sure why I got that big value at first.
Probably because you didn't reset the accumulator right away.
__________________
Proud alum of CORE 2062.
www.core2062.com
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 02:33.

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