Reading Waypoints from code

Hello all!

I would ask how I can read waypoints from code from any control mode? For example, I want to change control mode with using coordinates of WP.

I find out this method:

Vector3f coord ; coord=wp_nav.get_wp_destination();

And I receive in coord x,y,z of WP, but only when control mode is auto. What I should do to make this possible in necessary mode?

Thanks for help and sorry for poor English!

A little update:

I found this way to take coordinates of waypoints:

wp_nav.wp_and_spline_init(); mission.start_or_resume(); Vector3f curr_pos = inertial_nav.get_position(); Vector3f target_pos=wp_nav.get_wp_destination(); mission.stop();

This way works perfect, but flying in active mode (e.g. in Loiter) is impossible because of starting/stopping mission. So how i can take coordinates of waypoints without starting mission?

I found how it can be solved:

for getting altitude of current waypoint. So this topic can be closed :slight_smile: