Unable to Arm in Guided Mode

Hello!
This is my first post around these parts so please let me know if something should move somewhere else or if any info is missing.

The big picture:
I am attempting to achieve indoor localization/navigation/loiter with pose estimates coming from a camera and Aruco markers. So far, I have mostly been using @anbello 's tutorials and information from around the forums, which has been extremely helpful! My setup is a PixRacer board on a 350mm quadrotor, running Copter 4.1.5. I have a rangefinder (VL53X1L) pointing downwards alongside an optical flow sensor. I am running mavros on a Raspberry Pi 3B connected via USB. Communication seems to be working between the FC and the companion computer.

I am facing two issues right now:

  1. I am currently unable to perform arming in guided mode. It might be that I am missing something small in my param settings. It does not work with and without the optical flow sensor enabled with EK2_FLOW_USE. Attached is a log file with an attempt to arm in guided mode.
    Prior to arming I am setting the EKF origin with aruco_gridboard/set_origin.py at master · anbello/aruco_gridboard · GitHub
    The message I am receiving is PreArm: Need Position Estimate. Arming also fails when the camera sees the aruco tags (and publishes meaningful vision_pose information).

    Log file:
    https://drive.google.com/file/d/12aU2dqJTatauSR4bikBBv4nUIJxincEE/view?usp=sharing

    1b. I also noticed that I cannot go into PosHold mode anymore even with optical flow being used. I would love some help here!

  2. /mavros/local_position/pose not updating with /mavros/vision_pose/pose. I feel like this issue is a derivative of the former. The local_position topic is empty. Maybe it would be best to leave this question for another day.

Thank you!!

What do you have your GUID_OPTIONS parameter set to? You’ll want Bit 0 enabled if you want to arm via RC transmitter.

image

Source: Complete Parameter List — Copter documentation

@yoraish,

If 4.1.5 is used then I think it would be best to stick with EKF3 instead of EKF2. We have instructions on the wiki although they do need updating a bit.

I also think it would be best to try and get optical flow working for a pilot controlled mode (e.g. Loiter) as a first step before trying to move onto the autonomous Guided mode.

The core issue though is that the EKF is not getting a good position estimate. This is stopping all autonomous and semi-autonomous modes from being used.

@rmackay9 @Matt_Kun Thank you both!!!

I have successfully used pilot-controller optical flow modes (e.g., PosHold) before, and after fiddling with parameters for a bit I apparently broke that. I will revert to a previous parameters setup, move over to EKF3, and update :robot: .

With proper optical flow inputs I should expect reasonable local_position/pose information, right?

1 Like

Hi @yoraish,

Yes, with optical flow working the vehicle’s position and attitude should be reported to the GCS.

Hello again!

@rmackay9 , I followed your advice and set up EKF3 for optical-flow PosHold. It seems to do well! Slight yaw drift but that’s acceptable for now (probably soome interference from nearby cables). And more to the point, it also allows arming manually and via mavros when the state of the robot is GUIDED. So that’s great! :smile:

It is always fun to see things flying, so here is a short video of the indoor PosHold:

I also looked at the local_position reported in mavros. While messages on this topic are published now (woo!), the Z axis value keeps climbing and does not update itself despite receiving messages on the topic /mavros/vision_pose/pose and reasonable rangefinder values. I am probably not setting something up right here as well.

Have you seen something like that before?

Some changes that I made from the tutorial:

  • Set EK3_SRC1_POSZ to 2 (rangefinder).

Like the tutorial, I set EK3_SRC1_POSXY to 0. In an attempt to accept updates from the vision_pose topic, I tried setting EK3_SRC1_POSXY to 6 (ExternalNav) but that did not change the situation. Perhaps I do not understand what the ExternalNav option means :slight_smile: .

Thanks again!!

@rmackay9 Hi again! And thank you for the help. I have attempted to get the local position to update in GCS once more, with EKF3 and EKF2, and have unfortunately failed. I kept my attempts to an optical-flow-only setup.

Let’s start with the good news:

  1. The drone keeps its position fairly well!
  2. The GCS shows correct height (z) values.

The challenges that remain:

  1. The x and y values in the GCS seem to remain at zero. I have tried to set the EKF origin and Home position in Mission Planner but think that it did not work.
  2. Even though I can see reasonable flow values being reported (at, for example flow_x and also in the angle-compensated variables), the vel_x and vel_y fields are always zero. I have EK3_SRC1_VELXY = 5 as described in the tutorial.

Do you maybe have any ideas as to why the velocity could remain at zero? Could this be an EKF covariance issue where the optical flow readings are thrown out? I’d love to hear your thought. I’ll also upload logs as soon as I can (in a few days unfortunately).

Another note:
I have observed that the IMU1, IMU0, and Opt-Flow keep switching between being used and not begin used (I think, apologies if my language is inaccurate/wrong here). This is reported in GCS and also in MAVROS. Is this a reason for concern?

Thanks again!