FIRST Tech Challenge Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Programming NXT motors and Servos With buttons + modifying FTC teleop basic (Archived)

Update: This discussion applies to Issues from the 2010 FTC season and is no longer relevant for current FTC competition software.


Hi. My team and I are using servos and NXT motors on our robot for the first time. We are using the FTC Teleop basic vi. I want to modify the program to have one controller be the driver and the other controller the manipulator. Currently, the robot is able to drive in arcade mode using the template unchanged. Now we need assistance with making another read joystick and buttons. On the second controller, one joystick should be used to control a DC motor and the buttons to control one NXT motor and one Servo. I have tried but my attempts have failed. Our qualifier is on February 5. I would appreciate any help that anyone is willing to give. Thank you

0 Kudos
Message 1 of 8
(8,150 Views)

Hi viva31,

Are you getting stuck on how to read the buttons or how to apply what was read? If you want to read the buttons, you will need to put the FTC Read Controller VI in series with the FTC Read Buttons VI. I would recommend taking a look at the more advanced examples, here:

C:\Program Files\National Instruments\LabVIEW 2009\examples\FTC Toolkit\Template Implementations

These examples have more code for you to work from. Let me know if you have any specific questions about these examples.

Take care!

Tanya V

Tanya Visser
National Instruments
LabVIEW Group Manager
Message 2 of 8
(3,370 Views)

Thank you. I have actually posted another question having my more specific problems.

P.S. I was not able to open the links

0 Kudos
Message 3 of 8
(3,370 Views)

The FTC TelopServo worked for my drive wheels.

But there is only one servo on my robot.

I did the same configuration for the servo. Its in controller 2 and i put the servo in channel one.

Do I use one controller or two?

How would I add another Tetrix motor in? Which Loop?

Thank you!!

0 Kudos
Message 4 of 8
(3,370 Views)

We tried using the servo vi found in the Template Implementations directory, mentioned above, to control one servo.  The only modification we made was to create the servo and motor files in the motor configurator so that they had the same names as in the program.  Wasn't sure how to convert the 'left gripper, right gripper' servo array into only a single servo call.  as for viva31, our drive motors work, but the servo does not.  It is plugged into controller 2, channel 1, as we specified in the motor configurator.  We want the servo to respond to input from button 1.

would appreciate some help here - we've been trying to get this to work on and off for a couple of months now.

thanks,

elaine

0 Kudos
Message 5 of 8
(3,370 Views)

Hi Everyone,

Here is how you would add a second controller.

  1. Find the FTC Read Packet VI in Teleop Full/Basic.
  2. At the bottom of the vi is a terminal for Controller 1 and Controller 2. Wire this to the Packet input terminal of FTC Read Controller VI
  3. Connect the desired action input to the FTC Read Controller VI

This would be in the same loop as controller one. If you would like this to driven by a button use the unbundle by name function and then wire the bitton to a case structure.

Joe Daily
National Instruments
Applications Engineer

may the G be with you ....
0 Kudos
Message 6 of 8
(3,370 Views)

Joe,

thanks for your reply.  i'm a little confused here.  When I said 'controller 2', i was referring to the Controller 1 and 2 specified in the motor configurator - and was thinking that Controller 1 and 2 referred to the Hi-Technic motor and servo controllers on the 'bot.   Is this the same controller you're referring to, or are you talking about a 2nd joystick?  It seems like, in the LAbview context help for the Read Controller vi, that it is referring to the game controller - "Wire the controller 1 or Controller 2 output of the FTC REad Packet VI to the Packet input of this VI to read the data for the corresponding game controller."  In fact, when you look at the TeleopFull template, the Controller 1 and 2 outputs from the Read Latest Packet VI have Joystick 1 and 2 as indicators.

elaine

0 Kudos
Message 7 of 8
(3,370 Views)

We figured out our problem, thanks to Joe's comment.  We were using the 'controller 2' line from the Read Packet VI to control the servo vi, when we should have been using the 'controller 1' line.

0 Kudos
Message 8 of 8
(3,370 Views)