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.
Functions:
-
message_type_name–Return the short name of a message type, as the drone's requests expect it.
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.
function
instance-attribute
function: Callable[[str, Message], None]
kwargs
instance-attribute
kwargs: Dict[str, Any]
message_filter
instance-attribute
message_filter: List[Message]
pass_raw_data
instance-attribute
pass_raw_data: bool
uuid_hex
instance-attribute
uuid_hex: str
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:
-
__repr__– -
clear_mission– -
flush–Wait until every queued control message has been handed to the socket.
-
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.
-
pause_mission– -
rescan_cv_models–Ask the drone to rescan the installed computer vision model packages.
-
run–Run the control client thread.
-
run_mission– -
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_camera_pan_tilt_zoom–Set the digital pan, tilt and zoom of the main camera.
-
set_color_correction–Set the color correction filter on the main camera.
-
set_generic_servo_angle–Set the position of a generic servo from an angle in -90..90 degrees.
-
set_generic_servo_position–Set the position of a generic servo on a guest port.
-
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_multibeam_servo_angle–Set the angle of the servo on the multibeam skid.
-
set_recording_state–Set the recording state of every recorder at once.
-
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_turbidity_filter–Set the turbidity filter on the main camera.
-
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, after sending what is still queued.
-
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
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | |
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.
__repr__
__repr__()
Source code in python3.13/threading.py
943 944 945 946 947 948 949 950 951 952 953 954 | |
clear_mission
clear_mission()
Source code in blueye/sdk/connection.py
525 526 527 | |
flush
flush(timeout: float = 1.0) -> bool
Wait until every queued control message has been handed to the socket.
The messages are sent from the thread, so a message queued right before
stop or
disconnect would otherwise be lost.
Parameters:
-
timeout(float, default:1.0) –Seconds to wait for the queue to drain.
Returns:
-
bool–True if the queue is empty, False if it still held messages when the time ran out.
Source code in blueye/sdk/connection.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |
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
1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | |
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
1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 | |
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
1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 | |
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
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 1093 1094 1095 | |
pause_mission
pause_mission()
Source code in blueye/sdk/connection.py
521 522 523 | |
rescan_cv_models
rescan_cv_models()
Ask the drone to rescan the installed computer vision model packages.
Source code in blueye/sdk/connection.py
513 514 515 | |
run
run()
Run the control client thread.
Source code in blueye/sdk/connection.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | |
run_mission
run_mission()
Source code in blueye/sdk/connection.py
517 518 519 | |
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
1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 | |
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
1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 | |
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
389 390 391 392 393 394 395 396 | |
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
371 372 373 374 375 376 377 378 | |
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
380 381 382 383 384 385 386 387 | |
set_camera_pan_tilt_zoom
set_camera_pan_tilt_zoom(
pan: float, tilt: float, zoom: float
)
Set the digital pan, tilt and zoom of the main camera.
Parameters:
-
pan(float) –Horizontal pan (-1..1), 0 is centre.
-
tilt(float) –Vertical tilt (-1..1), 0 is centre.
-
zoom(float) –Zoom level (0..1), 0 is no zoom.
Source code in blueye/sdk/connection.py
500 501 502 503 504 505 506 507 508 509 510 511 | |
set_color_correction
set_color_correction(enabled: bool, intensity: float)
Set the color correction filter on the main camera.
Parameters:
-
enabled(bool) –Whether the filter is enabled.
-
intensity(float) –The filter intensity (0..1).
Source code in blueye/sdk/connection.py
488 489 490 491 492 493 494 495 496 497 498 | |
set_generic_servo_angle
set_generic_servo_angle(
angle: float, gp_number: GuestPortNumber
) -> None
Set the position of a generic servo from an angle in -90..90 degrees.
Deprecated, the protocol takes a 0..1 position and not an angle. Use
set_generic_servo_position.
Parameters:
-
angle(float) –The angle in degrees (-90..90), mapped linearly onto 0..1.
-
gp_number(GuestPortNumber) –The guest port number.
Source code in blueye/sdk/connection.py
552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 | |
set_generic_servo_position
set_generic_servo_position(
position: float, gp_number: GuestPortNumber
) -> None
Set the position of a generic servo on a guest port.
Parameters:
-
position(float) –The position (0..1), the drone clamps values outside that range.
-
gp_number(GuestPortNumber) –The guest port number.
Source code in blueye/sdk/connection.py
538 539 540 541 542 543 544 545 546 547 548 549 550 | |
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
454 455 456 457 458 459 460 461 462 463 464 | |
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
298 299 300 301 302 303 304 305 | |
set_laser_intensity
set_laser_intensity(
intensity: float, modulated: bool = False
)
Set the laser intensity.
Parameters:
-
intensity(float) –The laser intensity value.
-
modulated(bool, default:False) –Modulate the laser at 5 Hz for dot tracking.
Source code in blueye/sdk/connection.py
466 467 468 469 470 471 472 473 474 | |
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
289 290 291 292 293 294 295 296 | |
set_motion_input
set_motion_input(
surge: float,
sway: float,
heave: float,
yaw: float,
slow: float,
boost: float,
roll: float = 0.0,
pitch: float = 0.0,
)
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.
-
roll(float, default:0.0) –The roll value. Only the Blueye X7 acts on it.
-
pitch(float, default:0.0) –The pitch value. Only the Blueye X7 acts on it.
Source code in blueye/sdk/connection.py
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | |
set_multibeam_servo_angle
set_multibeam_servo_angle(angle: float) -> None
Set the angle of the servo on the multibeam skid.
Parameters:
-
angle(float) –The angle in degrees.
Source code in blueye/sdk/connection.py
529 530 531 532 533 534 535 536 | |
set_recording_state
set_recording_state(
main_enabled: bool,
guestport_enabled: bool,
multibeam_enabled: Optional[bool] = None,
)
Set the recording state of every recorder at once.
The drone applies all three flags from one RecordCtrl, so a recorder left out of the
message is stopped. Pass the current state of the recorders that should not change.
Parameters:
-
main_enabled(bool) –Whether the main camera records.
-
guestport_enabled(bool) –Whether the guest port camera records.
-
multibeam_enabled(bool, default:None) –Whether the multibeam records. Left out, the state the drone last reported in
RecordStateTelis kept, or off if the drone has not reported one.
Source code in blueye/sdk/connection.py
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 | |
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
398 399 400 401 402 403 404 405 | |
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
325 326 327 328 329 330 331 332 | |
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
316 317 318 319 320 321 322 323 | |
set_turbidity_filter
set_turbidity_filter(enabled: bool, intensity: float)
Set the turbidity filter on the main camera.
Parameters:
-
enabled(bool) –Whether the filter is enabled.
-
intensity(float) –The filter intensity (0..1).
Source code in blueye/sdk/connection.py
476 477 478 479 480 481 482 483 484 485 486 | |
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
307 308 309 310 311 312 313 314 | |
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
407 408 409 410 411 412 413 414 | |
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
956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 | |
stop
stop()
Stop the control client thread, after sending what is still queued.
Source code in blueye/sdk/connection.py
283 284 285 286 287 | |
take_still_picture
take_still_picture()
Take a still picture.
Source code in blueye/sdk/connection.py
449 450 451 452 | |
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:
-
__repr__– -
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_active_mission–Get the active mission from the drone
-
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_mission–Send a new mission to the drone
-
set_overlay_parameters–Set the overlay parameters.
-
set_telemetry_msg_log_frequency–Set how often a telemetry message is written to the dive log.
-
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
585 586 587 588 589 590 591 592 593 594 595 596 597 598 | |
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.
__repr__
__repr__()
Source code in python3.13/threading.py
943 944 945 946 947 948 949 950 951 952 953 954 | |
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
799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 | |
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
820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 | |
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
1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | |
get_active_mission
get_active_mission(timeout: float = 0.05) -> GetMissionRep
Get the active mission from the drone
Source code in blueye/sdk/connection.py
893 894 895 896 | |
get_camera_parameters
get_camera_parameters(
camera: Camera, timeout: float = 0.5
) -> CameraParameters
Get the camera parameters.
Parameters:
-
camera(Camera) –The camera instance.
-
timeout(float, default:0.5) –The timeout for the response.
Returns:
-
CameraParameters–The camera parameters.
Source code in blueye/sdk/connection.py
715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 | |
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
752 753 754 755 756 757 758 759 760 761 762 763 764 765 | |
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
877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 | |
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
1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 | |
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
1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 | |
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
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 1093 1094 1095 | |
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
703 704 705 706 707 708 709 710 711 712 713 | |
run
run()
Run the request-reply client thread.
Source code in blueye/sdk/connection.py
629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 | |
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
1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 | |
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
1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 | |
set_camera_parameters
set_camera_parameters(
parameters: CameraParameters, timeout: float = 0.5
) -> SetCameraParametersRep
Set the camera parameters.
Parameters:
-
parameters(CameraParameters) –The camera parameters.
-
timeout(float, default:0.5) –The timeout for the response.
Returns:
-
SetCameraParametersRep–The response message.
Source code in blueye/sdk/connection.py
733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 | |
set_mission
set_mission(
mission: Mission, timeout: float = 0.05
) -> SetMissionRep
Send a new mission to the drone
Requires that the drone is ready to receive a new mission.
Source code in blueye/sdk/connection.py
898 899 900 901 902 903 904 905 906 | |
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
767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 | |
set_telemetry_msg_log_frequency
set_telemetry_msg_log_frequency(
msg: MessageMeta | str,
frequency: float,
timeout: float = 0.05,
) -> SetLogFrequencyRep
Set how often a telemetry message is written to the dive log.
Parameters:
-
msg(MessageMeta | str) –The message type.
-
frequency(float) –The log frequency.
-
timeout(float, default:0.05) –The timeout for the response.
Returns:
-
SetLogFrequencyRep–The set log frequency response.
Source code in blueye/sdk/connection.py
857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 | |
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
837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 | |
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
956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 | |
stop
stop()
Stop the request-reply client thread.
Source code in blueye/sdk/connection.py
671 672 673 | |
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
784 785 786 787 788 789 790 791 792 793 794 795 796 797 | |
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:
-
__repr__– -
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
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
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.
__repr__
__repr__()
Source code in python3.13/threading.py
943 944 945 946 947 948 949 950 951 952 953 954 | |
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
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | |
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
205 206 207 208 209 210 211 212 213 214 215 | |
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
1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | |
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
1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 | |
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
1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 | |
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
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 1093 1094 1095 | |
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
192 193 194 195 196 197 198 199 200 201 202 203 | |
run
run()
Run the telemetry client thread.
Source code in blueye/sdk/connection.py
157 158 159 160 161 162 163 164 165 166 | |
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
1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 | |
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
1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 | |
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
956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 | |
stop
stop()
Stop the telemetry client thread.
Source code in blueye/sdk/connection.py
217 218 219 | |
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:
-
__repr__– -
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
28 29 30 31 32 33 34 | |
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.
__repr__
__repr__()
Source code in python3.13/threading.py
943 944 945 946 947 948 949 950 951 952 953 954 | |
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
1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | |
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
1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 | |
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
1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 | |
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
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 1093 1094 1095 | |
pet_watchdog
pet_watchdog(duration)
Send a watchdog message.
Nothing is sent before the drone has handed out a client id. A pet with client id 0 counts as the client in control whenever nobody is, so an unregistered client must stay quiet.
Parameters:
-
duration(int) –The duration of the connection.
Source code in blueye/sdk/connection.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
run
run()
Run the watchdog publisher thread.
The first pet goes out after a second, not at once. The control socket that carries the zero setpoint sent on connect has only just been opened, and a PUB socket can drop what it is given before its subscription is set up, so the delay gives the zero a head start. The drone pets its own watchdog on a control handover anyway.
Source code in blueye/sdk/connection.py
36 37 38 39 40 41 42 43 44 45 46 47 48 | |
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
1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 | |
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
1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 | |
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
956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 | |
stop
stop()
Stop the watchdog thread started by run().
Source code in blueye/sdk/connection.py
72 73 74 | |
message_type_name
message_type_name(msg: MessageMeta | str) -> str
Return the short name of a message type, as the drone's requests expect it.
Both blueye.protocol.DepthTel and "blueye.protocol.DepthTel" give "DepthTel".
Source code in blueye/sdk/connection.py
573 574 575 576 577 578 579 | |