Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Problem with Jaguar Inputs (http://www.chiefdelphi.com/forums/showthread.php?t=91500)

Nicholas Norman 11-02-2011 12:59

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.

basicxman 11-02-2011 13:05

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.

Nicholas Norman 11-02-2011 13:08

Re: Problem with Jaguar Inputs
 
1 Attachment(s)
Okay, here it is.

Attachment 10070

Zuelu562 11-02-2011 13:10

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.

Nicholas Norman 11-02-2011 13:11

Re: Problem with Jaguar Inputs
 
I have multiple times yet every time i get the same result.

Zuelu562 11-02-2011 13:14

Re: Problem with Jaguar Inputs
 
Quote:

Originally Posted by Nicholas Norman (Post 1020603)
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.

Alan Anderson 11-02-2011 15:25

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?

Nicholas Norman 11-02-2011 15:36

Re: Problem with Jaguar Inputs
 
The Jaguar's are blinking yellow as they normally do and yes I did enable the robot.

Alan Anderson 11-02-2011 16:35

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.

Nicholas Norman 11-02-2011 16:55

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.

Alan Anderson 11-02-2011 17:02

Re: Problem with Jaguar Inputs
 
Quote:

Originally Posted by Nicholas Norman (Post 1020756)
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.

Nicholas Norman 11-02-2011 17:09

Re: Problem with Jaguar Inputs
 
yes we did. I made sure of that.

Alan Anderson 11-02-2011 22:23

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.

Nicholas Norman 12-02-2011 20:36

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.

Alan Anderson 13-02-2011 12:58

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.


All times are GMT -5. The time now is 03:49.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi