Go to Post Every robot needs a locky-thingy. A robot without one might fire when it isn't supposed to, and hit the wrong target; e.g., a referee, FTA, or robot inspector. - Richard Wallace [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-02-2011, 12:59
Nicholas Norman's Avatar
Nicholas Norman Nicholas Norman is offline
Registered User
AKA: MrBnC
FRC #0070 (More Martians)
Team Role: Driver
 
Join Date: Mar 2010
Rookie Year: 2008
Location: Goodrich
Posts: 7
Nicholas Norman is an unknown quantity at this point
Problem with Jaguar Inputs

Okay, so I'm absolutely stumped on this, the code compiles, deploys and the robot can read it but when I try and give it an input with the joystick the robot remains immobile. I've set the Jaguars to use "Set" and the float is the Joystick Y-axis. Here is what I have:

void initMotors()
{
jMotor[1] = new Jaguar(4,1); // front right
jMotor[2] = new Jaguar(4,2); // front left
jMotor[3] = new Jaguar(4,3); // back right
jMotor[4] = new Jaguar(4,4); // back left
}

This is in void TeleopPeriodic:
jMotor[1]->Set(m_XboxRightStickY);
jMotor[3]->Set(m_XboxRightStickY);
jMotor[2]->Set(m_XboxLeftStickY);
jMotor[4]->Set(m_XboxLeftStickY);

They Joystick axis floats are set up correctly. So why does this not function properly? Also, this is my first post on Chief Delphi so if I left something out I apologize.

Last edited by Nicholas Norman : 11-02-2011 at 13:03.
  #2   Spotlight this post!  
Unread 11-02-2011, 13:05
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: Problem with Jaguar Inputs

Could we please see your full source code? It's really hard to debug with just a small snippet.

EDIT: I would recommend displaying the joystick values in NetConsole or on the DriverStation to make sure your joystick is functioning properly.
  #3   Spotlight this post!  
Unread 11-02-2011, 13:08
Nicholas Norman's Avatar
Nicholas Norman Nicholas Norman is offline
Registered User
AKA: MrBnC
FRC #0070 (More Martians)
Team Role: Driver
 
Join Date: Mar 2010
Rookie Year: 2008
Location: Goodrich
Posts: 7
Nicholas Norman is an unknown quantity at this point
Re: Problem with Jaguar Inputs

Okay, here it is.

BuiltinDefaultCode.cpp
  #4   Spotlight this post!  
Unread 11-02-2011, 13:10
Zuelu562's Avatar
Zuelu562 Zuelu562 is offline
Ready for WPI District!
AKA: Jake Janssens
FRC #3623 (Terror Bots)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Massachusetts
Posts: 340
Zuelu562 is a splendid one to beholdZuelu562 is a splendid one to beholdZuelu562 is a splendid one to beholdZuelu562 is a splendid one to beholdZuelu562 is a splendid one to beholdZuelu562 is a splendid one to beholdZuelu562 is a splendid one to beholdZuelu562 is a splendid one to behold
Re: Problem with Jaguar Inputs

Just going to make sure, it's made me feel like an idiot more than once today;

did you reset your robot after you deployed the code? Also, try undeploying then redeploying.
__________________
Team Resume
562 "S.P.A.R.K." - Student Programmer 2008-2011, Field Coach 2011
3623 "Terror Bots" - Technical Mentor, Field Coach 2012 - Present

Volunteer Resume:
BattleCry@WPI 12, 13, 15, 16 - Queuing
BattleCry@WPI 14 - Field Reset
Granite State District Event 2014 - Team Queueing
NEFIRST District Championships '14,'15,'16 - Team Queuing
  #5   Spotlight this post!  
Unread 11-02-2011, 13:11
Nicholas Norman's Avatar
Nicholas Norman Nicholas Norman is offline
Registered User
AKA: MrBnC
FRC #0070 (More Martians)
Team Role: Driver
 
Join Date: Mar 2010
Rookie Year: 2008
Location: Goodrich
Posts: 7
Nicholas Norman is an unknown quantity at this point
Re: Problem with Jaguar Inputs

I have multiple times yet every time i get the same result.
  #6   Spotlight this post!  
Unread 11-02-2011, 13:14
Zuelu562's Avatar
Zuelu562 Zuelu562 is offline
Ready for WPI District!
AKA: Jake Janssens
FRC #3623 (Terror Bots)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Massachusetts
Posts: 340
Zuelu562 is a splendid one to beholdZuelu562 is a splendid one to beholdZuelu562 is a splendid one to beholdZuelu562 is a splendid one to beholdZuelu562 is a splendid one to beholdZuelu562 is a splendid one to beholdZuelu562 is a splendid one to beholdZuelu562 is a splendid one to behold
Re: Problem with Jaguar Inputs

Quote:
Originally Posted by Nicholas Norman View Post
I have multiple times yet every time i get the same result.
I really have no idea then, I haven't dealt with Xbox control.
__________________
Team Resume
562 "S.P.A.R.K." - Student Programmer 2008-2011, Field Coach 2011
3623 "Terror Bots" - Technical Mentor, Field Coach 2012 - Present

Volunteer Resume:
BattleCry@WPI 12, 13, 15, 16 - Queuing
BattleCry@WPI 14 - Field Reset
Granite State District Event 2014 - Team Queueing
NEFIRST District Championships '14,'15,'16 - Team Queuing
  #7   Spotlight this post!  
Unread 11-02-2011, 15:25
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,113
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: Problem with Jaguar Inputs

What do the Jaguar's LEDs do while you're moving the joysticks?

Did you remember to ENABLE the robot from the Driver Station?
  #8   Spotlight this post!  
Unread 11-02-2011, 15:36
Nicholas Norman's Avatar
Nicholas Norman Nicholas Norman is offline
Registered User
AKA: MrBnC
FRC #0070 (More Martians)
Team Role: Driver
 
Join Date: Mar 2010
Rookie Year: 2008
Location: Goodrich
Posts: 7
Nicholas Norman is an unknown quantity at this point
Re: Problem with Jaguar Inputs

The Jaguar's are blinking yellow as they normally do and yes I did enable the robot.
  #9   Spotlight this post!  
Unread 11-02-2011, 16:35
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,113
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: Problem with Jaguar Inputs

Blinking yellow means they're not receiving any commands. You're using PWM control from the Digital Sidecar, right? Make sure your cables are correctly connected to the pins they're supposed to be connected to. The Jaguar PWM connection is obvious, but check to see that you don't have it plugged in backwards. The Sidecar PWM connections are similarly obvious -- they're the widely-spaced triplets of pins with white friction-fit plastic retainers on each set -- but again verify that the connectors are not backwards.

And look at the three power LEDs on the Digital Sidecar. If any of them isn't brightly lit, you need to fix your power wiring.

What is the big orange Robot Signal Light doing while you try to make your Jaguars respond? It should be on with a very brief flicker off about every second and a half.
  #10   Spotlight this post!  
Unread 11-02-2011, 16:55
Nicholas Norman's Avatar
Nicholas Norman Nicholas Norman is offline
Registered User
AKA: MrBnC
FRC #0070 (More Martians)
Team Role: Driver
 
Join Date: Mar 2010
Rookie Year: 2008
Location: Goodrich
Posts: 7
Nicholas Norman is an unknown quantity at this point
Re: Problem with Jaguar Inputs

The three LEDs on the Digital Sidecar are brightly lit, and the robot signal light has a short flicker about every two seconds. I don't believe it's a wiring issue. It might be worth mentioning that I'm working on last year's robot until this years is ready to test.
  #11   Spotlight this post!  
Unread 11-02-2011, 17:02
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,113
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: Problem with Jaguar Inputs

Quote:
Originally Posted by Nicholas Norman View Post
It might be worth mentioning that I'm working on last year's robot until this years is ready to test.
I hope you updated the cRIO image before you tried using this year's code.
  #12   Spotlight this post!  
Unread 11-02-2011, 17:09
Nicholas Norman's Avatar
Nicholas Norman Nicholas Norman is offline
Registered User
AKA: MrBnC
FRC #0070 (More Martians)
Team Role: Driver
 
Join Date: Mar 2010
Rookie Year: 2008
Location: Goodrich
Posts: 7
Nicholas Norman is an unknown quantity at this point
Re: Problem with Jaguar Inputs

yes we did. I made sure of that.
  #13   Spotlight this post!  
Unread 11-02-2011, 22:23
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,113
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: Problem with Jaguar Inputs

If the big orange RSL is on with short winks off, that by itself is a pretty good indication that the Digital Sidecar is properly powered and the robot is enabled. The blinking yellow LED is the primary clue here. It's telling you that the Jaguar is not receiving a PWM signal. There are a couple of things I can think of immediately that would cause that. One is faulty software that isn't initializing the PWM channel.

Looking at the code you posted, I don't see anywhere that initMotors() is being called. That might be a problem.
  #14   Spotlight this post!  
Unread 12-02-2011, 20:36
Nicholas Norman's Avatar
Nicholas Norman Nicholas Norman is offline
Registered User
AKA: MrBnC
FRC #0070 (More Martians)
Team Role: Driver
 
Join Date: Mar 2010
Rookie Year: 2008
Location: Goodrich
Posts: 7
Nicholas Norman is an unknown quantity at this point
Re: Problem with Jaguar Inputs

initMotors() is at line 28, also I would like to thank you for trying to help me thus far.

Code:
void initMotors()
{
//	jMotor[1] = new Jaguar(4,1); // cim front drive(right)
//	jMotor[2] = new Jaguar(4,2); // cim drive (right)  
	                    
//	jMotor[3] = new Jaguar(4,3); // cim back drive(right)
//	jMotor[4] = new Jaguar(4,4); // cim front drive(left)
	                    
//	jMotor[5] = new Jaguar(4,5); // cim drive(left)
//	jMotor[6] = new Jaguar(4,6); // cim back drive(left)
	
	// for the testing bot
	jMotor[1] = new Jaguar(4,1); // front right
	jMotor[2] = new Jaguar(4,2); // front left
	jMotor[3] = new Jaguar(4,3); // back right
	jMotor[4] = new Jaguar(4,4); // back left
}
The commented motors are for the actual robot when it's ready.
  #15   Spotlight this post!  
Unread 13-02-2011, 12:58
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,113
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: Problem with Jaguar Inputs

But what calls the initMotors() function? I don't see anywhere in the code you posted that sets the jMotor array values.
Closed Thread


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 03:51.

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