Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

67 feature implement pure pursuit controller #132

Merged
merged 28 commits into from
Jan 31, 2023

Conversation

schwalga
Copy link
Contributor

@schwalga schwalga commented Jan 8, 2023

Description

This PR implements the pure pursuit controller. The first tests suggest, that it is working as intended, however due to problems with the GPS signal the car is not able to hold course at the moment.

While i tried fixing the problem at first under this issue, after a few hours of trial and error I realise, that this warrants a seperate issue. The documentation added in this PR gives a first overview over the problem it will be amended with the final filter in #131. For now I have left the simple filter added to DummyTrajectorySub.py so that the controller can be tested by a reviewer.

Fixes #67

Time invested

Type of change

  • New feature (non-breaking change which adds functionality)

Does this PR introduce a breaking change?

  • No

Most important changes

The most important file is pure_pursuit_controller.py

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works (might be obsolete with CI later on)
  • New and existing unit tests pass locally with my changes (might be obsolete with CI later on)

@schwalga schwalga linked an issue Jan 8, 2023 that may be closed by this pull request
Copy link
Contributor

@JoKircher JoKircher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice new functionality for the action portion of the agent.

Unfortunately, due to an issue with the docker container. I couldn't test the controller so far. There are still quite some todos so the PR is blocked for now.

If you have any questions please let me know!

One last note:

The localization you implemented will probably need at different corners of the project, so a refactor to a more centralized spot might be a good idea in the future.

Review time: 1,5 hours

code/acting/src/acting/DummyTrajectorySub.py Show resolved Hide resolved
code/acting/src/acting/DummyTrajectorySub.py Outdated Show resolved Hide resolved
code/acting/src/acting/DummyTrajectorySub.py Outdated Show resolved Hide resolved
code/acting/src/acting/helper_functions.py Outdated Show resolved Hide resolved
code/acting/src/acting/helper_functions.py Outdated Show resolved Hide resolved
code/acting/src/acting/pure_pursuit_controller.py Outdated Show resolved Hide resolved
code/acting/src/acting/pure_pursuit_controller.py Outdated Show resolved Hide resolved
code/acting/src/acting/pure_pursuit_controller.py Outdated Show resolved Hide resolved
code/acting/src/acting/pure_pursuit_controller.py Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Jan 9, 2023

Simulation results

Metric Value
Avg. driving score 0.069615
Avg. route completion 0.255
Avg. infraction penalty 0.273
Collisions with pedestrians 0.0
Collisions with vehicles 54.151
Collisions with layout 54.151
Red lights infractions 0.0
Stop sign infractions 0.0
Off-road infractions 0
Route deviations 0.0
Route timeouts 54.151
Agent blocked 0.0
Yield emergency vehicles infractions 0.0
Scenario timeouts 54.151
Min speed infractions 0.0

@schwalga
Copy link
Contributor Author

schwalga commented Jan 9, 2023

I'm not sure how changing the md document managed to break the build?
Apart from that, I fixed all the issues mentioned in the review (ca. $1 \frac{1}{2}$ h by @schwalga)

@JoKircher
Copy link
Contributor

For some reason, the leaderboard evaluation failed. Maybe just rerunning the tests should suffice otherwise @nylser might be of help.

@nylser
Copy link
Contributor

nylser commented Jan 10, 2023

For some reason, the leaderboard evaluation failed. Maybe just rerunning the tests should suffice otherwise @nylser might be of help.
Looks like this might be an issue because I didn't get to switching it to the right machine yet? VK_DEVICE_LOST is the error code, which might hint to the GPU already being used differently

Copy link
Contributor

@JoKircher JoKircher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, all of the suggested changes have been incorporated. However, for now the ego vehicle drives to the right side of the road and hit a parking clock. I guess that is related to the GPS problem?

…ctory.

Added one more publisher for debugging.
@github-actions
Copy link

Simulation results

Metric Value
Avg. driving score 0.0588
Avg. route completion 0.175
Avg. infraction penalty 0.3465
Collisions with pedestrians 0.0
Collisions with vehicles 76.358
Collisions with layout 38.179
Red lights infractions 0.0
Stop sign infractions 0.0
Off-road infractions 0
Route deviations 0.0
Route timeouts 76.358
Agent blocked 0.0
Yield emergency vehicles infractions 0.0
Scenario timeouts 76.358
Min speed infractions 0.0

@schwalga
Copy link
Contributor Author

schwalga commented Jan 10, 2023

As suggested I have set the GPS noise to 0 for the time being.
I found/fixed another issue, where points in the trajectory would be targeted even though they had already been reached.
At the moment the car is capable of following the trajectory defined in DummyTrajectoryPub.py.
Since some more problems have come to light, I think this PR is not ready to be merged.
2h @schwalga

@schwalga
Copy link
Contributor Author

schwalga commented Jan 23, 2023

Fixed a few errors, tested some more parameters, and added a PID controller for the steering angle.
I think this PR should be merged in this sprint so that others can test their features.

~ 6h by @schwalga

@github-actions
Copy link

Simulation results

Metric Value
Avg. driving score 0.06006
Avg. route completion 0.22
Avg. infraction penalty 0.273
Collisions with pedestrians 0.0
Collisions with vehicles 62.046
Collisions with layout 62.046
Red lights infractions 0.0
Stop sign infractions 0.0
Off-road infractions 0
Route deviations 0.0
Route timeouts 62.046
Agent blocked 0.0
Yield emergency vehicles infractions 0.0
Scenario timeouts 62.046
Min speed infractions 0.0

@github-actions
Copy link

Simulation results

Metric Value
Avg. driving score 0.0
Avg. route completion 0.0
Avg. infraction penalty 0.7
Collisions with pedestrians 0.0
Collisions with vehicles 0.0
Collisions with layout 0.0
Red lights infractions 0.0
Stop sign infractions 0.0
Off-road infractions 0
Route deviations 0.0
Route timeouts 2000.0
Agent blocked 0.0
Yield emergency vehicles infractions 0.0
Scenario timeouts 2000.0
Min speed infractions 0.0

Julian-Graf added a commit that referenced this pull request Jan 25, 2023
* feat(#131): Added dedicated node for the publishing of the current position

* feat(#131): Moved the publishing from DummySub to PositionPublisher

* feat(#131): Added dedicated node for the publishing of the current position

* feat(#131): Move PositionPublisher to perception

* feat(#131): Added publishing of heading

* feat(#131): Install and launch robot-pose-ekf

* feat(#131): Fix install robot-pose-ekf

* feat(#132): Started adding translation node for the EKF

* fix(#131): Got EKF to work. Values for covariance need tweaking

* feat(#131): Move installation in dockerfile

* feat(#131): Adapt PositionPublisher to use filtered values

* fix(#131): Added an average filter to the gps signal to improve the ekf

* fix(#131): minor fix to rerun CI

* fix(#131): fixed imu orientation, fixed gps quaternion

* feat(#131): Delete unnecessary comment

Co-authored-by: schwalga <[email protected]>
Co-authored-by: Julian-Graf <[email protected]>
Co-authored-by: Julian Graf <[email protected]>
@schwalga
Copy link
Contributor Author

schwalga commented Jan 27, 2023

During testing with a more complex trajectory, a few errors appeared, which have now been fixed.
To test, simply enter b5 install and then b5 run, and the car will take the first turn :).
I would maybe clean up the code in a few places, but in my eyes the PR is ready for merging.

I also added a custom message that useful for #151

~ 4h by @schwalga

Copy link
Contributor

@JoKircher JoKircher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice PR, the pure pursuit controller seems to work nicely. One last question before I approve the PR. Is is intended to cut the corner at the left turn and drive in the middle of the two lanes afterwards?

Review time: 30 min

@JoKircher
Copy link
Contributor

Also could you please resolve the merge conflicts?

Copy link
Contributor

@JoKircher JoKircher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Happily approve! Still some conflicts though

# Conflicts:
#	code/acting/launch/acting.launch
@github-actions
Copy link

Simulation results

Metric Value
Avg. driving score 0.0
Avg. route completion 0.0
Avg. infraction penalty 0.7
Collisions with pedestrians 0.0
Collisions with vehicles 0.0
Collisions with layout 0.0
Red lights infractions 0.0
Stop sign infractions 0.0
Off-road infractions 0
Route deviations 0.0
Route timeouts 2000.0
Agent blocked 0.0
Yield emergency vehicles infractions 0.0
Scenario timeouts 2000.0
Min speed infractions 0.0

@schwalga schwalga merged commit 0d1aecb into main Jan 31, 2023
@schwalga schwalga deleted the 67-feature-implement-pure-pursuit-controller branch January 31, 2023 17:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Implement Pure Pursuit Controller
4 participants