0
$\begingroup$

I’m running ArduPilot SITL + Gazebo (Armonic) + MAVROS + ROS2 Humble, using the official ArduPilot Gazebo plugin.

I’m facing a strange issue:

When I use MAVProxy manually:

mode guided
arm throttle
takeoff 5

The drone arms and takes off perfectly.

But when I use my ROS2 Python script with MAVROS to:

  1. switch to GUIDED
  2. arm
  3. publish position setpoints
  4. and perform a takeoff by commanding altitude

The drone does NOT take off.

The SITL console shows messages like:

AP: Arm: Need Position Estimate
AP: PreArm: Need Position Estimate
Got COMMAND_ACK: COMPONENT_ARM_DISARM: FAILED
Mode GUIDED

But the strange part is that if I do it running mavproxy and ROS commands, it works.

What my ROS2 script does:

  1. Waits for FCU connection
  2. Publishes setpoints at ~10 Hz on /mavros/setpoint_position/
  3. Calls /mavros/cmd/
  4. Calls /mavros/set_mode with "GUIDED"
  5. Sends a position target at (0,0,10)

The script compiles and runs without errors, but the drone never leaves the ground.

My question

Why does the drone take off correctly when using MAVProxy commands,but refuses to take off when performing the same sequence through MAVROS in ROS2?

What am I missing in the MAVROS/ROS2 workflow to allow the drone to arm and take off properly?

Any help or clarifications are greatly appreciated!

New contributor
Javier Martín Pizarro is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.