mondare
(mondare)
1
Hi,
Is there a possibility to change the actual waypoint in guided mode out of a userhook or in
control_guided.cpp without a mavlink message protocol?
In a way that it adjusts all second or tenth-second the actual position/waypoint?
With best regards, Marek
billb
(Bill Bonney)
2
mondare
(mondare)
3
simple flying in guided mode for SITL:
static unsigned short counter;
Vector3f nextpos;
Vector3f currentpos;
currentpos = pv_location_to_vector(current_loc);
wp_nav.set_speed_xy(6 * 100.0f);
counter++;
if (counter == 15)
{
nextpos.x = currentpos.x + 50*100.00f;
nextpos.y = currentpos.y + 50*100.00f;
nextpos.z = 30*100.00f;
guided_set_destination(nextpos);
}
if (counter == 30)
{
counter = 0;
nextpos.x = currentpos.x + 50*100.00f;
nextpos.y = currentpos.y - 50*100.00f;
nextpos.z = 30*100.00f;
guided_set_destination(nextpos);
}