#1726·AirSim

Any API for reading input from joystick?

Author: alexanderkoumisCreated Jan 22, 2019Updated Jan 20, 2026
Labelsbugrc

I would like to create a dataset consisting of images, timestamps, ground truth position/orientations, as well as thrust, roll, pitch, yaw input from my RC. The exact values I would like are visible on the main screen as "Joystick (T,R,P,Y Buttons): %f, %f, %f, %f". I tried reading this information in Python by calling:

python
client = airsim.MultirotorClient()
client.confirmConnection()
rc_data = client.getMultirotorState().rc_data

However, all this information is uninitialized:

<RCData> {   'is_initialized': False,
    'is_valid': False,
    'left_z': 0.0,
    'pitch': 0.0,
    'right_z': 0.0,
    'roll': 0.0,
    'switches': 0,
    'throttle': 0.0,
    'timestamp': 0,
    'vendor_id': '',
    'yaw': 0.0}

Is this struct only populated when the device is being controlled using the API? Is there another Python command I need to call to retrieve the information when controlling the quad with a RC?

Thanks for your time.