mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-06 19:00:27 +08:00
AP_Camera: support image tracking
This commit is contained in:
@@ -37,6 +37,19 @@ bool AP_Camera_Scripting::set_focus(FocusType focus_type, float focus_value)
|
||||
return true;
|
||||
}
|
||||
|
||||
// set tracking to none, point or rectangle (see TrackingType enum)
|
||||
// if POINT only p1 is used, if RECTANGLE then p1 is top-left, p2 is bottom-right
|
||||
// p1,p2 are in range 0 to 1. 0 is left or top, 1 is right or bottom
|
||||
bool AP_Camera_Scripting::set_tracking(TrackingType tracking_type, const Vector2f& p1, const Vector2f& p2)
|
||||
{
|
||||
_cam_state.tracking_type = (uint8_t)tracking_type;
|
||||
_cam_state.tracking_p1x = p1.x;
|
||||
_cam_state.tracking_p1y = p1.y;
|
||||
_cam_state.tracking_p2x = p2.x;
|
||||
_cam_state.tracking_p2y = p2.y;
|
||||
return true;
|
||||
}
|
||||
|
||||
// access for scripting backend to retrieve state
|
||||
// returns true on success and cam_state is filled in
|
||||
bool AP_Camera_Scripting::get_state(AP_Camera::camera_state_t& cam_state)
|
||||
|
||||
Reference in New Issue
Block a user