OCCRA
Go to Post I predict the champion drive teams at each event of the 2011 season will consist of vertebrates. - Taylor [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-07-2018, 03:52 PM
hshively hshively is offline
Registered User
FRC #4256 (Cyborg Cats)
Team Role: Programmer
 
Join Date: May 2017
Rookie Year: 2016
Location: Saint Louis
Posts: 8
hshively is a jewel in the roughhshively is a jewel in the roughhshively is a jewel in the roughhshively is a jewel in the rough
Path Following - in English

Lately, a lot of us have been sharing autonomous code that can follow some sort of predefined path. This is amazing, but we tend to assume everyone will be able to figure out what's going on in the code just by looking at it. I'm guilty of this as well, and while that assumption may prove true eventually, it would be way quicker if we were to give summaries of our frameworks in English. If we see some common themes, it would also be great to start categorizing them.

I'll start. Team 4256 defines paths with parametric equations: x(p) and y(p). We get our current location using encoders, and compute a target location using some initial value of p (usually 0). Whenever the distance between our current and target locations is less than some constant (we chose 3 feet), we increment p by a small amount (.05). We then recompute a target location and use PID to drive toward it. Basically our robot has a bubble around it, and it more or less chases the bubble-and-path intersection point.

Hopefully some of you will be willing to share. I really want to know how other teams do things!
Reply With Quote
  #2   Spotlight this post!  
Unread 08-07-2018, 11:53 PM
retrodaredevil retrodaredevil is offline
Registered User
AKA: Josh Shannon
FRC #1444 (Lightning 1444)
Team Role: Programmer
 
Join Date: Jul 2018
Rookie Year: 2018
Location: St. Louis
Posts: 3
retrodaredevil is an unknown quantity at this point
Re: Path Following - in English

This year our team basically had a command based robot for autonomous even though we didn't use the built in Command class. The command we used the most was called DriveStraight and since we had a swerve drive, that's all we needed most of the time.

We got how far we went by just using the front left encoder count but next year we will probably average all the wheels encoders. The DistanceDrive basically just has an angle and a distance to go. When the distance of our front left wheel has gone the specified distance, it will set the speeds of the wheels to 0 and the command will be "done" then the next command will activate.

When we need the robot to turn (TurnToHeading), that's when we use a really simple PID for rotating the robot. When the distance to the desired angle was < 25 degrees we started slowing it down. Of course, this uses a gyro.

I think we'll stick with a completely command based auton again next year but with some more PID factored in. Also, our auton never worked on the scale, got really close a few times but we had the most success on center switch and side switch.
Reply With Quote
  #3   Spotlight this post!  
Unread 08-08-2018, 08:02 AM
edf42001 edf42001 is offline
Registered User
FRC #1712 (DAWGMA)
 
Join Date: Dec 2016
Rookie Year: 2016
Location: Philadelphia, PA
Posts: 9
edf42001 will become famous soon enough
Re: Path Following - in English

Our team uses the pure pursuit algorithm. We define a path as a series of closely spaced XY points. Each point in the path has a target speed, which have been calculated to follow a smooth acceleration/deceleration curve.

We use the encoders and gyro to get the robot's XY location. Then we find the intersection point of the circle around the robot (radius = 20") and the path, and calculate the curvature of the arc the robot would need to drive along to get to that intersection point. Using this curvature and the target speed of the closest waypoint, we calculate the necessary left and right wheel speeds to make the robot travel along the arc, and use PID + FeedForward to make the wheels go that speed. So our algorithm also has a bubble around the robot with the robot trying to pursue the bubble-path intersection point!

We'll be releasing a whitepaper on this soon
__________________
Autonomous Enabling... Dang it!
Reply With Quote
  #4   Spotlight this post!  
Unread 08-08-2018, 08:35 AM
rlance's Avatar
rlance rlance is offline
Registered User
FRC #5550
 
Join Date: Dec 2015
Location: Bethany, OK
Posts: 148
rlance has a reputation beyond reputerlance has a reputation beyond reputerlance has a reputation beyond reputerlance has a reputation beyond reputerlance has a reputation beyond reputerlance has a reputation beyond reputerlance has a reputation beyond reputerlance has a reputation beyond reputerlance has a reputation beyond reputerlance has a reputation beyond reputerlance has a reputation beyond repute
Re: Path Following - in English

Quote:
Originally Posted by edf42001 View Post
We use the encoders and gyro to get the robot's XY location.
Quote:
Originally Posted by hshively View Post
We get our current location using encoders
Are you using a follower wheel with an encoder for this, or are you using an encoder attached to the gearbox for this. I was getting ready to add a follower wheel to our robot since I have been unsuccessful in getting accurate results reading the encoder attached to the gearbox. I'm assuming wheel slippage and skidding is the issue.
Reply With Quote
  #5   Spotlight this post!  
Unread 08-08-2018, 10:14 AM
edf42001 edf42001 is offline
Registered User
FRC #1712 (DAWGMA)
 
Join Date: Dec 2016
Rookie Year: 2016
Location: Philadelphia, PA
Posts: 9
edf42001 will become famous soon enough
Re: Path Following - in English

Quote:
Are you using a follower wheel with an encoder for this, or are you using an encoder attached to the gearbox for this.
We use one grayhill encoder on each side of our drivetrain. We attach them directly to the wheel axles using 3D printed mounts in order to directly measure what we care about (the rotation of the wheels). We have gotten accurate and reliable measurements by polling both encoders and our navX gyro at 50 Hz. We use Colson wheels and don't notice many issues with slipping.
__________________
Autonomous Enabling... Dang it!
Reply With Quote
  #6   Spotlight this post!  
Unread 08-08-2018, 02:03 PM
samthesnake's Avatar
samthesnake samthesnake is offline
SamD4256
AKA: Sam Dare
no team
Team Role: CAD
 
Join Date: Apr 2015
Rookie Year: 2015
Location: St. Louis, Mo
Posts: 236
samthesnake has much to be proud ofsamthesnake has much to be proud ofsamthesnake has much to be proud ofsamthesnake has much to be proud ofsamthesnake has much to be proud ofsamthesnake has much to be proud ofsamthesnake has much to be proud ofsamthesnake has much to be proud ofsamthesnake has much to be proud ofsamthesnake has much to be proud of
Re: Path Following - in English

Quote:
Originally Posted by rlance View Post
Are you using a follower wheel with an encoder for this, or are you using an encoder attached to the gearbox for this. I was getting ready to add a follower wheel to our robot since I have been unsuccessful in getting accurate results reading the encoder attached to the gearbox. I'm assuming wheel slippage and skidding is the issue.
OPís Mechanical partner in crime here - We used an Armabot RS7 775 Pro encoder this year, and we are not planning on a follower wheel in the future. We may switch to a CIMcoder in future swerves.
__________________
"Perfection is not attainable, but if we chase perfection we can catch excellence." - Vince Lombardi

2015 - 2018 FRC Team 4256, Cyborg Cats
CAD and Strategy lead, drive coach
Reply With Quote
  #7   Spotlight this post!  
Unread 08-08-2018, 02:28 PM
Jared Russell's Avatar
Jared Russell Jared Russell is offline
4933T15
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,550
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: Path Following - in English

Quote:
Originally Posted by edf42001 View Post
Our team uses the pure pursuit algorithm.
Any time a team asks me for a path following algorithm, I suggest some variation on pure pursuit. It doesn't get much more intuitive than "pick a spot ahead on the path and aim for it".

It is implementable by high school students with solid geometry backgrounds, fast, doesn't have any requirements on the smoothness or feasibility of the desired path, and has only a single parameter to tune. Yeah, it cuts corners, isn't point-stable, suffers at really high speeds, and needs to be combined with some sort of strategy for generating speed setpoints, but I think it hits the sweet spot in terms of effort vs. reward for most teams.
Reply With Quote
  #8   Spotlight this post!  
Unread 08-08-2018, 02:57 PM
tjf tjf is offline
Registered User
AKA: Tim Flynn
FRC #1257 (Parallel Universe), #1228 (RoboTribe)
Team Role: Mentor
 
Join Date: Jun 2016
Rookie Year: 2016
Location: Union County
Posts: 404
tjf has a reputation beyond reputetjf has a reputation beyond reputetjf has a reputation beyond reputetjf has a reputation beyond reputetjf has a reputation beyond reputetjf has a reputation beyond reputetjf has a reputation beyond reputetjf has a reputation beyond reputetjf has a reputation beyond reputetjf has a reputation beyond reputetjf has a reputation beyond repute
Re: Path Following - in English

Quote:
Originally Posted by samthesnake View Post
OPís Mechanical partner in crime here - We used an Armabot RS7 775 Pro encoder this year, and we are not planning on a follower wheel in the future. We may switch to a CIMcoder in future swerves.
I HIGHLY suggest not using a CIMcoder. Their overall resolution is far lower than anything I'd suggest using in FRC.

The listed "2 channel quadrature output with 20 pulses per channel per revolution for sensing speed and direction." is magnitudes less precise than a SRX mag encoder, or a greyhill encoder.
__________________

1257 (2016) - Student
1257 (2017-Present) - Overactive Alumnus | 1228 (2017-Present) - I do stuff
KD2KRT
Reply With Quote
  #9   Spotlight this post!  
Unread 08-08-2018, 03:08 PM
samthesnake's Avatar
samthesnake samthesnake is offline
SamD4256
AKA: Sam Dare
no team
Team Role: CAD
 
Join Date: Apr 2015
Rookie Year: 2015
Location: St. Louis, Mo
Posts: 236
samthesnake has much to be proud ofsamthesnake has much to be proud ofsamthesnake has much to be proud ofsamthesnake has much to be proud ofsamthesnake has much to be proud ofsamthesnake has much to be proud ofsamthesnake has much to be proud ofsamthesnake has much to be proud ofsamthesnake has much to be proud ofsamthesnake has much to be proud of
Re: Path Following - in English

Quote:
Originally Posted by tjf View Post
I HIGHLY suggest not using a CIMcoder. Their overall resolution is far lower than anything I'd suggest using in FRC.

The listed "2 channel quadrature output with 20 pulses per channel per revolution for sensing speed and direction." is magnitudes less precise than a SRX mag encoder, or a greyhill encoder.
Noted, thank you for that.
__________________
"Perfection is not attainable, but if we chase perfection we can catch excellence." - Vince Lombardi

2015 - 2018 FRC Team 4256, Cyborg Cats
CAD and Strategy lead, drive coach
Reply With Quote
  #10   Spotlight this post!  
Unread 08-08-2018, 03:28 PM
AlexanderTheOK AlexanderTheOK is offline
Guy
no team
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Los Angeles
Posts: 210
AlexanderTheOK has a reputation beyond reputeAlexanderTheOK has a reputation beyond reputeAlexanderTheOK has a reputation beyond reputeAlexanderTheOK has a reputation beyond reputeAlexanderTheOK has a reputation beyond reputeAlexanderTheOK has a reputation beyond reputeAlexanderTheOK has a reputation beyond reputeAlexanderTheOK has a reputation beyond reputeAlexanderTheOK has a reputation beyond reputeAlexanderTheOK has a reputation beyond reputeAlexanderTheOK has a reputation beyond repute
Re: Path Following - in English

Quote:
Originally Posted by tjf View Post
I HIGHLY suggest not using a CIMcoder. Their overall resolution is far lower than anything I'd suggest using in FRC.

The listed "2 channel quadrature output with 20 pulses per channel per revolution for sensing speed and direction." is magnitudes less precise than a SRX mag encoder, or a greyhill encoder.
Note that because these are mounted to the motor, you're really getting between 200 and 300 counts per wheel rotation depending on how you gear it. Still worse than the mag encoder as far as resolution goes (as both are rated above 5krpm) but adequate for drivetrain applications.

With the pricing being nearly identical though, I don't see why you wouldn't go with the mag encoder and a gearbox that fits it.

Just making sure people don't take their wheel OD, divide by 20, and decide the cimcoder is unusable.
Reply With Quote
  #11   Spotlight this post!  
Unread 08-08-2018, 03:47 PM
Lil' Lavery Lil' Lavery is offline
Hungry Dawgs Run Faster
AKA: Sean Lavery
FRC #1712 (DAWGMA)
Team Role: Mentor
 
Join Date: Nov 2003
Rookie Year: 2003
Location: Philadelphia, PA
Posts: 7,661
Lil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond repute
Send a message via AIM to Lil' Lavery
Re: Path Following - in English

Quote:
Originally Posted by tjf View Post
I HIGHLY suggest not using a CIMcoder. Their overall resolution is far lower than anything I'd suggest using in FRC.

The listed "2 channel quadrature output with 20 pulses per channel per revolution for sensing speed and direction." is magnitudes less precise than a SRX mag encoder, or a greyhill encoder.
Consider the position of the CIMcoder relative to the reduction available. Generally speaking, your mounting an SRX mag encoder or greyhill encoder AFTER most or all of your gear reduction. You're mounting a CIMcoder BEFORE that gear reduction. While you only get 20 counts per revolution of the CIM, you get significantly more counts per revolution of wheel (roughly 5-20 times more, depending on your gear ratio).

That being said, you'd also be dealing with increased backlash and other issues by attempting to measure motor rotations instead of the rotations of an axle the wheel is mounted on.
__________________
Being correct doesn't mean you don't have to explain yourself.
Reply With Quote
  #12   Spotlight this post!  
Unread 08-08-2018, 03:51 PM
Dave Hurt's Avatar
Dave Hurt Dave Hurt is offline
Mostly Harmless
FRC #6413 (Degrees of Freedom)
Team Role: Mentor
 
Join Date: Aug 2001
Rookie Year: 1999
Location: Chandler, AZ
Posts: 134
Dave Hurt is on a distinguished road
Re: Path Following - in English

Quote:
Originally Posted by Jared Russell View Post
Any time a team asks me for a path following algorithm, I suggest some variation on pure pursuit. It doesn't get much more intuitive than "pick a spot ahead on the path and aim for it".

It is implementable by high school students with solid geometry backgrounds, fast, doesn't have any requirements on the smoothness or feasibility of the desired path, and has only a single parameter to tune. Yeah, it cuts corners, isn't point-stable, suffers at really high speeds, and needs to be combined with some sort of strategy for generating speed setpoints, but I think it hits the sweet spot in terms of effort vs. reward for most teams.
Is there any good reading or good information you can recommend on how to implement something like this?
Reply With Quote
  #13   Spotlight this post!  
Unread 08-08-2018, 04:20 PM
asid61's Avatar
asid61 asid61 is offline
Design Simple
AKA: Anand Rajamani
FRC #1072 (Harker Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Cupertino, CA
Posts: 3,056
asid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond repute
Re: Path Following - in English

Quote:
Originally Posted by tjf View Post
I HIGHLY suggest not using a CIMcoder. Their overall resolution is far lower than anything I'd suggest using in FRC.

The listed "2 channel quadrature output with 20 pulses per channel per revolution for sensing speed and direction." is magnitudes less precise than a SRX mag encoder, or a greyhill encoder.
Independent of the resolution (which as others have said depends on gear ratio), Andymark CIMcoders are among the least reliable encoders out there. After having 2 die on us for seemingly no reason in 2017, I convinced the team to switch to SRX Mag encoders. Since then we've had no failures.
__________________
Team 1072 2017-present
Team 299 2017
Team 115 2013-2016 (student)

2018 Davis Finalists (w/ 6474 and 3880), 2018 Roebling Winners (w/ 3476, 1323, and 1778)

Reply With Quote
  #14   Spotlight this post!  
Unread 08-08-2018, 09:36 PM
Jared Russell's Avatar
Jared Russell Jared Russell is offline
4933T15
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,550
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: Path Following - in English

Quote:
Originally Posted by Dave Hurt View Post
Is there any good reading or good information you can recommend on how to implement something like this?
The papers about pure pursuit are pretty understandable.

https://www.ri.cmu.edu/pub_files/pub...aig_1992_1.pdf

https://www.ri.cmu.edu/pub_files/pub...nzo_1994_4.pdf

Also, this video is pretty good.

Here's our 2017 pure pursuit code.
Reply With Quote
  #15   Spotlight this post!  
Unread 08-09-2018, 11:27 AM
Prateek M's Avatar
Prateek M Prateek M is offline
Kotlin Master Race
FRC #5190 (Green Hope Falcons)
Team Role: Programmer
 
Join Date: May 2018
Rookie Year: 2018
Location: Cary, North Carolina
Posts: 37
Prateek M is on a distinguished road
Re: Path Following - in English

Quote:
Originally Posted by Jared Russell View Post
Any time a team asks me for a path following algorithm, I suggest some variation on pure pursuit.
What did you think of the behavior of the non-linear feedback controller this year? Would you recommend this controller?
Reply With Quote
Reply


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:50 AM.

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


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