Cannot switch to Manual modes when flying in Offboard mode

Hello everyone,

I’m using PX4 software to fly an autonomous drone. I’ve got a script to send waypoints to the drone publishing in fmu/trajectory_setpoint/in and I publish offboard flight mode also. This is the function of the code that I use in the main loop.

void LocalPlannerNode::publish_trajectory_setpoint(){
    px4_msgs::msg::OffboardControlMode ctrl_msg{};

    ctrl_msg.timestamp = timesync_data.load();
    ctrl_msg.position = false;
    ctrl_msg.velocity = true;
    ctrl_msg.acceleration = false;
    ctrl_msg.attitude = false;
    ctrl_msg.body_rate = false;
    ctrl_msg.actuator = false;
    offboard_control_mode_pub->publish(ctrl_msg);

    

    px4_msgs::msg::TrajectorySetpoint setpoint_msg{};
    setpoint_msg.timestamp = timesync_data.load();
    setpoint_msg.x = NAN;
    setpoint_msg.y = NAN;
    setpoint_msg.z = NAN;
    setpoint_msg.yaw = NAN;
    setpoint_msg.vx = cvx;
    setpoint_msg.vy = -cvy;
    setpoint_msg.vz = -cvz;
    setpoint_msg.yawspeed = -yawspeed;
    setpoint_msg.acceleration[0] = NAN;
    setpoint_msg.acceleration[1] = NAN;
    setpoint_msg.acceleration[2] = NAN;
    setpoint_msg.thrust[0] = NAN;
    setpoint_msg.thrust[1] = NAN;
    setpoint_msg.thrust[2] = NAN;

    trajectory_setpoint_pub->publish(setpoint_msg);

}```

My problem is that, when I run this node, I cannot swith to manual modes (altitude, position, stabilized) from my radio controller. I enabled this parameter COM_RC_OVERRIDE to enabled the override during offboard mode but it's still the same. I think that's becouse I'm publishing in loop offboard control mode (overriding my radio controller input) but this is necessary to send waypoints to the drone according to the example in offboard example node of px4_ros_com. 

My need is to quickly take control of the drone from the radio controller when something goes wrong. When the node is not running I can properly switch the flight mode according to my switch settings. Is there any parameters to allow the overriding of the flight mode?