Get the Motors RPMs from PX4

Hello,

I am trying to connect PX4 with an inhouse simulator for an SITL study. The simulator expect RPM from all four motors of quad_x type drone. I am getting the HIL_ACTUATOR_CONTROLS type message back from PX4 based on Sensor signal I send and inputs being passed from QGC.

In this message type, ‘controls’ filed is a list of 16 items having control outputs and these values vary from -1…+1. Below are my questions:

  1. How do I get RPM from these controls?
  2. How do I know the mapping between control index in ‘controls’ list to the motor it corresponds to?

I would like to know this for Generic Quadrotor x type Airframe ( SYS_AUTOSTART = 4001). Currently using, pymavlink to connect with PX4 using python.

Any leads would be helpful.

Thanks,
Rajesh