Switching to mode 'Offboard' is currently not possible. Check for a valid position estimate

Hi All,

Apologies for the upcoming wall of text, I am facing an issue and will try to include as much relevant information.

I am attempting to run an offboard controller using a Pixhawk 6c and an Odroid Xu4 companion computer. For position, I have a vicon motion capture set up. Previously, this set up worked well but recently I have hit a roadblock and can successfully arm but not switch to offboard mode. I keep getting an error message “Switching to mode ‘Offboard’ is currently not possible. Check for a valid position estimate”.

My code is based around this example GitHub - mavlink/c_uart_interface_example: Simple MAVLink to UART interface example for *nix systems

What I have done so far is output the messages received on the Odroid from both telemetry ports, to verify that a connection exists. It appears that the messages received depend upon the order in which I plug in the usb cables, not sure if that is relevant. Additionally, I have checked to make sure that my vehicle is creating messages to send, which it is.

I use a customized version of the 1.13.3 firmware with modifications in the “Config” mode to turn off messages that I do not use to save computational load.

Attached are a flight log in an instance where my data appeared to converge but I was still unable to arm, along with a picture of my Pixhawk setup. If it would be helpful, I can also include my parameters.

Additionally, I used to get the LOCAL_POSITION_NED mavlink message without issue and now it appears finicky at best, only really showing up sometimes. I do consistently get the ODOMETRY message. This seems indicative of mavlink messages not being sent from my Odroid to the Pixhawk.

https://logs.px4.io/plot_app?log=87916379-1c25-431c-8588-09619b30a6eb

If there is any other information that I can provide, I will be very happy to do so.

  • Paul

I get the same error message when switching the modes using RC. But when I try to switch the mode to offboard using the code it does not switch but also does not show the error message. I can also arm it without any issue. I wonder if it is the same issue for you.

I have not tried arming it via my code but I will try to see if I can replicate your issue. Are you also using two telemetry cables to a Linux based offboard computer?

Have you tried the settings listed at this link?
Problems connecting a Pixhawk 6c to a Raspberry Pi - #4 by JulianOes

I made those changes for both Telem2 and Telem3. Doing this and then running the code on my offboard computer let me see messages had gone through( by doing cout << message_id) and I could see position messages (LOCAL_POSITION_NED and ODOMETRY) being received by Mavlink Inspector in QGroundControl.

My next thought is to plot the test ratios as mentioned here: Using the ECL EKF | PX4 User Guide

and see if some of my data is coming through with too much noise or something.

Hi,
Sorry about the late response. I have been sorting out the issues this whole time. I was able to switch my Pixhawk to offboard mode.
I went through the vision web page attached below.

Since I am using a camera (realsense 455), I had to switch the EKF2 parameters to VISION and also deactivate some sensors like range aid and GPS.
Then I ran the code using /mavros/vision_pose/pose and fed the data of current position, orientation (quaternion), and the time stamp and the setpoint data using /mavros/setpoint_position/local . When I did this, I used a FOR loop with ten counts before switching to offboard and continued feeding data using /mavros/vision_pose/pose and also the setpoints using /mavros/setpoint_position/local (setpoint and vision data are the same) and published them both inside the same FOR loop. And then, I continued feeding data in a while(1) infinite loop continuously publishing vision and setpoint data and, most importantly, changing the time stamp of both setpoint and vision using rospy.Time.now().
The issue seems to be with the continuity of data receiving to the /odometry topic.

I hope you will find this helpful and probably have sorted out the issue already. Feel free to reply to this.

1 Like

Thank you for the update. I was able to solve it by using the settings found here: Problems connecting a Pixhawk 6c to a Raspberry Pi - #4 by JulianOes