Open LegendaryGene opened 1 month ago
I noticed the same, running the Simulation Control script (driving forward for 3 seconds) didn't move the car, while turning did indeed turn the wheels.
# control the car
car_controls = airgen.CarControls()
car_controls.throttle=0.5
car_controls.steering=0.0
airgen_car_0.client.setCarControls(car_controls)
print("Going forward...")
time.sleep(3) # Let car drive a bit
print("Stopping...")
airgen_car_0.client.setCarControls(car_controls)
@erwincoumans AirGen wheeled robots have speed controls enabled by default, which works with the function setCarTargetSpeed()
(and ignores throttle inputs from setCarControls()
). In order to work with CarControls, you will need to run enableCarSpeedControl(False)
first. Thanks for pointing this out - the Car Control sample notebook needs an update!
The right way to do move forward and stop using CarControls() would be
airgen_car_0.client.enableCarSpeedControl(False)
# control the car
car_controls = airgen.CarControls()
car_controls.throttle=0.5
car_controls.steering=0.0
airgen_car_0.client.setCarControls(car_controls)
print("Going forward...")
time.sleep(3) # Let car drive a bit
print("Stopping...")
car_controls.throttle=0.0
airgen_car_0.client.setCarControls(car_controls)
Describe the bug The throttle and brake are not updated, while the car controls are set using the setCarControls() API. The other parameters, like steering and handbrake, are working and do get updated.
To Reproduce Steps to reproduce the behavior:
Expected behavior Using the code above, I expect the car to move ahead full throttle while making a hard left for 5 seconds before stopping.
Metadata