-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Peripherals | ||
|
||
The `Drone` class maintains a list of peripherals that are attached to the drone. These peripherals can include cameras, grippers, and other devices that can be controlled using the drone's API. | ||
|
||
To list the peripherals that are currently attached to the drone, you can check the `peripherals` attribute of the `Drone` class. This attribute is a list of [`Peripheral`](reference/blueye/sdk/guestport.md#peripheral) objects. | ||
|
||
The SDK will also create attributes for supported peripherals to simplify access. | ||
|
||
## External camera | ||
If the drone has a camera attached, the `Drone` class will have an `external_camera` attribute that is a [`GuestPortCamera`](reference/blueye/sdk/guestport.md#guestportcamera) object. This object can be used to control the camera. | ||
|
||
```python | ||
# Capture an image from the external camera | ||
drone.external_camera.take_picture() | ||
|
||
# Set bitrate for external camera to 2 Mbps | ||
drone.external_camera.bitrate = 2_000_000 | ||
|
||
# Start recording video from the external camera | ||
drone.external_camera.is_recording = True | ||
``` | ||
|
||
## External light | ||
If the drone has an external light attached, the `Drone` class will have an `external_light` attribute that is a [`GuestPortLight`](reference/blueye/sdk/guestport.md#guestportlight) object. This object can be used to control the light. | ||
|
||
```python | ||
# Get the current intensity of the external light | ||
intensity: float = drone.external_light.get_intensity() | ||
|
||
# Set the intensity of the external light to 0.5 | ||
drone.external_light.set_intensity(0.5) | ||
``` | ||
|
||
## Gripper | ||
If the drone has a gripper attached, the `Drone` class will have a `gripper` attribute that is a [`Gripper`](reference/blueye/sdk/guestport.md#gripper) object. This object can be used to control the grip and rotation of the gripper. | ||
|
||
If the connected gripper does not support rotation, the `rotation_velocity` property will be ignored. | ||
|
||
```python | ||
# Open the gripper | ||
drone.gripper.grip_velocity = 1.0 | ||
|
||
# Close the gripper | ||
drone.gripper.grip_velocity = -1.0 | ||
|
||
# Rotate the gripper clockwise | ||
drone.gripper.rotation_velocity = 1.0 | ||
|
||
# Rotate the gripper counterclockwise | ||
drone.gripper.rotation_velocity = -1.0 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters