Neobotics Foundation Inc.
These docs are public and open source.Edit on GitHub

RC.DRIVE

The drive module controls the wheel speed and steering angle of the car.

METHODS

rc.drive.set_speed_angle(speed: float, angle: float)returns None

Sets the wheel speed and the front-wheel steering angle for this frame. Both are in [-1.0, 1.0]: 1.0 is full forward or full right, -1.0 is full reverse or full left.

rc.drive.stop()returns None

Halts the car and returns the front wheels to centre. The same as set_speed_angle(0, 0).

rc.drive.set_max_speed(max_speed: float = 1.0)returns None

Sets the maximum throttle in both directions, in [0.0, 1.0]. A safety cap, set once in start.

EXAMPLE USAGE

python
import racecar_core rc = racecar_core.create_racecar() def start(): print("start: capping speed at 0.4") rc.drive.set_max_speed(0.4) rc.drive.stop() timer = 0.0 def update(): # Drive forward gently for 2 seconds, then stop. global timer timer += rc.get_delta_time() if timer < 2.0: print(f"driving, timer at {timer:.1f} s") rc.drive.set_speed_angle(0.3, 0) else: print("2 seconds reached, stopping") rc.drive.stop() rc.set_start_update(start, update) rc.go()

For full documentation, visit the racecar-neo-library documentation.