upkie  11.0.0
Open-source wheeled biped robots
JoystickController Class Reference

Controller that maps joystick inputs to linear and angular velocities. More...

Public Member Functions

def __init__ (self, Literal["left_axis", "right_axis"] joystick_axis="left_axis", float max_linear_accel=1.2, float max_linear_velocity=1.5, float max_yaw_accel=10.0, float max_yaw_velocity=1.0, float turning_deadband=0.3, float turning_decision_time=0.2)
 Initialize joystick controller. More...
 
float turning_probability (self)
 Probability the user wants to turn based on the joystick axis value. More...
 
None reset (self)
 Reset the internal state of the controller.
 
None update_linear_velocity (self, dict observation, float dt)
 Update linear velocity from joystick input. More...
 
None update_yaw_velocity (self, dict observation, float dt)
 Update yaw angular velocity from joystick input. More...
 
tuple[float, float] step (self, dict observation, float dt)
 Get new linear-angular velocities based on joystick input. More...
 

Public Attributes

 max_linear_accel
 Maximum linear acceleration in m/s².
 
 max_linear_velocity
 Maximum linear velocity in m/s.
 
 max_yaw_accel
 Maximum yaw angular acceleration in rad/s².
 
 max_yaw_velocity
 Maximum yaw angular velocity in rad/s.
 
 turning_deadband
 Joystick axis value between 0.0 and 1.0 below which turning probability goes up but turning doesn't start yet.
 
 turning_decision_time
 Minimum duration in seconds for the turning probability to switch from zero to one and conversely.
 

Detailed Description

Controller that maps joystick inputs to linear and angular velocities.


The documentation for this class was generated from the following file: