Skip to content

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'])

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