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

added SunFounder actuator #887

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

Conversation

blaughlin
Copy link

Added actuator for SunFounder car kit. https://youtu.be/lvZDpLVAIQY

self.bw.speed = speed
elif speed < 0:
self.bw.backward()
self.bw.speed = speed * -1
Copy link
Contributor

Choose a reason for hiding this comment

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

- speed avoids an unnecessary multiplication.

def __init__(self):
import picar
from picar import back_wheels
print('Set up back_wheels')
Copy link
Contributor

Choose a reason for hiding this comment

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

We moved from print -> logging.

@DocGarbanzo
Copy link
Contributor

Hi @blaughlin - your code can't be merged, you have to rebase first.

changed print to logging
logger.info('Set up back_wheels')
picar.setup()
# place path to your car's config file below
db_file = "/home/pi/SunFounder_PiCar-V/remote_control/remote_control/driver/config"
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be passed as an argument, and then we should have two config parameters in cfg_complete.py:

SUNFOUNDER = False
SUNFOUNDER_RC_CFG_PATH = "/home/pi/SunFounder_PiCar-V/remote_control/remote_control/driver/config"

Add an entry in complete.py which does what you wrote in the comment above, i.e. change the throttle controller to your new part. Then it should work for the SunFounder car without tweaking any code, just an update of the myconfig.py file.

You should probably also write a comment in the class how to install the picar package.

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.

None yet

2 participants