Go to Post What have we learned? Cannons are awesome :rolleyes: - DominickC [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 Rating: Thread Rating: 7 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 22-05-2015, 16:46
Bernini Bernini is offline
Junior Member
no team
 
Join Date: Mar 2015
Rookie Year: 2002
Location: St Louis
Posts: 11
Bernini has a little shameless behaviour in the past
Swerve path and motor trajectory generator?

Does a path planner exist for swerve given way points x y and heading?
  #2   Spotlight this post!  
Unread 22-05-2015, 21:07
EmileH's Avatar
EmileH EmileH is offline
it's not a water game, ok?
AKA: Emile Hamwey
FRC #1058 (The PVC Pirates) & SLFF (NE Way You Want It)
Team Role: Programmer
 
Join Date: Dec 2014
Rookie Year: 2011
Location: New England
Posts: 536
EmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant future
Re: Swerve path and motor trajectory generator?

I think you could benefit greatly from Ether's swerve kinematics and programming documents. Look for the excel spreadsheet. All you need to give is a Joystick Y(up/down), X(left/right strafe), Z (Rotation) and Gyro Angle and it visualizes the angle and speed of 4 swerve wheels.

There is also a paper on how to write these algorithms into the programming language of your choice.

Hope this helps.
__________________
2016-present: High School Student, FRC 1058 PVC Pirates
2016: RiverRage 20 Champions, Battle of the Bay 3 Champions

2013-2015: Middle School Student, FRC 3467 Windham Windup
  #3   Spotlight this post!  
Unread 22-05-2015, 21:52
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 486
SoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant future
Re: Swerve path and motor trajectory generator?

Quote:
Originally Posted by emileh3467 View Post
I think you could benefit greatly from Ether's swerve kinematics and programming documents. Look for the excel spreadsheet. All you need to give is a Joystick Y(up/down), X(left/right strafe), Z (Rotation) and Gyro Angle and it visualizes the angle and speed of 4 swerve wheels.

There is also a paper on how to write these algorithms into the programming language of your choice.

Hope this helps.
I think what he's looking for is something that will generate a sequence of angles and powers to do over time not just a single setting to choose. Interestingly, I have written such a thing for some restricted cases but was more of an exploratory exercise and didn't actually make it onto a robot.

To illustrate the difference between these two things, suppose what you want to do is go left. Ether's spreadsheet will tell you to turn all the wheels should face left and the power should be 100%. If you want to actually make trajectories what you would have is the sequence of "first turn wheels so they face left, second then turn power on for 1 ft.". Incidentally, this is not the fastest way to get to a given x,y coordinate unless you're already facing that direction.
  #4   Spotlight this post!  
Unread 22-05-2015, 23:22
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,363
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: Swerve path and motor trajectory generator?

I assume that you have a functioning swerve chassis. Before you start on figuring out path planning, can your robot drive straight. If you command it to drive 20 ft straight ahead can your current platform do it? With perfect alignment and say 10 or more test can your robot go perfectly straight every time? What is the error spot. If your swerve can't drive straight then your not ready to tackle path planning. We have found that for autonomous navigation with our swerve required the minimum of adding the kit of parts gyro and a PID control loop to drive straight. This year we used the Navx MXP. We have encoders on all wheels to measure wheel rotation (distance). Are you to this point yet? If not you have allot of work ahead.
  #5   Spotlight this post!  
Unread 23-05-2015, 00:59
Bernini Bernini is offline
Junior Member
no team
 
Join Date: Mar 2015
Rookie Year: 2002
Location: St Louis
Posts: 11
Bernini has a little shameless behaviour in the past
Re: Swerve path and motor trajectory generator?

I have a functioning swerve chassis that I can program to do anything I want really with great accuracy with encoders (for wheel angle and wheel rotations), as well as a gyro. I can set it to go x feet forward and end at a certain angle and it will do that in the amount of time that I specified thanks to @faust1706's neural network library. I'm looking for a swerve implementation of 254's waypoint navigation using splines:

http://www.chiefdelphi.com/forums/sh...=path+planning

I am looking for the same thing, except with swerve, that takes waypoints x y and heading and will traverse the path in a specified t time.
  #6   Spotlight this post!  
Unread 23-05-2015, 01:24
faust1706's Avatar
faust1706 faust1706 is offline
Registered User
FRC #1706 (Ratchet Rockers)
Team Role: College Student
 
Join Date: Apr 2012
Rookie Year: 2011
Location: St Louis
Posts: 498
faust1706 is infamous around these partsfaust1706 is infamous around these parts
Re: Swerve path and motor trajectory generator?

Quote:
Originally Posted by Bernini View Post
.... thanks to @faust1706's neural network library. ...
It's been a pleasure working with you.

I actually have exactly what you are looking for, verbatim actually...It is entirely untested, however.

https://github.com/faust1706/Smooth-Swerve
__________________
"You're a gentleman," they used to say to him. "You shouldn't have gone murdering people with a hatchet; that's no occupation for a gentleman."
  #7   Spotlight this post!  
Unread 23-05-2015, 13:47
Bernini Bernini is offline
Junior Member
no team
 
Join Date: Mar 2015
Rookie Year: 2002
Location: St Louis
Posts: 11
Bernini has a little shameless behaviour in the past
Re: Swerve path and motor trajectory generator?

I should have just asked you, it seems that you always have exactly what I am looking for or know exactly where to find it. I'll try to get this on the robot as soon as I can.
  #8   Spotlight this post!  
Unread 23-05-2015, 20:23
AlexanderTheOK AlexanderTheOK is offline
Guy
no team
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Los Angeles
Posts: 146
AlexanderTheOK is just really niceAlexanderTheOK is just really niceAlexanderTheOK is just really niceAlexanderTheOK is just really nice
Re: Swerve path and motor trajectory generator?

Quote:
Originally Posted by faust1706 View Post
It's been a pleasure working with you.

I actually have exactly what you are looking for, verbatim actually...It is entirely untested, however.

https://github.com/faust1706/Smooth-Swerve
I'm sorry but what exactly is the implementation of this? As far as I understood, the original point of 254's spline based navigation was to give a robot that couldn't strafe an option for getting to a very specific point and orientation. With a swerve you can just give it points to get to and (as long as you have done due diligence and implemented dynamic acceleration limiting in your code) it should drive smoothly, at least it did for us. What kind of situations are you foreseeing where a holonomic robot would actually need to follow a defined curve rather than just a set of waypoints?
  #9   Spotlight this post!  
Unread 23-05-2015, 22:03
Pault's Avatar
Pault Pault is offline
Registered User
FRC #0246 (Overclocked)
Team Role: College Student
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Boston
Posts: 618
Pault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond repute
Re: Swerve path and motor trajectory generator?

Quote:
Originally Posted by AlexanderTheOK View Post
I'm sorry but what exactly is the implementation of this? As far as I understood, the original point of 254's spline based navigation was to give a robot that couldn't strafe an option for getting to a very specific point and orientation. With a swerve you can just give it points to get to and (as long as you have done due diligence and implemented dynamic acceleration limiting in your code) it should drive smoothly, at least it did for us. What kind of situations are you foreseeing where a holonomic robot would actually need to follow a defined curve rather than just a set of waypoints?
I don't know about the OP, but the reason I have considered doing this is for avoiding objects rather than trying to drive into them (i.e. the cans for a 20pt autonomous, or even other robots if you have a way to detect them and can run the path generator in real-time).
  #10   Spotlight this post!  
Unread 23-05-2015, 22:24
Bernini Bernini is offline
Junior Member
no team
 
Join Date: Mar 2015
Rookie Year: 2002
Location: St Louis
Posts: 11
Bernini has a little shameless behaviour in the past
Re: Swerve path and motor trajectory generator?

Quote:
Originally Posted by AlexanderTheOK View Post
I'm sorry but what exactly is the implementation of this?
One quick implementation of this is picking up objects on the fly. If you know where an object is with respect to the field, then you can drive to it, while driving to it, orientate your robot to quickly pick it up, have a passive grabber grab it, have your robot then proceed to go to a scoring position, then score, all in one fluid motion.
  #11   Spotlight this post!  
Unread 24-05-2015, 01:27
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Swerve path and motor trajectory generator?

Quote:
Originally Posted by Bernini View Post
Does a path planner exist for swerve given way points x y and heading?
For a truly holonomic robot, you can generate three separate 1D trajectories for x, y, and heading and have the robot follow them. Many existing pieces of public code, including the 254 libraries, would be appropriate for this task.
  #12   Spotlight this post!  
Unread 24-05-2015, 03:05
faust1706's Avatar
faust1706 faust1706 is offline
Registered User
FRC #1706 (Ratchet Rockers)
Team Role: College Student
 
Join Date: Apr 2012
Rookie Year: 2011
Location: St Louis
Posts: 498
faust1706 is infamous around these partsfaust1706 is infamous around these parts
Re: Swerve path and motor trajectory generator?

https://www.youtube.com/watch?v=KsF0...ature=youtu.be

Here's a video of a "robot" "simulation" that a programmer on team 2046 did of the program.
__________________
"You're a gentleman," they used to say to him. "You shouldn't have gone murdering people with a hatchet; that's no occupation for a gentleman."

Last edited by faust1706 : 24-05-2015 at 03:21. Reason: words
  #13   Spotlight this post!  
Unread 25-05-2015, 16:29
Bernini Bernini is offline
Junior Member
no team
 
Join Date: Mar 2015
Rookie Year: 2002
Location: St Louis
Posts: 11
Bernini has a little shameless behaviour in the past
Re: Swerve path and motor trajectory generator?

I guess I should post an update: @faust1706's code works perfectly on a robot if you have the ability to go n encoder counts in t seconds, which I do with his neural network program that I trained to do just that.
  #14   Spotlight this post!  
Unread 25-05-2015, 21:13
teku14's Avatar
teku14 teku14 is offline
http:
FRC #2614 (MARS)
Team Role: Programmer
 
Join Date: Apr 2014
Rookie Year: 2013
Location: Morgantown, WV
Posts: 64
teku14 is a jewel in the roughteku14 is a jewel in the roughteku14 is a jewel in the roughteku14 is a jewel in the rough
Re: Swerve path and motor trajectory generator?

How do I run a simulation using the code on my laptop like the video above?
  #15   Spotlight this post!  
Unread 25-05-2015, 21:55
faust1706's Avatar
faust1706 faust1706 is offline
Registered User
FRC #1706 (Ratchet Rockers)
Team Role: College Student
 
Join Date: Apr 2012
Rookie Year: 2011
Location: St Louis
Posts: 498
faust1706 is infamous around these partsfaust1706 is infamous around these parts
Re: Swerve path and motor trajectory generator?

You can get the latest code from here: https://github.com/faust1706/Smooth-Swerve

The simulation is what this code displays as of right now, but that can be changed. To alter the simulation, change the waypoints to whatever and however many you want. Make sure the heading variable is of the same size as the waypoints array size, otherwise the program will get an outofbounds error.

I have not rigorously tested this code, so feel free to try to break it. If you do break it, either by making it generate an incorrect path or something, then leave a comment here or make it an issue on the repo's page.

The simulation is also completely smooth now thanks to the programmer on 2046.
__________________
"You're a gentleman," they used to say to him. "You shouldn't have gone murdering people with a hatchet; that's no occupation for a gentleman."

Last edited by faust1706 : 26-05-2015 at 12:07.
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 01:40.

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