Go to Post Aha I just noticed you're from my team. --Petey - Petey [more]
Home
Go Back   Chief Delphi > Technical > Control System
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 01-02-2015, 10:32
thatprogrammer's Avatar
thatprogrammer thatprogrammer is offline
Registered User
AKA: Ahad Bawany
no team (None)
Team Role: Programmer
 
Join Date: Apr 2014
Rookie Year: 2014
Location: Florida
Posts: 609
thatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond repute
RoboRIO red comm light, not accepting code?

Our PDP is giving us an orange light, and our roboRIO is giving us a red comm light. When we deploy code, eclipse reports it as deployed, but the roboRIO does not seem to get the new code. The ni web browser does NOT report a sticky fault.
Technical Details:
RoboRIO is imaged
Can ID's are correct
No fuses appear to be blown
Driver station can connect, but does not report any code
Reply With Quote
  #2   Spotlight this post!  
Unread 01-02-2015, 10:50
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: RoboRIO red comm light, not accepting code?

Is the roboRIO perhaps set to not run the user program on startup?
Reply With Quote
  #3   Spotlight this post!  
Unread 01-02-2015, 13:58
thatprogrammer's Avatar
thatprogrammer thatprogrammer is offline
Registered User
AKA: Ahad Bawany
no team (None)
Team Role: Programmer
 
Join Date: Apr 2014
Rookie Year: 2014
Location: Florida
Posts: 609
thatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond repute
Re: RoboRIO red comm light, not accepting code?

Commenting out the auto code I had added fixed the red comm light. Does anyone mind reading through the code to see what might be causing the error?
Code:
void AutonomousInit()
	{

		//gyro->Reset();
	}

	void AutonomousPeriodic()
	{

/*
	SmartDashboard::PutNumber("Gyro Angle:", Angle);
if (automode == 1)
{
	gyro->GetAngle();
{
	if (Angle == 90)
	{
		robottime = false;
	} else {
		robottime = true;
	}
}
if(robottime == true)
{
	robot->Drive(0,-1);
}
if (robottime == false)
{
	robot->Drive(0,-1);
}
}
if (automode == 2)
{
	gyro->GetAngle();
	if (Angle == 45)
	{
		robottime = false;
	} else {
		robottime = true;
	}
	if (robottime == true)
	{
		robot->Drive(0, -.5);
	}
	if (robottime == false)
	{
		robot->Drive(0,0);
	}
}
*/
}
is using a selector based on joystick button during robotinit causing this?
Reply With Quote
  #4   Spotlight this post!  
Unread 01-02-2015, 13:59
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
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: RoboRIO red comm light, not accepting code?

I'd wager that either robot or gyro is an uninitialized pointer.
Reply With Quote
  #5   Spotlight this post!  
Unread 01-02-2015, 21:51
thatprogrammer's Avatar
thatprogrammer thatprogrammer is offline
Registered User
AKA: Ahad Bawany
no team (None)
Team Role: Programmer
 
Join Date: Apr 2014
Rookie Year: 2014
Location: Florida
Posts: 609
thatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond repute
Re: RoboRIO red comm light, not accepting code?

Quote:
Originally Posted by RufflesRidge View Post
I'd wager that either robot or gyro is an uninitialized pointer.
That doesn't seem to be it. To clarify, eclipse doesn't give us any errors when we deploy or build; the roboRIO gives us a red comm light when we deploy it, and it gets no code. It gets code fine if auto is commented out. Here's a sample with the robotinit part to clarify that:
Code:
#include "WPILib.h"

class Robot: public IterativeRobot
{
private:
	//Initializing livewindow
	LiveWindow *lw;
	//Initializing stick
	Joystick *stick;
	//Initializing the Chassis parts
	Talon *kFrontLeftMotor;
	Talon *kFrontRightMotor;
	RobotDrive *robot;
	Relay *Fan;
	DoubleSolenoid *shifter;
	Encoder *ChassisEnc;
	Encoder *OtherEnc;
	//Initializing the values for Cheesy Drive
	float Rotation;
	float Acceleration;
	float rightMultiplier;
	float leftMultiplier;
    double automode;
    Gyro *gyro;
    bool robottime;
    double Angle;


	void RobotInit()
	{

		SmartDashboard::init();
		lw = LiveWindow::GetInstance();
		stick = new Joystick(0);
		kFrontLeftMotor = new Talon(0);
		kFrontRightMotor = new Talon(1);
		robot = new RobotDrive(kFrontRightMotor, kFrontLeftMotor);
		Fan = new Relay (3);


		/* Setting the shifter as a DoubleSolenoid
		 * Because we're using both pistons off of
		 * one Double Solenoid
		 */
		shifter = new DoubleSolenoid (0,1);

		ChassisEnc = new Encoder (0,1, false, Encoder::EncodingType::k4X);
		OtherEnc= new Encoder (8,9, false, Encoder::EncodingType::k4X);

		//Setting it so the fan is off by default
		Fan->Set(Relay::kOff);


		//Setting the Rotation and Accel values
		Rotation = stick->GetRawAxis(1);
		Acceleration = stick->GetRawAxis(3);

	    /*Setting the multipliers
	     * so that they don't allow
	     * a robot to go full forward
	     * while going full turn
	     */

		rightMultiplier = Rotation + Acceleration;
		leftMultiplier = Rotation - Acceleration;

		//Setting the shifter to Low Gear
		shifter->Set(DoubleSolenoid::kReverse);
		robot->SetInvertedMotor(RobotDrive::kFrontLeftMotor, true);
		robot->SetInvertedMotor(RobotDrive::kFrontRightMotor, true);

		ChassisEnc->SetDistancePerPulse(11.04);
		OtherEnc->SetDistancePerPulse(11.04);

	/*gyro = new Gyro (2);
	Angle = gyro->GetAngle();

	if (stick->GetRawButton(1))

		{
			automode = 1;
		}
		if (stick->GetRawButton(2))
Reply With Quote
  #6   Spotlight this post!  
Unread 01-02-2015, 21:54
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
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: RoboRIO red comm light, not accepting code?

The gyro constructor is commented out in the code you just posted, and your gyro appears to be on a channel that won't work. It needs to be on Channels 0 or 1.
Reply With Quote
  #7   Spotlight this post!  
Unread 01-02-2015, 22:36
thatprogrammer's Avatar
thatprogrammer thatprogrammer is offline
Registered User
AKA: Ahad Bawany
no team (None)
Team Role: Programmer
 
Join Date: Apr 2014
Rookie Year: 2014
Location: Florida
Posts: 609
thatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond repute
Re: RoboRIO red comm light, not accepting code?

Quote:
Originally Posted by RufflesRidge View Post
The gyro constructor is commented out in the code you just posted, and your gyro appears to be on a channel that won't work. It needs to be on Channels 0 or 1.
Yeah, it was commented out after deploying, along with the auto code. Confused about the second sentence, doesn't the gyro have four ports it can plug into? Sorry for slow replies BTW, school WiFi does not let me post on chief Delphi, other than starting threads.
Reply With Quote
  #8   Spotlight this post!  
Unread 01-02-2015, 23:03
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
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: RoboRIO red comm light, not accepting code?

Quote:
Originally Posted by thatprogrammer View Post
Yeah, it was commented out after deploying, along with the auto code. Confused about the second sentence, doesn't the gyro have four ports it can plug into? Sorry for slow replies BTW, school WiFi does not let me post on chief Delphi, other than starting threads.
The Analog Accumulators used for the gyro are only on channels 0 and 1.

See Gyro: http://first.wpi.edu/FRC/roborio/rel...classGyro.html
And AnalogInput kAccumulatorChannels : http://first.wpi.edu/FRC/roborio/rel...alogInput.html

Last edited by RufflesRidge : 01-02-2015 at 23:10.
Reply With Quote
  #9   Spotlight this post!  
Unread 01-02-2015, 23:23
TimTheGreat's Avatar
TimTheGreat TimTheGreat is offline
ArchdukeTim
FRC #1418 (Vae Victis)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Falls Church
Posts: 235
TimTheGreat has a spectacular aura aboutTimTheGreat has a spectacular aura aboutTimTheGreat has a spectacular aura about
Re: RoboRIO red comm light, not accepting code?

Try looking at the logs on the Dashboard. Usually they'll give you an error.
__________________
There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.



2012 - Gracious Professionalism - Greater DC
2014 - Regional Finalist - Virginia | Industrial Design - Virginia | Regional Finalist - Greater DC
2015 - Innovation in Control - Greater DC
2016 - District Event Winner - VAHAY | Innovation in Control - VAHAY | District Event Winner - MDBET | Industrial Design - MDBET | District Champion - CHCMP | Innovation in Control - CHCMP
Reply With Quote
  #10   Spotlight this post!  
Unread 04-02-2015, 21:43
thatprogrammer's Avatar
thatprogrammer thatprogrammer is offline
Registered User
AKA: Ahad Bawany
no team (None)
Team Role: Programmer
 
Join Date: Apr 2014
Rookie Year: 2014
Location: Florida
Posts: 609
thatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond repute
Re: RoboRIO red comm light, not accepting code?

Changing gyro port to 1 fixed it! Thanks. The only thing I can't figure out is how to have multiple auto modes without using the selectable chooser. It seems that only works with command based robot?
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 20:05.

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