Go to Post Is it really only 5 axes? It looks like that thing could bend time and space. - EricVanWyk [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 20-02-2012, 13:21
frdrake frdrake is offline
Registered User
FRC #0233
 
Join Date: Feb 2012
Location: Melbourne
Posts: 23
frdrake is on a distinguished road
Reverse polarity of a victor at declaration?

So I searched but couldn't find this question answered anywhere else.

Is there a way to inverse the victor commands at declaration of the motor? By which I mean as the motors go on there's a possibility that a motor command of 1 makes it go backward when it comes to driving the robot. Am I stuck modifying the motorcommand during processing or is there an overloaded way during declaration to tell the robot that motor is backwards?
Reply With Quote
  #2   Spotlight this post!  
Unread 20-02-2012, 14:00
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: Reverse polarity of a victor at declaration?

If your using the robotDrive yes theres a method for reversing the motors:
Code:
myRobot.SetInvertedMotor(myRobot.kRearLeftMotor, true);
If you want to do the same to a single jaguar/victor, there is no way I know of to do it (outside of logic in your own code to switch the direction)
Reply With Quote
  #3   Spotlight this post!  
Unread 20-02-2012, 16:21
frdrake frdrake is offline
Registered User
FRC #0233
 
Join Date: Feb 2012
Location: Melbourne
Posts: 23
frdrake is on a distinguished road
Re: Reverse polarity of a victor at declaration?

Yea, I'm referring to an individual basis. Right now we're just doing Motor->Set(-MotorCommand) for the ones that are backwards. Just seems like there should be a more elegant solution.
Reply With Quote
  #4   Spotlight this post!  
Unread 20-02-2012, 16:46
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Reverse polarity of a victor at declaration?

Quote:
Originally Posted by frdrake View Post
Yea, I'm referring to an individual basis. Right now we're just doing Motor->Set(-MotorCommand) for the ones that are backwards. Just seems like there should be a more elegant solution.
Yes unfortunately, the myRobot.SetInvertedMotor(myRobot.kRearLeftMotor, true) function only handles all the motors for the RobotDrive class. If you have an individual motor for an arm or shooter, for example, I can't find an equivalent "Inverse" function in the WPI library. In our code, we have encapsulated individual motors into a PIDMotor class and provided our own "Inverse" function. There are many quick and dirty ways to do this. One of them is:

When calling the SetSpeed(speed) of a motor, you can do SetSpeed(speed*ARM_MOTOR_INVERSE) where ARM_MOTOR_INVERSE is defined as either -1.0 or 1.0.
__________________
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:34.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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