PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.24k stars 13.4k forks source link

[Bug] Actuator not controlled in Offboard Mode #23720

Open serkanMzlm opened 3 hours ago

serkanMzlm commented 3 hours ago

Describe the bug

I broadcast "fmu/in/actuator_motors" for actuator control in offboard mode, but there was no change in the PWM signal at the IO or FMU outputs.

To Reproduce

  1. I connected the PX4 to the computer.

  2. I made the necessary settings in the PX4 section for MicroXRCEAgent and connected it to the computer with the FTDI cable.

  3. I published a message of type px4_msgs::msg::OffboardControlMode.

    
    offboardControlModeMsg msg{};
    msg.position = false;
    msg.velocity = false;
    msg.acceleration = false;
    msg.attitude = false;
    msg.body_rate = false;
    msg.direct_actuator = true;
    msg.timestamp = this->get_clock()->now().nanoseconds() / 1000;
    pub.offboard_control_mode->publish(msg);
  4. I published a message of type px4_msgs::msg::ActuatorMotors.

    px4_msgs::msg::ActuatorMotors sp_motors{};
    for (int i = 0; i < 12; ++i)
    {
        sp_motors.control[i] = 1;
    }
    sp_motors.reversible_flags = 0;
    sp_motors.timestamp = this->get_clock()->now().nanoseconds() / 1000;
    sp_motors.timestamp_sample = sp_motors.timestamp;
    pub.motor->publish(sp_motors);

Expected behavior

In this part, I waited for the PWM to change at the IO or FMU outputs.

Screenshot / Media

No response

Flight Log

No response

Software Version

1.15

Flight controller

No response

Vehicle type

Multicopter

How are the different components wired up (including port information)

There is no problem with the wiring

Additional context

No response

serkanMzlm commented 3 hours ago

My goal is to get PWM output to run the 6 motors I have installed externally, in addition to the 4 motors required to fly the drone.

beniaminopozzan commented 1 hour ago

Hello, did you put the drone into offboard mode? Where you able to arm?