alexsleat / projectChimaera

Rinzler is an exceptionally skilled warrior and is the elite combatant in all games in the Grid.
11 stars 7 forks source link

Motor direction #86

Closed ghost closed 12 years ago

ghost commented 12 years ago

Motors need to publish the direction they are spinning in. So odometery can figure out with better accuracy.

decoderdan commented 12 years ago

What format does this need to be in?

ghost commented 12 years ago

Just a boolean type thing, -1 for backwards, 1 for forwards 0 for off.

On Mon, Jun 18, 2012 at 1:58 PM, decoderdan < reply@reply.github.com

wrote:

What format does this need to be in?


Reply to this email directly or view it on GitHub: https://github.com/alexsleat/projectChimaera/issues/86#issuecomment-6395214

alexsleat commented 12 years ago

Does this make logical sense, I'm having one of those days filled of brain-farts.

        //Add together the left and right values, divide them by stationary motors (1500 * 2), 
        //  if less than 1 it's going backwards, if more than 1 it's going forwards.
        //  Otherwise it's turning. 
        if( ((float(yawLeftPWM) + float(yawRightPWM)) / 3000.0) > 1.0 ) //Forwards
            motorDir.data = 1;
        else if( ((float(yawLeftPWM) + float(yawRightPWM)) / 3000.0) < 1.0 )    //Backwards
            motorDir.data = -1; 
        else                                    //Turning on the spot or stationary.
            motorDir.data = 0;
Wurbledood commented 12 years ago

I think I commented that part out of the motor code, as it wouldn;t compile, i'll have another look and try to make it play nice

ghost commented 12 years ago

It's not really needed anymore. If you want to keep it that's fine. But focus on more important stuff first.

On 30 Jun 2012, at 19:16, Wurbledood reply@reply.github.com wrote:

I think I commented that part out of the motor code, as it wouldn;t compile, i'll have another look and try to make it play nice


Reply to this email directly or view it on GitHub: https://github.com/alexsleat/projectChimaera/issues/86#issuecomment-6687217