Connecting via Mavlink using C++ code

Dear all,

I have the following problem and will be glad if someone could give a right direction for solution.

Whole last week I have tried to make my own C++ code for Linux based on this example. It is working with one little exception: the data about angles, GPS and etc is received only after connecting via APM Planner.

What I mean: I connect my PixHawk to PC using USB cable, start my program (as well as the example above) and can only work with mission and waypoints. All attitude and global positions are getting as nulls. Then (without disconnecting PixHawk) I connect and disconnect via APM Planner. After this magic actions I start my program (as well as the example again) and everything is working fine: I could read all autopilot data.

Looks like there is some signal to start transfer this data that has implemented in APM Planner, but is absent in this example. So my question is: how I can generate the same signal in the my program.

Thank you in advance for any help.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Activity