Motor speed control of the drone on gazebo (I'm using iris)

Have you solved this problem by any chance?
My goal is to break it down. To be more specific, my goal is to move the drone to the desired setpoint and stop one motor in real time or control the speed.
But I thought it was impossible to control the px4 code because I’m a ros beginner.

I was looking for a way, and if I look at iris.sdf
/gazebo/command/motor_speed

/motor_speed/0
There’s a code called that.
So I thought there was something about exchanging these topics and when I looked, I found the gazebo_motor_model.cpp, gazebo_motor_model.h file.

However, I have a question that I can modify these files to control iris in gazebo.

What I thought was that you can control the motor by sub or sub here, and you can use this to control the motor in real time.

I’m wondering if this is right, and if it is, I’d like to know how to do it in detail…

Hello, friend, have you solved this problem? I’m also trying to use gazebo/command/motor_speed to control the drone’s attitude and motion using motor speed, but I’m encountering two issues: First, for a solo model, if the given speed is below 1200, the drone won’t take off. If it’s above 1200, the drone will take off quickly but quickly lose control. I suspect this is because I’m bypassing the PX4 controller. To achieve attitude control, I’d like to calculate the propeller’s lift and torque from the motor speed, but I can’t find the thrust and torque coefficients in the drone model’s sdf file.