The angle rate setpoint error

In the offboard mode,I use the topic “mavros/setpoint_raw/attitude” to control my quadrotor’s angle,but I find the log there were some problem about the angle rate controller.The command of Yaw rate setpoint sometimes becomes zero,it influenced the quadrotor’s flying largely. But if I use the radio controller to control my quadrotor under position flight mode,the Yaw rate setpoint haven’t this phenomenom.
The hardware I used is pixhawk 4 mini,and the version of px4 is v1.11.2

@KingeL21 You need to set the type mask to ignore the rate setpoints

Belows are my code:

mavros_msgs::AttitudeTarget attitudeTarget; attitudeTarget.type_mask=mavros_msgs::AttitudeTarget::IGNORE_PITCH_RATE || mavros_msgs::AttitudeTarget::IGNORE_ROLL_RATE || mavros_msgs::AttitudeTarget::IGNORE_YAW_RATE;

But the phenomenom don’t disappear——Yaw rate setpoint sometimes becomes zero still. Maybe I didn’t get your mean?
Thanks for your help.

Haha,I find my code is error.It must be

attitudeTarget.type_mask=mavros_msgs::AttitudeTarget::IGNORE_PITCH_RATE | mavros_msgs::AttitudeTarget::IGNORE_ROLL_RATE | mavros_msgs::AttitudeTarget::IGNORE_YAW_RATE;

And now the problem is solved,Thanks for your help! :grin: