blueye.sdk.utils
utils
Classes:
-
deprecated_property–Property shim that warns and delegates to the new getter/setter methods.
Functions:
-
deserialize_any_to_message–Deserialize a protobuf Any message to a concrete message type.
-
is_scalar_type–Check if a message is a scalar type
-
open_local_documentation–Open a pre-built local version of the SDK documentation
deprecated_property
deprecated_property(
fget: str,
fset: Optional[str] = None,
doc: Optional[str] = None,
)
Property shim that warns and delegates to the new getter/setter methods.
fget/fset are the names of the replacement methods on the owning class. This is always a
data descriptor (it defines __set__) so that assignments to read-only deprecated properties
raise an AttributeError instead of silently shadowing the descriptor with an instance attribute.
Source code in blueye/sdk/utils.py
33 34 35 36 | |
deserialize_any_to_message
deserialize_any_to_message(
msg: Any,
) -> Tuple[MessageMeta, Message]
Deserialize a protobuf Any message to a concrete message type.
Parameters:
-
msg(Any) –The Any message to deserialize. Needs to be a message defined in the blueye.protocol package or a well-known-type (FloatValue, Int32Value, etc) from google.protobuf.wrappers_pb2
Returns:
-
Tuple[MessageMeta, Message]–A tuple with the message type and the deserialized message.
Source code in blueye/sdk/utils.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
is_scalar_type
is_scalar_type(msg: Message) -> bool
Check if a message is a scalar type
Parameters:
-
msg(Message) –The message to check
Returns:
-
bool–True if the message is a scalar type, False otherwise
Source code in blueye/sdk/utils.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
open_local_documentation
open_local_documentation()
Open a pre-built local version of the SDK documentation
Useful when you are connected to the drone wifi, and don't have access to the online version.
Source code in blueye/sdk/utils.py
65 66 67 68 69 70 71 72 73 74 75 | |