fix: bad controller build

This commit is contained in:
Cyrille Nofficial 2022-05-19 16:42:53 +02:00
parent 2ccb70c020
commit d7b7ef91ed

View File

@ -115,12 +115,14 @@ def execute_from_command_line():
if args["steering"]:
steering_pin = donkeycar.parts.pins.pwm_pin_by_id(pin_id)
steering = actuator.PWMSteering(steering_pin, left_pulse=args["--left-pulse"], right_pulse=args["--right-pulse"])
controller = actuator.PulseController(steering_pin)
steering = actuator.PWMSteering(controller=controller, left_pulse=args["--left-pulse"], right_pulse=args["--right-pulse"])
client = init_mqtt_steering_client(steering_controller=steering, broker_host=broker_host, user=user,
password=password, client_id=client_id, steering_topic=topic)
elif args["throttle"]:
throttle_pin = donkeycar.parts.pins.pwm_pin_by_id("PCA9685.0:40.7")
throttle = actuator.PWMThrottle(throttle_pin, max_pulse=args["--max-pulse"], min_pulse=args["--min-pulse"],
controller = actuator.PulseController(throttle_pin)
throttle = actuator.PWMThrottle(controller=controller, max_pulse=args["--max-pulse"], min_pulse=args["--min-pulse"],
zero_pulse=args["--zero-pulse"])
client = init_mqtt_throttle_client(throttle_controller=throttle, broker_host=broker_host, user=user,
password=password, client_id=client_id, throttle_topic=topic)