Thread: AI Programming
View Single Post
  #4   Spotlight this post!  
Unread 06-02-2009, 23:44
airnate airnate is offline
Registered User
FRC #0236 (Techno Ticks)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: southeastern CT
Posts: 93
airnate is a jewel in the roughairnate is a jewel in the roughairnate is a jewel in the rough
Re: AI Programming

Probably the easiest way to do this is to create more controls on the Basic Robot Global.vi, which as the name implies, is a global variable.

For instance if you want to pass an Accelerometer device reference to the Autonomous Independent vi,

1. Drop the Accelerometer Open.vi in Basic Robot Main.vi
2. Double click the Accelerometer Open.vi to open it.
3. Copy the AccelerometerDevRef (select the indicator and press Ctrl-C)
4. Open Robot Global.vi from the project window.
5. Paste the AccelerometerDevRef on the Robot Global.vi and name it (let's say "Accel1" for this example).
6. Drag the Robot Global.vi from the Project window to the Basic Robot Main.
7. Click on the Robot Global and select "Accel1" (or whatever you named in step 2).
8. Wire the Accelerometer Open.vi to the Accel1 global
9. Drag another Robot Global.vi from the project to Autonomous Independent vi
10. Right click on it and select "Change to Read"
11. use it to wire whatever you're going to do with the sensor.

You can see that the basic robot framework already has a RobotDriveDevRef which may be the "motor" reference that you were asking about.

Actually, you should be careful to distinguish between "drive" references and "motor" references. The "Drive" VIs are used where two or more motors used together as a drive system (e.g. arcade, tank). The "Motor" VIs are used for control of a single motor.
Reply With Quote