-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support velocity target on a waypoint in path_follow
#1068
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Evan, thanks for doing this, this is very valuable work. I still have to go through the PR in more depth, but I have a higher level comment that you could tackle pretty easily. The code implements a variable throttle; it records the throttle value at each waypoint. The running code uses the throttle of the closest waypoint. That is all very good. The issue is the naming; in the code it is referred to as velocity, but it is actually throttle. I think we might want to implement true velocity control in a future update (where we try to match a velocity in meters/second), so I'd rather not use that term here.
Great point! I just updated the naming conventions in the code. |
@evanphilipsmith the code looks good; just a small amount of code to add a nice capability; very good. My question now; has this been tested; do you have a video of this working; it would be nice once we get this merged to have a video to show to the community when we announce the feature. |
@TCIII would you be able to give this a test? |
@evanphilipsmith can you add unit tests. You can clone most of them from https://github.com/evanphilipsmith/donkeycar/blob/8a6cbd6da2e2c8a56ebccedcb0b1323c9908aae5/donkeycar/tests/test_path.py#L8 |
Yes. I assume that you will create a branch for testing purposes? TCIII |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me in general, but the pytorch tests are failing, it doesn't look like it's related to your change. Will have to take a look.
We use Evan's branch on his repo. So clone his repo and checkout that branch and do an install of donkey. |
@evanphilipsmith, I believe that I have identified an issue with the "Support velocity target on a waypoint in I have uncovered a conundrum: To get accurate GPS coordinates during path recording the user needs to go slow especially when the data rate for the GPS is set at 5 Hz like mine is. On the other hand I have gone fast on the straightaways during path recording and it did not seem to make a whole lot of difference in the path tracking performance during path playback. TCIII |
I don't think this is an issue with the code; it is an issue for slowly updating GPS receivers. It inevitable that GPS receivers that have slow updates will end up with larger distances between waypoints the faster the car travels. As you say, the driver will slow down for turns so the turn should have more waypoints per unit distance. Theoretically a straight needs only two points to define it. I think we are not trying to make a slowly updating GPS perform like a better GPS in this PR. The driver needs to stay within what the GPS receiver and CTE algorithm can handle. However, you do bring up an issue that could be an problem, but I think it is actually a bigger issue for curves than straights. The CTE algorithm 'draws' lines between waypoints; that can cause oversteering because it cuts the curve; we might want to look at fitting curves to the waypoints and interpolate more waypoints to avoid this issue. That would come in another PR if we feel we want/need it. |
@evanphilipsmith During real world testing @TCIII found that we may end up recording a target velocity zero or near zero, especially at the start or end of recording the path. This is particularly bad at the start as it causes the vehicle to stall at the start and make no progress. I can see a possible solution; create a configuration for minimum autopilot throttle and make sure we enforce this during autopilot. @TCIII will add a comment that includes the path he recording that shows the issue. |
@evanphilipsmith, There was a throttle issue with evan's path_follow template code. Regards, |
@evanphilipsmith, Since It would be nice to be able to superimpose the GPS coordinates on a sky view map of the recorded course and be able to edit the throttle values based on where the car is on the course at any given instant. Nice work Evan. This is going to give Chrisa heartburn Ezward. TCIII |
8a6cbd6
to
894a744
Compare
@evanphilipsmith, we would like to merge your PR, could you please address the couple of small comments, mainly the unit test and I had a few small suggestions on the code. It would be great, if you could also bump the version (patch+=1). I have also re-based the branch, because we sorted the failing pytorch tests in the meantime. |
Thank you all for your review. Sorry for the radio silence on my part this last week, I was out of town. I will gladly implement the changes requested over the next few days and request another review. |
@evanphilipsmith Hi, I hope you had a good break. Have you been able to get back to this? #1068 (comment) |
…ith/donkeycar into path-follow-velocity-target
Hi, thanks for being patient with me. After a nice long holiday break I have finally gotten around to implementing the changes requested. Here's a brief summary of my recent changes:
I have re-requested your review and look forward to your comments. |
@evanphilipsmith will you be at the Feb 25th race at UCSD? I will not be able to make it; I hope you have a chance to use this feature you have created. |
@Ezward I am interested in attending the race, but I'll have to see if there is a spare RC car I can borrow from the lab since last fall I was borrowing the hardware as part of the course. I updated the code to enforce a minimum throttle during autopilot instead of during recording. Let me know if you see any more issues. |
@evanphilipsmith thanks, @TCIII will give this change a test. |
@evanphilipsmith, I just downloaded and installed your TCIII |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a runtime error; see comment on line 214 of path_follow.py
@TCIII edited his manage.py line 214 to remove the runtime error and tested the branch outside. It worked really well. So once we get that fixed, then I can approve and we can merge. |
Ok, I pushed up the change. Does it look right now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even, thanks for creating this great feature. Tom has been testing and if very excited by the results. I will merge the PR and then update the docs.
@DocGarbanzo I see that one of the required checks failed. I'm not sure if it is related to my changes or, if like last time the checks failed, it is unrelated. Do you have any tips for how to fix the issue? |
@evanphilipsmith - this has nothing to do w/ your PR. We are also seeing this with other commits. It seems to be cause by some dpendency conflicts between mamba and other packages on ubuntu only. It seems to work fine in OSX. I'll have to have a separate look at this. Will merge your PR. |
Added support for variable throttle in
path_follow
by modifying the waypoint data structure to record the throttle at each waypoint. The feature may be turned off by settingUSE_CONSTANT_THROTTLE = True
in yourmyconfig.py
(the flag is set toFalse
by default).Closes #1047.