Go to Post In conclusion, we can say, with reasonable certainty, that we know nothing. - Max Lobovsky [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 17-01-2015, 12:10
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: 229
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
RobotPy doesn't PWM?

Hi! We have our robot driving with robotpy! But we have a major problem. The robot doesn't slow down when we set it to .125 or something like that. Code: http://pastebin.com/PqNEPmY5. Any help will be greatly appreciated! Thanks a bunch in advance!
  #2   Spotlight this post!  
Unread 17-01-2015, 12:41
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 992
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: RobotPy doesn't PWM?

I don't know Python, but I can tell you what the issue is based on WPILib. The code you have posted will construct two speed controllers, set their outputs to .125, construct a Robot Drive out of those speed controllers, then in Teleop set their outputs based on the joystick value.

Reading the above,you may notice that setting their outputs to .125 there doesn't really accomplish much.

If you want to scale your joystick values, you need to get the joystick values (using getX and getY) scale them, then pass them into an alternate version of the ArcadeDrive method that takes doubles as parameters.
  #3   Spotlight this post!  
Unread 17-01-2015, 13:05
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: 229
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Re: RobotPy doesn't PWM?

Quote:
Originally Posted by RufflesRidge View Post
I don't know Python, but I can tell you what the issue is based on WPILib. The code you have posted will construct two speed controllers, set their outputs to .125, construct a Robot Drive out of those speed controllers, then in Teleop set their outputs based on the joystick value.

Reading the above,you may notice that setting their outputs to .125 there doesn't really accomplish much.

If you want to scale your joystick values, you need to get the joystick values (using getX and getY) scale them, then pass them into an alternate version of the ArcadeDrive method that takes doubles as parameters.
So I exchanged the old arcadedrive for "self.robot_drive.arcadeDrive(self.stick.getX(),se lf.stick.getY())" but it still doesn't slow down.
  #4   Spotlight this post!  
Unread 17-01-2015, 13:09
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 992
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: RobotPy doesn't PWM?

Quote:
Originally Posted by team-4480 View Post
So I exchanged the old arcadedrive for "self.robot_drive.arcadeDrive(self.stick.getX(),se lf.stick.getY())" but it still doesn't slow down.
Closer, but that's still missing the "scale them" part. Try arcadeDrive(.125*self.stickgetX(),.125*self.stick. getY()). That should scale the joystick values down by a factor of 8 (what it looks like you were trying to do) before passing them to the arcadeDrive method.
  #5   Spotlight this post!  
Unread 17-01-2015, 14:29
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: 229
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Re: RobotPy doesn't PWM?

Quote:
Originally Posted by RufflesRidge View Post
Closer, but that's still missing the "scale them" part. Try arcadeDrive(.125*self.stickgetX(),.125*self.stick. getY()). That should scale the joystick values down by a factor of 8 (what it looks like you were trying to do) before passing them to the arcadeDrive method.
Thanks! It worked!
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 03:03.

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