| 441 | } |
| 442 | |
| 443 | int check_failsafe() |
| 444 | { |
| 445 | if (_DroneState.position[0] < geo_fence_x[0] || _DroneState.position[0] > geo_fence_x[1] || |
| 446 | _DroneState.position[1] < geo_fence_y[0] || _DroneState.position[1] > geo_fence_y[1] || |
| 447 | _DroneState.position[2] < geo_fence_z[0] || _DroneState.position[2] > geo_fence_z[1]) |
| 448 | { |
| 449 | pub_message(message_pub, prometheus_msgs::Message::ERROR, NODE_NAME, "Out of the geo fence, the drone is landing..."); |
| 450 | return 1; |
| 451 | } |
| 452 | else{ |
| 453 | return 0; |
| 454 | } |
| 455 | } |
| 456 | |
| 457 | |
| 458 | //【Body_to_ENU】 机体系移动。 |