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”.
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.
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?
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.
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.