Go to Post If you look closer, you'll see I did those photos over a period of years... and they were only done with one program... but yeah, a little free time with no where to direct it and I can become, um, creative... - MissInformation [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #25   Spotlight this post!  
Unread 24-01-2015, 01:13
Joshua Sicz Joshua Sicz is offline
Registered User
FRC #2403
 
Join Date: Jan 2014
Location: Mesa, Arizona
Posts: 29
Joshua Sicz is an unknown quantity at this point
Re: Realistic Velocity Calculation

Quote:
Originally Posted by GeeTwo View Post
In order to even have a chance at making this work, you would also need a gyroscope. At each time step, you would have to rotate the previous time step's x and y by the amount of angle you've turned (theta), then add the change in speed. Assuming x is to the right and y is forward, and theta is rotation to the right, you'd have to do:
  • ynew = yold*cos(theta) + xold*sin(theta) + yacc*rdelta
  • xnew = xold*cos(theta) - yold*sin(theta) + xacc*tdelta

This is known as inertial navigation, and you can very quickly get lost in the intricacies if you're actually trying to use it for more than a few seconds, or in more than two dimensions, or across more than an area the size of, say, an FRC arena. Even staying in a 27-foot square box and limiting yourself to 2 minutes and 30 seconds, it would probably be a good idea to have a "reset" button that you can hit when the robot is actually stopped that sets both values to zero.
Awesome! We have actually played around we this exact thing this season and have got it to work with exactly they way you have said it to be done. Now I just need to get velocity from the x and y direction relative to the frame. Getting the code to output a realistic velocity because we get random numbers out of the accelerator.
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 00:04.

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