Go to Post We may not build the best robots but we're building better students in the long run and means much much more. - Koko Ed [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-01-2015, 17:17
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 222
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
How to use a fifth drive motor with RobotPy?

Hi! We hit a problem with our robot code. We got it to drive with a normal chassis that has one motor on each side like a tank. But now we want to use our new Omni wheels(http://upload.wikimedia.org/wikipedi...77_3727729.jpg) with one motor on each side and then one in the middle perpendicular to the other motors so we can strafe sideways. Anyways, our problem is how do we set the fifth motor(The one perpendicular to the side motors) to be the x-axis on the controller. We also need the side motors to only be able to go forward or backward(y-axis). We are using a joystick for the controls. Thanks a bunch in advance!
  #2   Spotlight this post!  
Unread 18-01-2015, 18:27
x86_4819's Avatar
x86_4819 x86_4819 is offline
computer-whisperer
AKA: Christian Balcom
FRC #4819 (Flat Mountain Mechanics)
Team Role: Programmer
 
Join Date: Sep 2014
Rookie Year: 2013
Location: Shepherd MI
Posts: 92
x86_4819 is on a distinguished road
Re: How to use a fifth drive motor with RobotPy?

To do this you will need to do the following:

Initialize the new motor controller object in robotInit():
Code:
self.slide_motor = wpilib.Talon(INSERT_PORT_NUMBER_HERE)
If your motor controller is something other than a Talon, you will need to adjust accordingly.

Use the x-axis of the Joystick to control the motor in teleopPeriodic():
Code:
self.slide_motor.set(self.joystick.getX())
I hope this works for you!
__________________




My Github Repositories
  #3   Spotlight this post!  
Unread 18-01-2015, 18:34
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 222
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Re: How to use a fifth drive motor with RobotPy?

Quote:
Originally Posted by x86_4819 View Post
To do this you will need to do the following:

Initialize the new motor controller object in robotInit():
Code:
self.slide_motor = wpilib.Talon(INSERT_PORT_NUMBER_HERE)
If your motor controller is something other than a Talon, you will need to adjust accordingly.

Use the x-axis of the Joystick to control the motor in teleopPeriodic():
Code:
self.slide_motor.set(self.joystick.getX())
I hope this works for you!
So then for the side motors, it would be
Code:
self.side_motor.set(self.joystick.getY())
? We will try it Monday!
Closed Thread


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:45.

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