Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Gyro Heading Correction in Operator Mode (http://www.chiefdelphi.com/forums/showthread.php?t=62537)

wkethman 26-01-2008 13:50

Gyro Heading Correction in Operator Mode
 
If you set up 4 wheel tank drive in Operator Mode as shown:

void OperatorControl(void)
{

Arcade4(PORT_1, X_AXIS, PORT_1, Y_AXIS, 0, 2, 1, 3, 0, 0, 0, 0);
}

Is there (1) anymore that you have to do if you are just trying to simply drive the robot with one joystick as defined?,(2) can you embed the gyro heading correction?, (3) and is there more information or guidance that you can give for pneumatic control. Thank you

BradAMiller 26-01-2008 15:25

Re: Gyro Heading Correction in Operator Mode
 
Quote:

Originally Posted by wkethman (Post 686164)
If you set up 4 wheel tank drive in Operator Mode as shown:

void OperatorControl(void)
{

Arcade4(PORT_1, X_AXIS, PORT_1, Y_AXIS, 0, 2, 1, 3, 0, 0, 0, 0);
}

Is there (1) anymore that you have to do if you are just trying to simply drive the robot with one joystick as defined?,(2) can you embed the gyro heading correction?, (3) and is there more information or guidance that you can give for pneumatic control. Thank you

That's close to it. Each time Arcard4 (or any of those functions) is called it gets one set of joystick data and passes it to the motors. So you need to put your code into a loop to repeatedly read the joysticks and set the motors.

Code:

void OperatorControl(void)
{
    while (1)
    {
          Arcade4(...);
          // put other motor/OI control code here
    }
}

On the gyro subject, it depends on exactly what you want the robot to do. This code is driving based on the joystick. What sort of heading correction did you have in mind?

And last, pneumatics is actually control is not too bad. Look at the InitPressureSwitch function. It will automatically turn the compressor on and off based on the currrent pressure value from the pressure sensor.

For operating solonoids, look at the SetRelay function.

These are all described in the documentation on the web site.


All times are GMT -5. The time now is 23:49.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi