Skip to content
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

Add AiCatapult - an improved version of AiLauncher which also controls steering angle #934

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

altexdim
Copy link

Add AiCatapult - an improved version of AiLauncher which also controls steering angle

Comparing to AiLaunch this particular class also controls the angle.

To be able to use it you need to change /manage.py:

old one

from donkeycar.parts.launch import AiLauncher

aiLauncher = AiLauncher(cfg.AI_LAUNCH_DURATION, cfg.AI_LAUNCH_THROTTLE, cfg.AI_LAUNCH_KEEP_ENABLED)
V.add(aiLauncher,
      inputs=['user/mode', 'throttle'],
      outputs=['throttle'])

new one

from donkeycar.parts.launch import AiCatapult

aiLauncher = AiCatapult(cfg.AI_LAUNCH_DURATION, cfg.AI_LAUNCH_THROTTLE, cfg.AI_LAUNCH_KEEP_ENABLED)
V.add(aiLauncher,
      inputs=['user/mode', 'throttle', 'angle'],
      outputs=['throttle', 'angle'])

@@ -46,3 +48,73 @@ def run(self, mode, ai_throttle):

return new_throttle


class AiCatapult():
Copy link
Contributor

Choose a reason for hiding this comment

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

This class is effectively just a copy of the above class with a very small change to return 0 angle in launch mode. We should probably drive this with a single bool switch in the AiLaunch class above. Also the () should go. Then we should add a config parameter in cfg_complete.py that can trigger the 0 angle behaviour and pass this in complete.py

@DocGarbanzo
Copy link
Contributor

@altexdim - do you want to have a look at the above code review and make the corresponding changes?

@altexdim
Copy link
Author

Yes, absolutely, thank you for the review, I'll fix it as I find some time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants