Rotate the gimbal to a specific vector. .. code-block:: python #Point the gimbal straight down vehicle.gimbal.rotate(-90, 0, 0) :param pitch: Gimbal pitch in degrees relative to the vehicle (see diagram for :ref:`attitude `).
(self, pitch, roll, yaw)
| 2278 | return self._yaw |
| 2279 | |
| 2280 | def rotate(self, pitch, roll, yaw): |
| 2281 | """ |
| 2282 | Rotate the gimbal to a specific vector. |
| 2283 | |
| 2284 | .. code-block:: python |
| 2285 | |
| 2286 | #Point the gimbal straight down |
| 2287 | vehicle.gimbal.rotate(-90, 0, 0) |
| 2288 | |
| 2289 | :param pitch: Gimbal pitch in degrees relative to the vehicle (see diagram for :ref:`attitude <figure_attitude>`). |
| 2290 | A value of 0 represents a camera pointed straight ahead relative to the front of the vehicle, |
| 2291 | while -90 points the camera straight down. |
| 2292 | :param roll: Gimbal roll in degrees relative to the vehicle (see diagram for :ref:`attitude <figure_attitude>`). |
| 2293 | :param yaw: Gimbal yaw in degrees relative to *global frame* (0 is North, 90 is West, 180 is South etc.) |
| 2294 | """ |
| 2295 | msg = self._vehicle.message_factory.mount_configure_encode( |
| 2296 | 0, 1, # target system, target component |
| 2297 | mavutil.mavlink.MAV_MOUNT_MODE_MAVLINK_TARGETING, #mount_mode |
| 2298 | 1, # stabilize roll |
| 2299 | 1, # stabilize pitch |
| 2300 | 1, # stabilize yaw |
| 2301 | ) |
| 2302 | self._vehicle.send_mavlink(msg) |
| 2303 | msg = self._vehicle.message_factory.mount_control_encode( |
| 2304 | 0, 1, # target system, target component |
| 2305 | pitch * 100, # pitch is in centidegrees |
| 2306 | roll * 100, # roll |
| 2307 | yaw * 100, # yaw is in centidegrees |
| 2308 | 0) # save position |
| 2309 | self._vehicle.send_mavlink(msg) |
| 2310 | |
| 2311 | def target_location(self,roi): |
| 2312 | """ |
nothing calls this directly
no test coverage detected