Unable to switch to OFFBOARD mode

Hi all!

We’re a small research team of the University of Rome “Tor Vergata”.
We’re building a quadcopter that has to fly indoors in a GPS-denied environment, so it can only estimate its local position using visual inertial odometry, that we generate using OrbSLAM 2 and an Intel RealSense camera. The system is deployed on a companion computer on the drone, connected to a Pixhawk 4 running PX4 v1.12.0-beta5 with ROS 2 and microRTPS.
The goal is to use EKF2 to estimate the local position fusing only vision data, and to control the drone in OFFBOARD mode.
We followed the documentation about this and configured EKF2 as above and our ROS 2 nodes to send the VIO information on the appropriate topic (“vehicle_visual_odometry”). Inspecting other topics tells us that EKF2 is receiving and fusing vision data. We also configured the rest of the system according to the OFFBOARD mode documentation, to continuously send target setpoints and correctly arm the drone.
We are able to switch to OFFBOARD mode and takeoff, just not every time.
Most of the time actually, the command is “temporarily rejected”. We suspect this has to do with the quality of the local position estimate that EKF2 holds, also considering that sometimes we observe some weird velocities being estimated by the PX4, whilst the drone is instead sitting still, and that our VIO system outputs correct estimates all the time.
Thus, we’d like to ask you the following questions:

  • Is there a minimum rate the VIO messages should be sent at? Currently we can achieve 14 Hz with our setup.
  • In the VehicleVisualOdometry messages we send, we write only local position XYZ coordinates and attitude quaternions (ordered wijk); should we write something else too, like velocity estimates or covariances (currently set to NAN)?
  • We configured the following EKF2 parameters: EKF2_AID_MASK=24, EKF2_HGT_MODE=3, EKF2_MAG_TYPE=5 (disabled the magnetometer), then left only one EKF2 instance active. Is any of these wrong?
  • To calibrate our Pixhawk 4 IMU and sensors we followed the guided procedures in QGroundControl. Should we do something else in this situation, maybe set some parameters we don’t know about?

Thanks in advance to anyone that will help us.

1 Like

Hi, our team is currently working on PX4 with ROS2 for detectiong&tracking of drone, unfortunately we can’t give you some useful advice that might help you out, since we haven’t even arm the drone, although the connection has been set up (we can receive the sensor_combined data from the drone via microRTPS, but the micrortps_client received nothing by inspecting using “micrortps_client status” on mavlink). so would you kindly tell me, what have you done in order to arm the vehicle via microRTPS (like the parameter setting on QGC)? I believe we can communicate more since we both are using px4 with ROS2.