blueye.sdk.connection
connection
Modules:
-
blueye
– -
threading
–Thread module emulating a subset of Java's threading model.
Classes:
-
Callback
–Specifications for callback for telemetry messages.
-
CtrlClient
–A thread that handles control messages to the drone.
-
ReqRepClient
–A thread that handles request-reply messages to and from the drone.
-
TelemetryClient
–A thread that handles telemetry messages from the drone
-
WatchdogPublisher
–A thread that publishes watchdog messages to keep the connection alive.
Attributes:
-
logger
–
logger
module-attribute
logger = getLogger(__name__)
Callback
Bases: NamedTuple
Specifications for callback for telemetry messages.
Attributes:
-
message_filter
(List[Message]
) –The list of message types to filter.
-
function
(Callable[[str, Message], None]
) –The callback function.
-
pass_raw_data
(bool
) –Whether to pass raw data to the callback.
-
uuid_hex
(str
) –The UUID of the callback in hexadecimal format.
-
kwargs
(Dict[str, Any]
) –Additional keyword arguments for the callback.
CtrlClient
CtrlClient(
parent_drone: "blueye.sdk.Drone",
context: Context = None,
)
Bases: Thread
A thread that handles control messages to the drone.
Parameters:
-
parent_drone
(Drone
) –The parent drone instance.
-
context
(Context
, default:None
) –The ZeroMQ context.
Methods:
-
getName
–Return a string used for identification purposes only.
-
isDaemon
–Return whether this thread is a daemon.
-
is_alive
–Return whether the thread is alive.
-
join
–Wait until the thread terminates.
-
run
–Run the control client thread.
-
setDaemon
–Set whether this thread is a daemon.
-
setName
–Set the name string for this thread.
-
set_auto_altitude_state
–Enable or disable auto altitude control.
-
set_auto_depth_state
–Enable or disable auto depth control.
-
set_auto_heading_state
–Enable or disable auto heading control.
-
set_gripper_velocities
–Set the gripper velocities.
-
set_guest_port_lights
–Set the intensity of the guest port lights.
-
set_laser_intensity
–Set the laser intensity.
-
set_lights
–Set the intensity of the lights.
-
set_motion_input
–Set the motion input values.
-
set_recording_state
–Enable or disable recording.
-
set_station_keeping_state
–Enable or disable station keeping.
-
set_tilt_stabilization
–Enable or disable tilt stabilization.
-
set_tilt_velocity
–Set the tilt velocity.
-
set_water_density
–Set the water density.
-
set_weather_vaning_state
–Enable or disable weather vaning.
-
start
–Start the thread's activity.
-
stop
–Stop the control client thread.
-
take_still_picture
–Take a still picture.
Attributes:
-
daemon
–A boolean value indicating whether this thread is a daemon thread.
-
ident
–Thread identifier of this thread or None if it has not been started.
-
name
–A string used for identification purposes only.
-
native_id
–Native integral thread ID of this thread, or None if it has not been started.
Source code in blueye/sdk/connection.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
|
daemon
property
writable
daemon
A boolean value indicating whether this thread is a daemon thread.
This must be set before start() is called, otherwise RuntimeError is raised. Its initial value is inherited from the creating thread; the main thread is not a daemon thread and therefore all threads created in the main thread default to daemon = False.
The entire Python program exits when only daemon threads are left.
ident
property
ident
Thread identifier of this thread or None if it has not been started.
This is a nonzero integer. See the get_ident() function. Thread identifiers may be recycled when a thread exits and another thread is created. The identifier is available even after the thread has exited.
name
property
writable
name
A string used for identification purposes only.
It has no semantics. Multiple threads may be given the same name. The initial name is set by the constructor.
native_id
property
native_id
Native integral thread ID of this thread, or None if it has not been started.
This is a non-negative integer. See the get_native_id() function. This represents the Thread ID as reported by the kernel.
getName
getName()
Return a string used for identification purposes only.
This method is deprecated, use the name attribute instead.
Source code in python3.13/threading.py
1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 |
|
isDaemon
isDaemon()
Return whether this thread is a daemon.
This method is deprecated, use the daemon attribute instead.
Source code in python3.13/threading.py
1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 |
|
is_alive
is_alive()
Return whether the thread is alive.
This method returns True just before the run() method starts until just after the run() method terminates. See also the module function enumerate().
Source code in python3.13/threading.py
1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 |
|
join
join(timeout=None)
Wait until the thread terminates.
This blocks the calling thread until the thread whose join() method is called terminates -- either normally or through an unhandled exception or until the optional timeout occurs.
When the timeout argument is present and not None, it should be a floating-point number specifying a timeout for the operation in seconds (or fractions thereof). As join() always returns None, you must call is_alive() after join() to decide whether a timeout happened -- if the thread is still alive, the join() call timed out.
When the timeout argument is not present or None, the operation will block until the thread terminates.
A thread can be join()ed many times.
join() raises a RuntimeError if an attempt is made to join the current thread as that would cause a deadlock. It is also an error to join() a thread before it has been started and attempts to do so raises the same exception.
Source code in python3.13/threading.py
1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 |
|
run
run()
Run the control client thread.
Source code in blueye/sdk/connection.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
|
setDaemon
setDaemon(daemonic)
Set whether this thread is a daemon.
This method is deprecated, use the .daemon property instead.
Source code in python3.13/threading.py
1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 |
|
setName
setName(name)
Set the name string for this thread.
This method is deprecated, use the name attribute instead.
Source code in python3.13/threading.py
1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 |
|
set_auto_altitude_state
set_auto_altitude_state(enabled: bool)
Enable or disable auto altitude control.
Parameters:
-
enabled
(bool
) –Whether to enable auto altitude control.
Source code in blueye/sdk/connection.py
321 322 323 324 325 326 327 328 |
|
set_auto_depth_state
set_auto_depth_state(enabled: bool)
Enable or disable auto depth control.
Parameters:
-
enabled
(bool
) –Whether to enable auto depth control.
Source code in blueye/sdk/connection.py
303 304 305 306 307 308 309 310 |
|
set_auto_heading_state
set_auto_heading_state(enabled: bool)
Enable or disable auto heading control.
Parameters:
-
enabled
(bool
) –Whether to enable auto heading control.
Source code in blueye/sdk/connection.py
312 313 314 315 316 317 318 319 |
|
set_gripper_velocities
set_gripper_velocities(grip: float, rotation: float)
Set the gripper velocities.
Parameters:
-
grip
(float
) –The grip velocity.
-
rotation
(float
) –The rotation velocity.
Source code in blueye/sdk/connection.py
365 366 367 368 369 370 371 372 373 374 375 |
|
set_guest_port_lights
set_guest_port_lights(value: float)
Set the intensity of the guest port lights.
Parameters:
-
value
(float
) –The intensity value.
Source code in blueye/sdk/connection.py
242 243 244 245 246 247 248 249 |
|
set_laser_intensity
set_laser_intensity(intensity: float)
Set the laser intensity.
Parameters:
-
intensity
(float
) –The laser intensity value.
Source code in blueye/sdk/connection.py
377 378 379 380 381 382 383 384 |
|
set_lights
set_lights(value: float)
Set the intensity of the lights.
Parameters:
-
value
(float
) –The intensity value.
Source code in blueye/sdk/connection.py
233 234 235 236 237 238 239 240 |
|
set_motion_input
set_motion_input(
surge: float,
sway: float,
heave: float,
yaw: float,
slow: float,
boost: float,
)
Set the motion input values.
Parameters:
-
surge
(float
) –The surge value.
-
sway
(float
) –The sway value.
-
heave
(float
) –The heave value.
-
yaw
(float
) –The yaw value.
-
slow
(float
) –The slow value.
-
boost
(float
) –The boost value.
Source code in blueye/sdk/connection.py
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
|
set_recording_state
set_recording_state(
main_enabled: bool, guestport_enabled: bool
)
Enable or disable recording.
Parameters:
-
main_enabled
(bool
) –Whether to enable main recording.
-
guestport_enabled
(bool
) –Whether to enable guest port recording.
Source code in blueye/sdk/connection.py
348 349 350 351 352 353 354 355 356 357 358 |
|
set_station_keeping_state
set_station_keeping_state(enabled: bool)
Enable or disable station keeping.
Parameters:
-
enabled
(bool
) –Whether to enable station keeping.
Source code in blueye/sdk/connection.py
330 331 332 333 334 335 336 337 |
|
set_tilt_stabilization
set_tilt_stabilization(enabled: bool)
Enable or disable tilt stabilization.
Parameters:
-
enabled
(bool
) –Whether to enable tilt stabilization.
Source code in blueye/sdk/connection.py
269 270 271 272 273 274 275 276 |
|
set_tilt_velocity
set_tilt_velocity(value: float)
Set the tilt velocity.
Parameters:
-
value
(float
) –The tilt velocity value.
Source code in blueye/sdk/connection.py
260 261 262 263 264 265 266 267 |
|
set_water_density
set_water_density(value: float)
Set the water density.
Parameters:
-
value
(float
) –The water density value.
Source code in blueye/sdk/connection.py
251 252 253 254 255 256 257 258 |
|
set_weather_vaning_state
set_weather_vaning_state(enabled: bool)
Enable or disable weather vaning.
Parameters:
-
enabled
(bool
) –Whether to enable weather vaning.
Source code in blueye/sdk/connection.py
339 340 341 342 343 344 345 346 |
|
start
start()
Start the thread's activity.
It must be called at most once per thread object. It arranges for the object's run() method to be invoked in a separate thread of control.
This method will raise a RuntimeError if called more than once on the same thread object.
Source code in python3.13/threading.py
953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 |
|
stop
stop()
Stop the control client thread.
Source code in blueye/sdk/connection.py
229 230 231 |
|
take_still_picture
take_still_picture()
Take a still picture.
Source code in blueye/sdk/connection.py
360 361 362 363 |
|
ReqRepClient
ReqRepClient(
parent_drone: "blueye.sdk.Drone",
context: Context = None,
)
Bases: Thread
A thread that handles request-reply messages to and from the drone.
Parameters:
-
parent_drone
(Drone
) –The parent drone instance.
-
context
(Context
, default:None
) –The ZeroMQ context.
Methods:
-
connect_client
–Connect a client to the drone.
-
disconnect_client
–Disconnect a client from the drone.
-
getName
–Return a string used for identification purposes only.
-
get_camera_parameters
–Get the camera parameters.
-
get_overlay_parameters
–Get the overlay parameters.
-
get_telemetry_msg
–Get a telemetry message.
-
isDaemon
–Return whether this thread is a daemon.
-
is_alive
–Return whether the thread is alive.
-
join
–Wait until the thread terminates.
-
ping
–Send a ping request to the drone.
-
run
–Run the request-reply client thread.
-
setDaemon
–Set whether this thread is a daemon.
-
setName
–Set the name string for this thread.
-
set_camera_parameters
–Set the camera parameters.
-
set_overlay_parameters
–Set the overlay parameters.
-
set_telemetry_msg_publish_frequency
–Set the telemetry message publish frequency.
-
start
–Start the thread's activity.
-
stop
–Stop the request-reply client thread.
-
sync_time
–Synchronize the time with the drone.
Attributes:
-
daemon
–A boolean value indicating whether this thread is a daemon thread.
-
ident
–Thread identifier of this thread or None if it has not been started.
-
name
–A string used for identification purposes only.
-
native_id
–Native integral thread ID of this thread, or None if it has not been started.
Source code in blueye/sdk/connection.py
390 391 392 393 394 395 396 397 398 399 400 401 402 403 |
|
daemon
property
writable
daemon
A boolean value indicating whether this thread is a daemon thread.
This must be set before start() is called, otherwise RuntimeError is raised. Its initial value is inherited from the creating thread; the main thread is not a daemon thread and therefore all threads created in the main thread default to daemon = False.
The entire Python program exits when only daemon threads are left.
ident
property
ident
Thread identifier of this thread or None if it has not been started.
This is a nonzero integer. See the get_ident() function. Thread identifiers may be recycled when a thread exits and another thread is created. The identifier is available even after the thread has exited.
name
property
writable
name
A string used for identification purposes only.
It has no semantics. Multiple threads may be given the same name. The initial name is set by the constructor.
native_id
property
native_id
Native integral thread ID of this thread, or None if it has not been started.
This is a non-negative integer. See the get_native_id() function. This represents the Thread ID as reported by the kernel.
connect_client
connect_client(
client_info: ClientInfo = None,
is_observer: bool = False,
timeout: float = 0.05,
) -> ConnectClientRep
Connect a client to the drone.
Parameters:
-
client_info
(ClientInfo
, default:None
) –The client information.
-
is_observer
(bool
, default:False
) –Whether the client is an observer.
-
timeout
(float
, default:0.05
) –The timeout for the response.
Returns:
-
ConnectClientRep
–The connect client response.
Source code in blueye/sdk/connection.py
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 |
|
disconnect_client
disconnect_client(
client_id: int, timeout: float = 0.05
) -> DisconnectClientRep
Disconnect a client from the drone.
Parameters:
-
client_id
(int
) –The client ID.
-
timeout
(float
, default:0.05
) –The timeout for the response.
Returns:
-
DisconnectClientRep
–The disconnect client response.
Source code in blueye/sdk/connection.py
609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 |
|
getName
getName()
Return a string used for identification purposes only.
This method is deprecated, use the name attribute instead.
Source code in python3.13/threading.py
1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 |
|
get_camera_parameters
get_camera_parameters(
camera: Camera, timeout: float = 0.05
) -> CameraParameters
Get the camera parameters.
Parameters:
-
camera
(Camera
) –The camera instance.
-
timeout
(float
, default:0.05
) –The timeout for the response.
Returns:
-
CameraParameters
–The camera parameters.
Source code in blueye/sdk/connection.py
504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 |
|
get_overlay_parameters
get_overlay_parameters(
timeout: float = 0.05,
) -> OverlayParameters
Get the overlay parameters.
Parameters:
-
timeout
(float
, default:0.05
) –The timeout for the response.
Returns:
-
OverlayParameters
–blueye.protocol.OverlayParameters: The overlay parameters.
Source code in blueye/sdk/connection.py
541 542 543 544 545 546 547 548 549 550 551 552 553 554 |
|
get_telemetry_msg
get_telemetry_msg(
msg: MessageMeta | str, timeout: float = 0.05
) -> GetTelemetryRep
Get a telemetry message.
Parameters:
-
msg
(MessageMeta | str
) –The message type.
-
timeout
(float
, default:0.05
) –The timeout for the response.
Returns:
-
GetTelemetryRep
–The telemetry message.
Source code in blueye/sdk/connection.py
646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 |
|
isDaemon
isDaemon()
Return whether this thread is a daemon.
This method is deprecated, use the daemon attribute instead.
Source code in python3.13/threading.py
1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 |
|
is_alive
is_alive()
Return whether the thread is alive.
This method returns True just before the run() method starts until just after the run() method terminates. See also the module function enumerate().
Source code in python3.13/threading.py
1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 |
|
join
join(timeout=None)
Wait until the thread terminates.
This blocks the calling thread until the thread whose join() method is called terminates -- either normally or through an unhandled exception or until the optional timeout occurs.
When the timeout argument is present and not None, it should be a floating-point number specifying a timeout for the operation in seconds (or fractions thereof). As join() always returns None, you must call is_alive() after join() to decide whether a timeout happened -- if the thread is still alive, the join() call timed out.
When the timeout argument is not present or None, the operation will block until the thread terminates.
A thread can be join()ed many times.
join() raises a RuntimeError if an attempt is made to join the current thread as that would cause a deadlock. It is also an error to join() a thread before it has been started and attempts to do so raises the same exception.
Source code in python3.13/threading.py
1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 |
|
ping
ping(timeout: float) -> PingRep
Send a ping request to the drone.
Parameters:
-
timeout
(float
) –The timeout for the response.
Returns:
-
PingRep
–blueye.protocol.PingRep: The ping response.
Source code in blueye/sdk/connection.py
492 493 494 495 496 497 498 499 500 501 502 |
|
run
run()
Run the request-reply client thread.
Source code in blueye/sdk/connection.py
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 |
|
setDaemon
setDaemon(daemonic)
Set whether this thread is a daemon.
This method is deprecated, use the .daemon property instead.
Source code in python3.13/threading.py
1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 |
|
setName
setName(name)
Set the name string for this thread.
This method is deprecated, use the name attribute instead.
Source code in python3.13/threading.py
1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 |
|
set_camera_parameters
set_camera_parameters(
parameters: CameraParameters, timeout: float = 0.05
) -> SetCameraParametersRep
Set the camera parameters.
Parameters:
-
parameters
(CameraParameters
) –The camera parameters.
-
timeout
(float
, default:0.05
) –The timeout for the response.
Returns:
-
SetCameraParametersRep
–The response message.
Source code in blueye/sdk/connection.py
522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 |
|
set_overlay_parameters
set_overlay_parameters(
parameters: OverlayParameters, timeout: float = 0.05
) -> SetOverlayParametersRep
Set the overlay parameters.
Parameters:
-
parameters
(OverlayParameters
) –The overlay parameters.
-
timeout
(float
, default:0.05
) –The timeout for the response.
Returns:
-
SetOverlayParametersRep
–The response message.
Source code in blueye/sdk/connection.py
556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 |
|
set_telemetry_msg_publish_frequency
set_telemetry_msg_publish_frequency(
msg: MessageMeta | str,
frequency: float,
timeout: float = 0.05,
) -> SetPubFrequencyRep
Set the telemetry message publish frequency.
Parameters:
-
msg
(MessageMeta | str
) –The message type.
-
frequency
(float
) –The publish frequency.
-
timeout
(float
, default:0.05
) –The timeout for the response.
Returns:
-
SetPubFrequencyRep
–The set publish frequency response.
Source code in blueye/sdk/connection.py
626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 |
|
start
start()
Start the thread's activity.
It must be called at most once per thread object. It arranges for the object's run() method to be invoked in a separate thread of control.
This method will raise a RuntimeError if called more than once on the same thread object.
Source code in python3.13/threading.py
953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 |
|
stop
stop()
Stop the request-reply client thread.
Source code in blueye/sdk/connection.py
460 461 462 |
|
sync_time
sync_time(time: int, timeout: float = 0.05) -> SyncTimeRep
Synchronize the time with the drone.
Parameters:
-
time
(int
) –The Unix timestamp to synchronize.
-
timeout
(float
, default:0.05
) –The timeout for the response.
Returns:
-
SyncTimeRep
–The response message.
Source code in blueye/sdk/connection.py
573 574 575 576 577 578 579 580 581 582 583 584 585 586 |
|
TelemetryClient
TelemetryClient(
parent_drone: "blueye.sdk.Drone",
context: Context = None,
)
Bases: Thread
A thread that handles telemetry messages from the drone
Parameters:
-
parent_drone
(Drone
) –The parent drone instance.
-
context
(Context
, default:None
) –The ZeroMQ context.
Methods:
-
add_callback
–Add a callback for telemetry messages.
-
get
–Get the latest received message of a specific type.
-
getName
–Return a string used for identification purposes only.
-
isDaemon
–Return whether this thread is a daemon.
-
is_alive
–Return whether the thread is alive.
-
join
–Wait until the thread terminates.
-
remove_callback
–Remove a callback by its UUID.
-
run
–Run the telemetry client thread.
-
setDaemon
–Set whether this thread is a daemon.
-
setName
–Set the name string for this thread.
-
start
–Start the thread's activity.
-
stop
–Stop the telemetry client thread.
Attributes:
-
daemon
–A boolean value indicating whether this thread is a daemon thread.
-
ident
–Thread identifier of this thread or None if it has not been started.
-
name
–A string used for identification purposes only.
-
native_id
–Native integral thread ID of this thread, or None if it has not been started.
Source code in blueye/sdk/connection.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
daemon
property
writable
daemon
A boolean value indicating whether this thread is a daemon thread.
This must be set before start() is called, otherwise RuntimeError is raised. Its initial value is inherited from the creating thread; the main thread is not a daemon thread and therefore all threads created in the main thread default to daemon = False.
The entire Python program exits when only daemon threads are left.
ident
property
ident
Thread identifier of this thread or None if it has not been started.
This is a nonzero integer. See the get_ident() function. Thread identifiers may be recycled when a thread exits and another thread is created. The identifier is available even after the thread has exited.
name
property
writable
name
A string used for identification purposes only.
It has no semantics. Multiple threads may be given the same name. The initial name is set by the constructor.
native_id
property
native_id
Native integral thread ID of this thread, or None if it has not been started.
This is a non-negative integer. See the get_native_id() function. This represents the Thread ID as reported by the kernel.
add_callback
add_callback(
msg_filter: List[Message],
callback_function: Callable[[str, Message], None],
raw: bool,
**kwargs: Dict[str, Any]
) -> str
Add a callback for telemetry messages.
Parameters:
-
msg_filter
(List[Message]
) –The list of message types to run the callback function for.
-
callback_function
(Callable[[str, Message], None]
) –The callback function.
-
raw
(bool
) –Whether to pass raw data to the callback.
-
**kwargs
(Dict[str, Any]
, default:{}
) –Additional keyword arguments for the callback.
Returns:
-
str
(str
) –The UUID of the callback in hexadecimal format.
Source code in blueye/sdk/connection.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
|
get
get(key: Message) -> bytes
Get the latest received message of a specific type.
Parameters:
-
key
(Message
) –The message type to retrieve.
Returns:
-
bytes
(bytes
) –The serialized message payload.
Source code in blueye/sdk/connection.py
175 176 177 178 179 180 181 182 183 184 185 |
|
getName
getName()
Return a string used for identification purposes only.
This method is deprecated, use the name attribute instead.
Source code in python3.13/threading.py
1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 |
|
isDaemon
isDaemon()
Return whether this thread is a daemon.
This method is deprecated, use the daemon attribute instead.
Source code in python3.13/threading.py
1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 |
|
is_alive
is_alive()
Return whether the thread is alive.
This method returns True just before the run() method starts until just after the run() method terminates. See also the module function enumerate().
Source code in python3.13/threading.py
1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 |
|
join
join(timeout=None)
Wait until the thread terminates.
This blocks the calling thread until the thread whose join() method is called terminates -- either normally or through an unhandled exception or until the optional timeout occurs.
When the timeout argument is present and not None, it should be a floating-point number specifying a timeout for the operation in seconds (or fractions thereof). As join() always returns None, you must call is_alive() after join() to decide whether a timeout happened -- if the thread is still alive, the join() call timed out.
When the timeout argument is not present or None, the operation will block until the thread terminates.
A thread can be join()ed many times.
join() raises a RuntimeError if an attempt is made to join the current thread as that would cause a deadlock. It is also an error to join() a thread before it has been started and attempts to do so raises the same exception.
Source code in python3.13/threading.py
1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 |
|
remove_callback
remove_callback(callback_id: str)
Remove a callback by its UUID.
Parameters:
-
callback_id
(str
) –The UUID of the callback to remove.
Source code in blueye/sdk/connection.py
164 165 166 167 168 169 170 171 172 173 |
|
run
run()
Run the telemetry client thread.
Source code in blueye/sdk/connection.py
130 131 132 133 134 135 136 137 138 139 |
|
setDaemon
setDaemon(daemonic)
Set whether this thread is a daemon.
This method is deprecated, use the .daemon property instead.
Source code in python3.13/threading.py
1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 |
|
setName
setName(name)
Set the name string for this thread.
This method is deprecated, use the name attribute instead.
Source code in python3.13/threading.py
1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 |
|
start
start()
Start the thread's activity.
It must be called at most once per thread object. It arranges for the object's run() method to be invoked in a separate thread of control.
This method will raise a RuntimeError if called more than once on the same thread object.
Source code in python3.13/threading.py
953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 |
|
stop
stop()
Stop the telemetry client thread.
Source code in blueye/sdk/connection.py
187 188 189 |
|
WatchdogPublisher
WatchdogPublisher(
parent_drone: "blueye.sdk.Drone",
context: Context = None,
)
Bases: Thread
A thread that publishes watchdog messages to keep the connection alive.
Parameters:
-
parent_drone
(Drone
) –The parent drone instance.
-
context
(Context
, default:None
) –The ZeroMQ context.
Methods:
-
getName
–Return a string used for identification purposes only.
-
isDaemon
–Return whether this thread is a daemon.
-
is_alive
–Return whether the thread is alive.
-
join
–Wait until the thread terminates.
-
pet_watchdog
–Send a watchdog message.
-
run
–Run the watchdog publisher thread.
-
setDaemon
–Set whether this thread is a daemon.
-
setName
–Set the name string for this thread.
-
start
–Start the thread's activity.
-
stop
–Stop the watchdog thread started by run().
Attributes:
-
daemon
–A boolean value indicating whether this thread is a daemon thread.
-
ident
–Thread identifier of this thread or None if it has not been started.
-
name
–A string used for identification purposes only.
-
native_id
–Native integral thread ID of this thread, or None if it has not been started.
Source code in blueye/sdk/connection.py
26 27 28 29 30 31 32 |
|
daemon
property
writable
daemon
A boolean value indicating whether this thread is a daemon thread.
This must be set before start() is called, otherwise RuntimeError is raised. Its initial value is inherited from the creating thread; the main thread is not a daemon thread and therefore all threads created in the main thread default to daemon = False.
The entire Python program exits when only daemon threads are left.
ident
property
ident
Thread identifier of this thread or None if it has not been started.
This is a nonzero integer. See the get_ident() function. Thread identifiers may be recycled when a thread exits and another thread is created. The identifier is available even after the thread has exited.
name
property
writable
name
A string used for identification purposes only.
It has no semantics. Multiple threads may be given the same name. The initial name is set by the constructor.
native_id
property
native_id
Native integral thread ID of this thread, or None if it has not been started.
This is a non-negative integer. See the get_native_id() function. This represents the Thread ID as reported by the kernel.
getName
getName()
Return a string used for identification purposes only.
This method is deprecated, use the name attribute instead.
Source code in python3.13/threading.py
1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 |
|
isDaemon
isDaemon()
Return whether this thread is a daemon.
This method is deprecated, use the daemon attribute instead.
Source code in python3.13/threading.py
1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 |
|
is_alive
is_alive()
Return whether the thread is alive.
This method returns True just before the run() method starts until just after the run() method terminates. See also the module function enumerate().
Source code in python3.13/threading.py
1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 |
|
join
join(timeout=None)
Wait until the thread terminates.
This blocks the calling thread until the thread whose join() method is called terminates -- either normally or through an unhandled exception or until the optional timeout occurs.
When the timeout argument is present and not None, it should be a floating-point number specifying a timeout for the operation in seconds (or fractions thereof). As join() always returns None, you must call is_alive() after join() to decide whether a timeout happened -- if the thread is still alive, the join() call timed out.
When the timeout argument is not present or None, the operation will block until the thread terminates.
A thread can be join()ed many times.
join() raises a RuntimeError if an attempt is made to join the current thread as that would cause a deadlock. It is also an error to join() a thread before it has been started and attempts to do so raises the same exception.
Source code in python3.13/threading.py
1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 |
|
pet_watchdog
pet_watchdog(duration)
Send a watchdog message.
Parameters:
-
duration
(int
) –The duration of the connection.
Source code in blueye/sdk/connection.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
run
run()
Run the watchdog publisher thread.
Source code in blueye/sdk/connection.py
34 35 36 37 38 39 40 |
|
setDaemon
setDaemon(daemonic)
Set whether this thread is a daemon.
This method is deprecated, use the .daemon property instead.
Source code in python3.13/threading.py
1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 |
|
setName
setName(name)
Set the name string for this thread.
This method is deprecated, use the name attribute instead.
Source code in python3.13/threading.py
1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 |
|
start
start()
Start the thread's activity.
It must be called at most once per thread object. It arranges for the object's run() method to be invoked in a separate thread of control.
This method will raise a RuntimeError if called more than once on the same thread object.
Source code in python3.13/threading.py
953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 |
|
stop
stop()
Stop the watchdog thread started by run().
Source code in blueye/sdk/connection.py
58 59 60 |
|