Go to Post As goes with all of my advice on CD, try it yourself and make up your own mind. I'm just suggesting things based on experience. See what works for your team. Follow my suggestions to the letter, mix and match them, or even throw them completely out the window. It's all about you and your team. - DampRobot [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

 
 
 
Thread Tools Rating: Thread Rating: 4 votes, 4.75 average. Display Modes
Prev Previous Post   Next Post Next
  #7   Spotlight this post!  
Unread 01-25-2014, 10:09 AM
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Mechanum wheel programming in C++

Quote:
Originally Posted by Ether View Post

Questions? Fire away.

What about field-centric? My team tried this out a few times but got really weird results. Would the following code snippet be correct?
Code:
[...] gyro->Reset(); float theta = gyro->GetAngle(); [...]

yVal2=(float) (yVal*Math.cos(theta) - xVal*Math.sin(theta));
xVal2=(float) (yVal*Math.sin(theta) + xVal*Math.cos(theta));
When we tried using this in our mecanum code method the robot could drive straight but would jitter and twitch if we tried to rotate it (like some robots do when their power draw exceeds the operating power of the motor controllers when your battery is low).
Reply With Quote
 


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 10:21 AM.

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