FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with programming and stuff...

I am having problems programming the robot, I made a new frc project, changed it to have 2 joysticks and set up the motor controls in the teleop vi, succesfully deployed the code, and the joysticks don't do anything... Here is a pic of the teleop viteleopvi.png

And another problem, the camera seems to be throwing this code, it's in the word document attached to this.

0 Kudos
Message 1 of 10
(6,301 Views)

If you run the project in interactive mode (run button on Robot_Main) and add indicators to the output of the joysticks do you see the values change when you move the joystick? Is the driver station connected (no errors in diagnostics tab) with teleop enabled? Do the joysticks show up in the driver station as green?

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 2 of 10
(4,194 Views)

I added indicators, and nothing showed up, so I loaded the example tank drive program, changed the ip, added indicators, and ran it, nothing happened when I moved the joysticks. The joysticks do show up in the driver station under port 1 and 2 and turned blue when I pressed buttonstankdrive.png

0 Kudos
Message 3 of 10
(4,194 Views)

And teleop is enabled in the driver station? Any Errors? If you look at the charts page are there any dropped packets?

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 4 of 10
(4,194 Views)

Teleop is enabled, no errors. I changed the sliders to number idicators, and when I move the joysticks backwords they change to 1, but moving them forewards does not change it from 0.

0 Kudos
Message 5 of 10
(4,194 Views)

I didn't notice this the first time I looked at it but the data type of your indicators is a U8 where the joystick values are doubles. The problem with the joystick values showing up here is likely just a typecasting issue. Change the indicators representation to double and see if that fixes it.

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 6 of 10
(4,194 Views)

I changed  them to double, and the indicators on the screen run from 1 to -1 for the joysticks, but it is not affecting the robot.

0 Kudos
Message 7 of 10
(4,194 Views)

The only thing I noticed in your code was that you were using the x-axis values for your joysticks, not the y-axis. Are you moving the joystick forward and backward or side to side? x-axis will get the side to side values, and y-axis the forward backward values.

0 Kudos
Message 8 of 10
(4,194 Views)

There are also a bunch of "motor not running" posts with some pretty detailed debug steps from the last couple of days so I would start by reviewing those.

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 9 of 10
(4,194 Views)

I fixed it yesterday, by resetting the jaguars.

0 Kudos
Message 10 of 10
(4,194 Views)