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.
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.
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.
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.
What do the Jaguar’s LEDs do while you’re moving the joysticks?
Did you remember to ENABLE the robot from the Driver Station?
The Jaguar’s are blinking yellow as they normally do and yes I did enable the robot.
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.
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.
I hope you updated the cRIO image before you tried using this year’s code.
yes we did. I made sure of that.
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.
initMotors() is at line 28, also I would like to thank you for trying to help me thus far.
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.
But what calls the initMotors() function? I don’t see anywhere in the code you posted that sets the jMotor array values.