OCCRA
Go to Post I would proudly put an AndyMark sticker on our robot any day! - Andy Grady [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #31   Spotlight this post!  
Unread 04-02-2012, 01:48 PM
theNerd's Avatar
theNerd theNerd is offline
Registered User
FRC #3329 (Cam Bots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2110
Location: St. Marys
Posts: 51
theNerd is an unknown quantity at this point
Re: Curve Driving Generator

Quote:
Originally Posted by MICHAELABICK View Post
254 has something like this build into their drive code, though as I said before, I believe it also integrates the current speed of the robot(faster speed, bigger arc, slower speed, smaller arc). I would check their code, as they have made it public, and it is very refined.
I have checked their code and the sections that I have seen are not well documented and I am confused on the logic behind their code.
  #32   Spotlight this post!  
Unread 04-02-2012, 11:04 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 6,069
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Curve Driving Generator

Quote:
Originally Posted by theNerd View Post
How would I go about working with bezier curves as I have never worked with them in my life .
First play around with these Java applets to get a feel for what a Bezier curve is:

http://www.math.ucla.edu/~baker/java/hoefer/Bezier.htm

http://www.math.ubc.ca/~cass/gfx/bezier.html

... then I will try to answer your questions


  #33   Spotlight this post!  
Unread 04-03-2012, 06:24 AM
dbeckwith's Avatar
dbeckwith dbeckwith is offline
Lead Programmer
AKA: Daniel Beckwith
FRC #3205 (The Patriots)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: USA
Posts: 84
dbeckwith is an unknown quantity at this point
Re: Curve Driving Generator

Quote:
Originally Posted by theNerd View Post
How would I go about working with bezier curves as I have never worked with them in my life .
Bezier curves are defined by a formula that can be generalized for any degree, but for the most common, degree 3, the equation for any point along the curve is: B(t) = (1 - t)^3 * P0 + 3 * (1 - t)^2 * t * P1 + 3 * (1 - t) * t^2 * P2 + t^3 * P3 for any t between 0 and 1, inclusive. So you have four control points in a degree 3 curve which you can use to define the shape of the curve, its endpoints, and its tangents at the endpoints (the applet Ether linked to are great for seeing how these affect the curve). I'm not a math genius like Ether so I'm not really sure exactly how to implement them into your question, but in my experience with computer graphics I've found that Bezier splines are easier to control in a way that makes sense than cubic splines.

The Wikipedia article on Bezier curves has a lot of cool information on them: http://en.wikipedia.org/wiki/Bezier_curves

Also if you needed to get the slope of a Bezier curve at some point for your pathing algorithm, I found this: http://www.cs.mtu.edu/~shene/COURSES...ezier-der.html
__________________
q = (2*b) | ~(2*b);

if (life.getLemons() != null) this.lemonade = new Drink(life.getLemons());
else throw new NoLemonsException("What now?");


  #34   Spotlight this post!  
Unread 04-03-2012, 01:08 PM
theNerd's Avatar
theNerd theNerd is offline
Registered User
FRC #3329 (Cam Bots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2110
Location: St. Marys
Posts: 51
theNerd is an unknown quantity at this point
Re: Curve Driving Generator

Quote:
Originally Posted by Ether View Post
... then I will try to answer your questions
]
Ok, I am ready. I have quite a good feel for Bezier curves now....which is great timing since my Calc class just hit parametric equations.
  #35   Spotlight this post!  
Unread 09-13-2012, 11:46 AM
PTC_Chris's Avatar
PTC_Chris PTC_Chris is offline
PTC Senior Academic Program Manager
no team (PTC Academic Program)
 
Join Date: Sep 2012
Rookie Year: 2011
Location: United States
Posts: 3
PTC_Chris is an unknown quantity at this point
Re: Curve Driving Generator

I have been conducting Mathcad webinars for FIRST teams. A search turned up this conversation and I have implemented the Matrix Solution as a Mathcad worksheet. The attached .zip folder contains both a Mathcad Prime 2.0 and a .pdf version of the worksheet.

PTC is once again offering Mathcad Prime for free to participants in FIRST Robotics programs. Contact FIRSTsupport@ptc.com if you are interested in obtaining a copy of Mathcad Prime.

You can learn how to create Mathcad worksheets like this on our Wednesday Night Robotalk Webinars (7 pm EST). This Wednesday night (Sept 19 2012) we will focus on the tools used in the attached worksheet. To register for the webinar click here.

Chris
Attached Files
File Type: zip Curve Driving Generator.zip (700.3 KB, 11 views)
  #36   Spotlight this post!  
Unread 09-13-2012, 12:16 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 6,069
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Curve Driving Generator

Quote:
Originally Posted by PTC_Chris View Post
I have implemented the Matrix Solution as a Mathcad worksheet.
Thanks for posting this Chris. Unfortunately, the example you picked is a case where a cubic polynomial is surely not what you'd want. A Bezier curve would give a much more desirable curve for the robot to follow. Does Mathcad support Bezier curves?


Attached is a Bezier curve for the example you gave.

Also, there's an Excel spreadsheet here for those who don't have Maxima* installed:

http://www.chiefdelphi.com/media/papers/2713


* Maxima is a free open-source Computer Algebra System, available for download at the link below. Highly recommended:

http://maxima.sourceforge.net/




Attached Thumbnails
Click image for larger version

Name:	Bezier graph.png
Views:	35
Size:	20.4 KB
ID:	12989  Click image for larger version

Name:	Bezier equations.png
Views:	33
Size:	20.3 KB
ID:	12990  
Attached Files
File Type: txt Bezier Maxima macro.txt (834 Bytes, 7 views)

Last edited by Ether : 09-13-2012 at 04:34 PM.
  #37   Spotlight this post!  
Unread 09-14-2012, 07:39 AM
PTC_Chris's Avatar
PTC_Chris PTC_Chris is offline
PTC Senior Academic Program Manager
no team (PTC Academic Program)
 
Join Date: Sep 2012
Rookie Year: 2011
Location: United States
Posts: 3
PTC_Chris is an unknown quantity at this point
Re: Curve Driving Generator

@Ether: The example in the .pdf was more deliberate than unfortunate. I chose a tangent line slope that would exagerate the effect and help high school students to make connections to their work in schools. (I am an educator, not an engineer.)

I included the .pdf more to show what a Mathcad worksheet looks like. I think it is more transparent than either Excel or Maxima because Mathcad uses standard math notation. The .pdf was not meant to be the primary contribution.

The Mathcad worksheet is a computational document, so it is possible to change the parameters. The worksheet is therefore a general method for calculating a cubic polynomial given the endpoints and tangent slopes. As you observed in your post, there are some examples where the solution is efficient, others where it is not. With the Mathcad worksheet, it is possible to quickly derive and plot a path and determine whether or not it is a solution worth implementing.

It is certainly possible to build a Mathcad worksheet to generate the Bezier Curve. I will add this to my "Want to Do" list and post it to the Thread when I cross it off. Thanks for the suggestion and the Excel worksheet. I'll probably convert your Excel spreadsheet to Mathcad.
  #38   Spotlight this post!  
Unread 09-14-2012, 09:42 AM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 6,069
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Curve Driving Generator

Quote:
Originally Posted by PTC_Chris View Post
@Ether: The example in the .pdf was more deliberate than unfortunate. I chose a tangent line slope that would exagerate the effect and help high school students to make connections to their work in schools. (I am an educator, not an engineer.)
Ah. Thanks for that clarification. In that context, I think your example is excellent.

I'm both an engineer (now retired after 33 years) and an educator. I share your passion about teaching.


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 04:55 PM.

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


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