OCCRA
Go to Post You will find friends among all FIRST students who will become very good friends of yours, will care and help you with anything that you need help with. This is my personal opinion, If you are hooked, dont ever let it go. - Arefin Bari [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media  
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-02-2018, 11:54 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
Team 4256 2018 Code Release

Team 4256 is proud to release our 2018 robot code:
https://github.com/Team4256/4256-18-Faraday


Features:
  • some code comments
  • path definition using cubic splines
  • path definition using single argument lambda expressions to characterize any mathematical function (can be piecewise)
  • discretized path following with targets updated based on current location, not time
  • location based triggering of any lambda function
  • simplified classes for autonomous strategy definition
  • drivetrain, subsystem, and odometer interfaces to make autonomous compatible with any robot
  • odometer implementation for a single swerve encoder
  • odometer implementation for visual odometry from a ZED+TX2 running Stereolabs' Python wrapper and a custom HTTP server

And no, we don't have a Kalman filter I'm our only autonomous + vision programmer and this was our first year using any of this stuff, so I didn't have time. Advice on how to implement one is welcome, as are questions!
Reply With Quote
  #2   Spotlight this post!  
Unread 08-03-2018, 12:05 PM
gerthworm's Avatar
gerthworm gerthworm is offline
Making the 1's and 0's
FRC #1736 (Robot Casserole)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Peoria, IL
Posts: 706
gerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond reputegerthworm has a reputation beyond repute
Re: Team 4256 2018 Code Release

Awesome stuff, this is super clean and well laid-out!

Any details on the Zed visual odometry? A few teams around the area were interested in trying it out.
Reply With Quote
  #3   Spotlight this post!  
Unread 08-03-2018, 06:15 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
Re: Team 4256 2018 Code Release

Thanks! The ZED code can be found here. Though it's not as organized as the robot code, we spent a lot of time on it. As much as I would like to say that paid off, our autonomous looked like a mess as soon as other moving robots entered the picture (it was fine on our practice field). This is why we switched to an encoder for the Missouri state competition, at which point everything started working beautifully.
Reply With Quote
  #4   Spotlight this post!  
Unread 08-03-2018, 09:30 PM
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: 41
Prateek M is on a distinguished road
Re: Team 4256 2018 Code Release

Quote:
Originally Posted by hshively View Post
Thanks! The ZED code can be found here. Though it's not as organized as the robot code, we spent a lot of time on it. As much as I would like to say that paid off, our autonomous looked like a mess as soon as other moving robots entered the picture (it was fine on our practice field). This is why we switched to an encoder for the Missouri state competition, at which point everything started working beautifully.
Would you say your visual odometry on the practice field was as accurate as encoder/gyro odometry? We're looking at other options for odometry due to rumors of rough terrain in which case it would be very hard to use encoders and a gyro. Our encoders/gyro odometry right now is pretty accurate (~2") for the first 15 seconds.
Reply With Quote
  #5   Spotlight this post!  
Unread 08-03-2018, 10:51 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
Re: Team 4256 2018 Code Release

In our testing, as long as the ZED didn't rotate, it only got off by around 1in every 20ft. Rotation of the ZED, other moving objects, reflections from lexan, and lack of nearby objects all contribute to decreased accuracy. In (relatively) ideal conditions on our practice field, it performed as well or better than the encoder. One benefit of the ZED is that if it returns to a previous location, it can sort of auto-correct for any accumulated error.

I should also mention latency. I don't have exact numbers, but I do know our robot tended to (slightly) spiral into its target position when using visual odometry. This happened because our PID always had to base motor outputs on old data. This could probably be fixed with filtering algorithms/using C++ rather than Python for ZED code.
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 11:46 AM.

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


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