Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to protocol v3 #123

Merged
merged 97 commits into from
Jul 5, 2023
Merged

Port to protocol v3 #123

merged 97 commits into from
Jul 5, 2023

Conversation

sindrehan
Copy link
Member

@sindrehan sindrehan commented Feb 23, 2023

Todo:

Breaking changes:

  • Removed slave-mode
  • Update range for lights from 0-255 to 0-1
  • Require Blunux v3.1 or newer
  • Error flags is a dict of bools instead of int
  • active streams is a dict with main and guestport
  • Water density is kg/L instead of g/L
  • Camera stabilization is enable/disable instead of toggle
  • Renamed tilt_speed to tilt_velocity
  • State of charge range is 0..1 instead of 0..100
  • Custom overlay classes have been replaced with enums from blueye.protocol
  • Properties that read telemetry data (lights, tilt_angle, dept, pose, battery_state_of_charge, error_flags, active_video_streams, auto_depth_active, auto_heading_active) will now return None if no telemetry message has been received yet from the drone.

@sindrehan sindrehan added the enhancement New feature or request label Feb 23, 2023
@sindrehan sindrehan self-assigned this Feb 23, 2023
blueye/sdk/connection.py Fixed Show fixed Hide fixed
tests/conftest.py Fixed Show fixed Hide fixed
blueye/sdk/drone.py Fixed Show fixed Hide fixed
blueye/sdk/drone.py Fixed Show fixed Hide fixed
@codecov
Copy link

codecov bot commented Feb 28, 2023

Codecov Report

Merging #123 (79f9eff) into master (5bedc48) will decrease coverage by 14.14%.
The diff coverage is 58.26%.

@@             Coverage Diff             @@
##           master     #123       +/-   ##
===========================================
- Coverage   84.93%   70.80%   -14.14%     
===========================================
  Files           8       10        +2     
  Lines         717      942      +225     
===========================================
+ Hits          609      667       +58     
- Misses        108      275      +167     
Flag Coverage Δ
macos-latest_3.10 70.80% <58.26%> (?)
macos-latest_3.11 70.80% <58.26%> (?)
macos-latest_3.8 70.80% <58.26%> (?)
macos-latest_3.9 70.80% <58.26%> (?)
macos_python310 ?
macos_python37 ?
macos_python38 ?
macos_python39 ?
ubuntu-latest_3.10 70.80% <58.26%> (?)
ubuntu-latest_3.11 70.80% <58.26%> (?)
ubuntu-latest_3.8 70.80% <58.26%> (?)
ubuntu-latest_3.9 70.80% <58.26%> (?)
ubuntu_python310 ?
ubuntu_python37 ?
ubuntu_python38 ?
ubuntu_python39 ?
windows-latest_3.10 70.77% <58.26%> (?)
windows-latest_3.11 70.77% <58.26%> (?)
windows-latest_3.8 70.77% <58.26%> (?)
windows-latest_3.9 70.77% <58.26%> (?)
windows_python310 ?
windows_python37 ?
windows_python38 ?
windows_python39 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
blueye/sdk/__init__.py 100.00% <ø> (ø)
blueye/sdk/connection.py 38.94% <38.94%> (ø)
blueye/sdk/motion.py 70.65% <41.17%> (+6.00%) ⬆️
blueye/sdk/camera.py 79.41% <67.38%> (-9.01%) ⬇️
blueye/sdk/drone.py 73.36% <67.60%> (-11.21%) ⬇️
blueye/sdk/battery.py 85.71% <85.71%> (ø)
blueye/sdk/constants.py 100.00% <100.00%> (ø)

@sindrehan sindrehan force-pushed the port-to-new-protocol branch 4 times, most recently from 6641aa3 to 989f01f Compare March 1, 2023 14:30
@sindrehan sindrehan force-pushed the port-to-new-protocol branch from 989f01f to e2fc581 Compare March 10, 2023 20:13
blueye/sdk/connection.py Fixed Show fixed Hide fixed
@sindrehan sindrehan added this to the v2.0 milestone May 9, 2023
@sindrehan sindrehan force-pushed the port-to-new-protocol branch from f3226c4 to 991f7f1 Compare May 9, 2023 09:14
@sindrehan sindrehan marked this pull request as ready for review May 10, 2023 13:55
blueye/sdk/connection.py Fixed Show fixed Hide fixed
@johannesschrimpf johannesschrimpf self-assigned this May 30, 2023
johannesschrimpf and others added 23 commits June 21, 2023 09:43
Needed to be able to use the |-operator for python < 3.10
Provides some measure of type safety, and a bonus allows the editor to
auto-complete the get function
We use snake case everywhere else in the SDK, so having this be
CamelCase makes no sense.
Will make it easier to expose more of the battery properties in the
future
Need to import annotations to support the |-operator in python <3.10
Having this class be the default for the client
attributes (telemetry_watcher, ctrl_client, etc) automatically makes
the error messages much better.
Generated with `protoc-gen-doc.sh` in `ProtocolDefinitions` checked
out at the same commit as the submodule in v2.2.0 of
`blueye.protocol`.

Manually removed the Table of content from the markdown file (since
MkDocs generates a ToC as well)
@sindrehan sindrehan force-pushed the port-to-new-protocol branch from 11f3f98 to 4aeea7e Compare June 21, 2023 07:43
@sindrehan sindrehan requested a review from alexagv June 21, 2023 08:18
Neater to encapsulate the catching of the KeyError exception and also
nice to get the automatic deserialization.
@sindrehan sindrehan merged commit b879a6c into master Jul 5, 2023
@sindrehan sindrehan deleted the port-to-new-protocol branch July 5, 2023 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add example documentation for subscribing to a sensor
2 participants