This commit is contained in:
David St-Onge 2017-01-31 03:15:22 -05:00
parent 965c9850ba
commit f51e657103
2 changed files with 5 additions and 2 deletions

View File

@ -115,8 +115,8 @@ int buzzuav_goto(buzzvm_t vm) {
//buzzvm_type_assert(vm, 3, BUZZTYPE_FLOAT); //buzzvm_type_assert(vm, 3, BUZZTYPE_FLOAT);
buzzvm_type_assert(vm, 2, BUZZTYPE_FLOAT); buzzvm_type_assert(vm, 2, BUZZTYPE_FLOAT);
buzzvm_type_assert(vm, 1, BUZZTYPE_FLOAT); buzzvm_type_assert(vm, 1, BUZZTYPE_FLOAT);
float dx = buzzvm_stack_at(vm, 1)->f.value; float dy = buzzvm_stack_at(vm, 1)->f.value;
float dy = buzzvm_stack_at(vm, 2)->f.value; float dx = buzzvm_stack_at(vm, 2)->f.value;
// float d = sqrt(dx*dx+dy*dy); // float d = sqrt(dx*dx+dy*dy);
// float b = atan2(dy,dx); // float b = atan2(dy,dx);
printf(" Vector for Goto: %.7f,%.7f\n",dx,dy); printf(" Vector for Goto: %.7f,%.7f\n",dx,dy);

View File

@ -98,6 +98,9 @@ neighbors.listen("cmd",
statef=land statef=land
} }
} }
if( flight.status == 2 and position.altitude >= TARGET_ALTITUDE-TARGET_ALTITUDE/20.0)
statef=hexagon
) )
} }