PX4-Autopilot version 1.15 does not work in indoor systems

I am using PX4 software and have built a quadcopter. I made the necessary adjustments to fly the drone in indoor systems. I configured the required parameters through this link. (Indoor (non-flat terrain))

I installed a ThoneFlow 3901U sensor as an optical flow module on the vehicle. To read altitude data, I am using a Benewake TF03-180 sensor. Instead of connecting this sensor directly to PX4, I read it through a Raspberry Pi and publish it as /fmu/in/distance_sensor. After publishing, I can see the distance sensor data in QGroundControl (QGC).

However, in PX4 version 1.15, when I tried to arm the drone in Position Mode using the RC controller, it failed to arm and gave the following error:
Critical: Arming denied: Resolve system health failures first

I couldn’t fully understand the reason for this error. Later, when I switched to PX4 version 1.16 (which is not a stable release), the drone was able to arm in Position Mode.

In summary, the issues I encountered and observed are as follows:

  1. In PX4 version 1.15, the drone does not arm in Position Mode. However, when I switch to version 1.16, it arms successfully.
  2. Although the signal_quality value of the distance sensor data published via Raspberry Pi is 75, it appears as 0 in QGC. What could be the reason for this?

QGC

ROS2

Code

px4_msgs::msg::DistanceSensor msg;
msg.timestamp = this->get_clock()->now().nanoseconds() / 1000;
msg.device_id = 201;
msg.min_distance = 0.10f;
msg.max_distance = 180.0f;
msg.current_distance = tf_sensor->getDistance() / 100.0f; // Convert distance to meters
msg.type = 0;                                        // MAV_DISTANCE_SENSOR_LASER
msg.h_fov = 0.5 * DEG_TO_RAD;
msg.v_fov = 0.5 * DEG_TO_RAD;
msg.orientation = 25;

int strength = tf_sensor->getStrength();
if (strength > 1500) {
	msg.signal_quality = 50;
}
else if (strength > 40) {
	msg.signal_quality = 100;
}
else {
	msg.signal_quality = 0;
}

tf_pub->publish(msg);

System Information:
PX4: Pixhawk 6C Mini
PX4 Version: 1.15.4
ROS2: Humble

Note: To view the parameters in the log file, the drone was armed in manual mode and switched to position mode, but it entered altitude mode instead.

This is Log File

image

1 Like

I missed it, I needed to enable the EKF2_OF_CTRL value