Go to Post This is one case where I really wish Andymark didn't listen to their customers so well. - ASD20 [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

 
 
 
Thread Tools Rating: Thread Rating: 32 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 09-10-2014, 14:59
NotInControl NotInControl is offline
Controls Engineer
AKA: Kevin
FRC #2168 (Aluminum Falcons)
Team Role: Engineer
 
Join Date: Oct 2011
Rookie Year: 2004
Location: Groton, CT
Posts: 261
NotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond repute
Smooth Path Generator for RoboRio 2015

After the Cheesy Poofs (FRC 254) put on an amazing display of robot path following during the 2014 FRC championship finals, a lot of buzz has been generated by other teams wishing to implement a similar feature on their robot. The poofs released their code and the community learned they used 5th order polynomial splines in order to find the best fit smooth curve from Point A to Point B.

Path planning has been the primary focus in many other fields outside of FRC. For example in Game AI, generating smooth paths for the main character to follow when going around obstacles needs to be calculated in real-time. In other robotics fields such as autonomous car navigation, many smooth paths need to be generated simultaneously, and the "best" path chosen.

These fields have spent many years adopting and optimizing the field of motion planning for their specific application. However, what they have in common is that the calculations for generating the path needs to be performed in real-time, and typically are performed on inexpensive embedded devices, such as gaming consoles or car computers. As part of my PhD thesis (developing a controller for an Autonomous Car) I had the opportunity to create a simplified path planner for real-time mobile robot applications.

This class is a port of the code I developed for my PhD thesis, to perform the function of path calculation on a mobile, skid-steer robot very quickly (near real-time). The algorithms provided here rely on algorithms used in optimal control theory to converge to a solution very quickly. The code here uses the "gradient descent" optimization technique to coerce a simple waypoint path, into a smooth trajectory.

Once the smooth trajectory is determined, parallel paths for the left and right wheels are calculated based on the robots trackwidth distance, and corresponding velocities for each of the wheels are determined. As long as the robot has independent speed controllers for the left and right side of the drivetrain, the user can "play" through the velocity profile as if they are setpoints and the robot should drive the corresponding path.

The function takes in just 3 parameters to get started and boost a very simple user interface. I started writing documentation which lives on the ReadMe in Github, check it out to get started.

You can check it out here: https://github.com/KHEngineering/SmoothPathPlanner

The program is written in Java, but outputs arrays which can support C++ and Labview teams as well. It does not require any external library and can run on any desktop, or even the RoboRio. I have even included a plotting function modeled off the matlab plot function, to help visualize the path. (You can't run the plotter on the RoboRio because it is headless, and the JVM is configure to throw an error if you try to display anything).

This code can run directly on the RoboRio to calculate new paths on the fly and the response times have been under 30ms for a complete calculation of all points with paths of about 50 waypoints (more than generous for most cases). I currently have this running on the Beta 2015 system. I will be updating the documentation, and streamlining the code as we approach closer to the 2015 season, along with ironing out any bugs, but if I didn't release this now, I probably would never do it.

So please use it, provide any feedback, and if you run into any errors, bugs, or crashes, please let me know by creating a issue on github. Here are some screen shots of what this can produce.

THIS CODE IS NOT ASSOCIATED WITH MY TEAM, I DEVELOPED IT AND AM RELEASING IT BASED ON MY PERSONAL RESEARCH AS I BELIEVE IT WILL BE USEFUL FOR OTHER TEAMS COMPETING IN FRC.

Regards,
Kevin
Attached Thumbnails
Click image for larger version

Name:	Image3.png
Views:	308
Size:	23.0 KB
ID:	17370  Click image for larger version

Name:	Image5.png
Views:	289
Size:	28.9 KB
ID:	17371  Click image for larger version

Name:	Image9.png
Views:	191
Size:	31.6 KB
ID:	17372  Click image for larger version

Name:	Image10.png
Views:	195
Size:	31.8 KB
ID:	17373  Click image for larger version

Name:	Image4.png
Views:	214
Size:	34.1 KB
ID:	17374  

__________________
Controls Engineer, Team 2168 - The Aluminum Falcons
[2016 Season] - World Championship Controls Award, District Controls Award, 3rd BlueBanner
-World Championship- #45 seed in Quals, World Championship Innovation in Controls Award - Curie
-NE Championship- #26 seed in Quals, winner(195,125,2168)
[2015 Season] - NE Championship Controls Award, 2nd Blue Banner
-NE Championship- #26 seed in Quals, NE Championship Innovation in Controls Award
-MA District Event- #17 seed in Quals, Winner(2168,3718,3146)
[2014 Season] - NE Championship Controls Award & Semi-finalists, District Controls Award, Creativity Award, & Finalists
-NE Championship- #36 seed in Quals, SemiFinalist(228,2168,3525), NE Championship Innovation in Controls Award
-RI District Event- #7 seed in Quals, Finalist(1519,2168,5163), Innovation in Controls Award
-Groton District Event- #9 seed in Quals, QuarterFinalist(2168, 125, 5112), Creativity Award
[2013 Season] - WPI Regional Winner - 1st Blue Banner

Last edited by NotInControl : 09-10-2014 at 15:23.
 


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

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