Get Motor Speed(Motor RPM) Accuratly

Dear everyone. I tried to get the true motor speed (also motor RPM) while flying in SITL with gazebo or jmavsim. But I tried no modules can be used to acquire my goal.
So I find a equation to reply the motor speed while throwing github/issue .The way he give me is like this:
actuator_outputs_s output;
Omega(0) = (output.output[0] + 1 ) / 2;
which Omega(0) is the fist motor speed after normalization (the same way to calculate last three motors).

Does the way to calculate motor speed right or is there other way to calculate motor speed in SITL?