FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Weird code issues

As i am compeating at an event I have been trying to get my aton code working all day.  I have this issue where labview on my laptop is working but not when i just run off the cRIO.  So heres what is going on, I have to have it backwards in my code to make it run in the right direction.  SO when i dump it it is right but i am driving to a certon value on my encoders and then spining and i only drive forward and it never switches.  But when i use my laptop it will switch.  Any help woulb be great.

0 Kudos
Message 1 of 3
(6,373 Views)

First... the backward/forward issue...

The joysticks are pretty dumb, and when you pust them forward, they output a negative value.

So all the motor drive VI's were built to assume that forward is negative (so you can connect the joystick outputs to the motor drive inputs).

Note: During beta testing, many of us requested that they fix this inside the Joystick VI's (so positive always meant forward) but we were over-ruled.

So, in autonomous, you must remember that negative drive signals go froward.

If you look at the sample auton code, it shows going forward with a -0.5 value.

In my case I put a sub-VI around the drive system which atotmatically flipped the for/rev direction.

next ....

I'm not sure what you mean by "it works on my laptop".

Do you mean it works when you use the "Run" button on your laptop, but not when it runs "stand' alone".

The code is always running on the cRIO, but if the laptop is not connected it runs the "Startup Code".

Have you re-built your program and then Deployed it with the "Run On Startup" option set?

If you haven't done the re-build you won't actually see your new code on the robot after a reboot.

Phil.

Get a life? This IS my life!
0 Kudos
Message 2 of 3
(2,656 Views)

Thanks for the post Philbot.

Needler, do you need any more clarification?  If you still haven't gotten this working, I suggest answering Philbot's questions - I am also having trouble understanding the last part of your post.

Ben

National Instruments
Certified LabVIEW Associate Developer
Certified TestStand Developer
0 Kudos
Message 3 of 3
(2,656 Views)