blueye.sdk.guestport
guestport
Classes:
-
Gripper
–Represents a gripper connected to a guest port on the Blueye drone.
-
GuestPortCamera
–Represents a camera connected to a guest port on the Blueye drone.
-
GuestPortLight
–Represents a light connected to a guest port on the Blueye drone.
-
Laser
–Represents a laser connected to a guest port on the Blueye drone.
-
Peripheral
–Represents a peripheral device connected to a guest port on the Blueye drone.
Functions:
-
device_to_peripheral
–Convert a device to its corresponding peripheral class.
Gripper
Gripper(
parent_drone: Drone,
port_number: GuestPortNumber,
device: GuestPortDevice,
)
Represents a gripper connected to a guest port on the Blueye drone.
Parameters:
-
parent_drone
(Drone
) –The parent drone instance.
-
port_number
(GuestPortNumber
) –The guest port number.
-
device
(GuestPortDevice
) –The guest port device.
Attributes:
-
grip_velocity
(float
) –Get or set the current grip velocity of the Gripper.
-
rotation_velocity
(float
) –Get or set the current rotation velocity of the Gripper.
Source code in blueye/sdk/guestport.py
107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
grip_velocity
property
writable
grip_velocity: float
Get or set the current grip velocity of the Gripper.
Parameters:
-
value
(float
) –The new grip velocity to set. Must be a float between -1.0 and 1.0.
Returns:
-
float
–The current grip velocity of the Gripper.
Raises:
-
ValueError
–If the grip velocity is not between -1.0 and 1.0.
rotation_velocity
property
writable
rotation_velocity: float
Get or set the current rotation velocity of the Gripper.
Parameters:
-
value
(float
) –The new rotation velocity to set. Must be a float between -1.0 and 1.0.
Returns:
-
float
–The current rotation velocity of the Gripper.
Raises:
-
ValueError
–If the rotation velocity is not between -1.0 and 1.0.
GuestPortCamera
GuestPortCamera(
parent_drone: Drone,
port_number: GuestPortNumber,
device: GuestPortDevice,
)
Represents a camera connected to a guest port on the Blueye drone.
Parameters:
-
parent_drone
(Drone
) –The parent drone instance.
-
port_number
(GuestPortNumber
) –The guest port number.
-
device
(GuestPortDevice
) –The guest port device.
Methods:
-
take_picture
–Take a still picture and store it locally on the drone.
Attributes:
-
bitrate
(int
) –Set or get the video stream bitrate.
-
bitrate_still_picture
(int
) –Set or get the bitrate for the still picture stream.
-
exposure
(int
) –Set or get the camera exposure.
-
framerate
(int
) –Set or get the camera frame rate.
-
hue
(int
) –Set or get the camera hue.
-
is_recording
(Optional[bool]
) –Get or set the camera recording state.
-
record_time
(Optional[int]
) –Get the duration of the current camera recording.
-
resolution
(int
) –Set or get the camera resolution.
-
whitebalance
(int
) –Set or get the camera white balance.
Source code in blueye/sdk/guestport.py
54 55 56 57 58 59 60 61 62 63 64 65 |
|
bitrate
property
writable
bitrate: int
Set or get the video stream bitrate.
Parameters:
-
bitrate
(int
) –Set the video stream bitrate in bits, valid values are in range (1 000 000 .. 16 000 000).
Returns:
-
int
–The H264 video stream bitrate.
bitrate_still_picture
property
writable
bitrate_still_picture: int
Set or get the bitrate for the still picture stream.
Parameters:
-
bitrate
(int
) –Set the still picture stream bitrate in bits, valid values are in range (1 000 000 .. 300 000 000). Default value is 100 000 000.
Returns:
-
int
–The still picture stream bitrate.
exposure
property
writable
exposure: int
Set or get the camera exposure.
Parameters:
-
exposure
(int
) –Set the camera exposure time. Unit is thousandths of a second, ie. 5 = 5s/1000. Valid values are in the range (1 .. 5000) or -1 for auto exposure.
Returns:
-
int
–The camera exposure.
framerate
property
writable
framerate: int
Set or get the camera frame rate.
Parameters:
-
framerate
(int
) –Set the camera frame rate in frames per second. Valid values are 25 or 30.
Returns:
-
int
–The camera frame rate.
hue
property
writable
hue: int
Set or get the camera hue.
Parameters:
-
hue
(int
) –Set the camera hue. Valid values are in the range (-40..40).
Returns:
-
int
–The camera hue.
is_recording
property
writable
is_recording: Optional[bool]
Get or set the camera recording state.
Parameters:
-
start_recording
(bool
) –Set to True to start a recording, set to False to stop the current recording.
Returns:
-
Optional[bool]
–True if the camera is currently recording, False if not. Returns None if the SDK hasn't received a RecordState telemetry message.
Warns:
-
RuntimeWarning
–If no recording state telemetry data is received.
record_time
property
record_time: Optional[int]
Get the duration of the current camera recording.
Returns:
-
Optional[int]
–The length in seconds of the current recording, -1 if the camera is not currently recording. Returns None if the SDK hasn't received a RecordState telemetry message.
resolution
property
writable
resolution: int
Set or get the camera resolution.
Parameters:
-
resolution
(int
) –Set the camera in vertical pixels. Valid values are 720 or 1080.
Returns:
-
int
–The camera resolution.
whitebalance
property
writable
whitebalance: int
Set or get the camera white balance.
Parameters:
-
white_balance
(int
) –Set the camera white balance. Valid values are in the range (2800..9300) or -1 for auto white balance.
Returns:
-
int
–The camera white balance.
take_picture
take_picture()
Take a still picture and store it locally on the drone.
These pictures can be downloaded with the Blueye App, or by any WebDAV compatible client.
Source code in blueye/sdk/camera.py
1003 1004 1005 1006 1007 1008 |
|
GuestPortLight
GuestPortLight(
parent_drone: Drone,
port_number: GuestPortNumber,
device: GuestPortDevice,
)
Represents a light connected to a guest port on the Blueye drone.
Parameters:
-
parent_drone
(Drone
) –The parent drone instance.
-
port_number
(GuestPortNumber
) –The guest port number.
-
device
(GuestPortDevice
) –The guest port device.
Methods:
-
get_intensity
–Get the intensity of the guest port light.
-
set_intensity
–Set the intensity of the guest port light.
Source code in blueye/sdk/guestport.py
73 74 75 76 77 78 79 80 81 82 83 |
|
get_intensity
get_intensity() -> Optional[float]
Get the intensity of the guest port light.
Returns:
-
Optional[float]
–The intensity of the light (0..1).
Source code in blueye/sdk/guestport.py
93 94 95 96 97 98 99 |
|
set_intensity
set_intensity(intensity: float)
Set the intensity of the guest port light.
Parameters:
-
intensity
(float
) –The intensity of the light (0..1).
Source code in blueye/sdk/guestport.py
85 86 87 88 89 90 91 |
|
Laser
Laser(
parent_drone: Drone,
port_number: GuestPortNumber,
device: GuestPortDevice,
)
Represents a laser connected to a guest port on the Blueye drone.
Parameters:
-
parent_drone
(Drone
) –The parent drone instance.
-
port_number
(GuestPortNumber
) –The guest port number.
-
device
(GuestPortDevice
) –The guest port device.
Methods:
-
get_intensity
–Get the current intensity of the laser.
-
set_intensity
–Set the intensity of the laser.
Source code in blueye/sdk/guestport.py
175 176 177 178 179 180 181 182 183 184 185 |
|
get_intensity
get_intensity() -> Optional[float]
Get the current intensity of the laser.
Returns:
-
Optional[float]
–The current intensity of the laser.
Source code in blueye/sdk/guestport.py
203 204 205 206 207 208 209 210 211 212 213 |
|
set_intensity
set_intensity(intensity: float)
Set the intensity of the laser.
If the laser does not support dimming but only on and off, a value of 0 turns the laser off, and any value above 0 turns the laser on.
Parameters:
-
intensity
(float
) –The intensity of the laser (0..1).
Raises:
-
ValueError
–If the intensity is not between 0 and 1.
Source code in blueye/sdk/guestport.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
|
Peripheral
Peripheral(
parent_drone: Drone,
port_number: GuestPortNumber,
device: GuestPortDevice,
)
Represents a peripheral device connected to a guest port on the Blueye drone.
Parameters:
-
parent_drone
(Drone
) –The parent drone instance.
-
port_number
(GuestPortNumber
) –The guest port number.
-
device
(GuestPortDevice
) –The guest port device.
Source code in blueye/sdk/guestport.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
device_to_peripheral
device_to_peripheral(
parent_drone: Drone,
port_number: GuestPortNumber,
device: GuestPortDevice,
) -> Peripheral
Convert a device to its corresponding peripheral class.
Parameters:
-
parent_drone
(Drone
) –The parent drone instance.
-
port_number
(GuestPortNumber
) –The guest port number.
-
device
(GuestPortDevice
) –The guest port device.
Returns:
-
Peripheral
–The corresponding peripheral class instance.
Source code in blueye/sdk/guestport.py
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
|