|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
|||
|
|||
|
Swerve path and motor trajectory generator?
Does a path planner exist for swerve given way points x y and heading?
|
|
#2
|
|||||
|
|||||
|
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. |
|
#3
|
||||
|
||||
|
Re: Swerve path and motor trajectory generator?
Quote:
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
Re: Swerve path and motor trajectory generator?
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 |
|
#7
|
|||
|
|||
|
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
|
|||
|
|||
|
Re: Swerve path and motor trajectory generator?
Quote:
|
|
#9
|
||||
|
||||
|
Re: Swerve path and motor trajectory generator?
Quote:
|
|
#10
|
|||
|
|||
|
Re: Swerve path and motor trajectory generator?
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
|
|||||
|
|||||
|
Re: Swerve path and motor trajectory generator?
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
|
||||
|
||||
|
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. Last edited by faust1706 : 24-05-2015 at 03:21. Reason: words |
|
#13
|
|||
|
|||
|
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
|
||||
|
||||
|
Re: Swerve path and motor trajectory generator?
How do I run a simulation using the code on my laptop like the video above?
|
|
#15
|
||||
|
||||
|
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. Last edited by faust1706 : 26-05-2015 at 12:07. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|