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

Distance sensor server #1964

Merged

Conversation

potaito
Copy link
Contributor

@potaito potaito commented Jan 26, 2023

Related PRs

Description

Implements the publisher for distance sensor measurements. Need to merge Proto changes first.

@potaito potaito changed the title Potaito/distance sensor server Distance sensor server Jan 31, 2023
@potaito potaito force-pushed the potaito/distance-sensor-server branch from 3f7bbb5 to dfdc85f Compare January 31, 2023 10:54
@potaito
Copy link
Contributor Author

potaito commented Jan 31, 2023

I'm getting a diff in auto-generated code that is related to this change in Proto that was not accounted for in MAVSDK yet: mavlink/MAVSDK-Proto#306

git status
On branch potaito/distance-sensor-server
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   src/mavsdk/plugins/camera/camera.cpp
	modified:   src/mavsdk/plugins/camera/include/plugins/camera/camera.h
	modified:   src/mavsdk_server/src/generated/camera/camera.pb.cc
	modified:   src/mavsdk_server/src/generated/camera/camera.pb.h
	modified:   src/mavsdk_server/src/plugins/camera/camera_service_impl.h

How should we go about this? I could commit the diff since the changes don't include new logic, just a new enum field for RESULT_PROTOCOL_UNSUPPORTED that was added in the aforementioned PR in MAVSDK-Proto.
The logic that would actually do something with the field would still need to be implemented by @julianoes or someone else.

@potaito potaito marked this pull request as ready for review January 31, 2023 10:56
@JonasVautherin
Copy link
Collaborator

How should we go about this? I could commit the diff since the changes don't include new logic

Yeah I'd say just commit it, it's not breaking anything, just adding an enum value 👍

JonasVautherin
JonasVautherin previously approved these changes Jan 31, 2023
Caused by this addition to Proto
mavlink/MAVSDK-Proto#306

Should be a non-breaking change since it only extends an existing enum.
@potaito
Copy link
Contributor Author

potaito commented Jan 31, 2023

Good to go from my end. The message is currently quite limited since in MAVSDK-Proto only the most basic fields of DISTANCE_SENSOR are defined. I can extend the message definition at a later point.

This is what the current implementation sends out with the example values

  • min distance: 0.1m
  • max distance: 25m
  • current distance: 16m
Payload: DISTANCE_SENSOR (132)
    time_boot_ms (uint32): 0
    min_distance (uint16): 10
    max_distance (uint16): 2500
    current_distance (uint16): 1600
    type (uint8): 4            <- UNKNOWN sensor type
    id (uint8): 0
    orientation (uint8): 0     <- ORIENTATION_NONE
    covariance (uint8): 255    <- INVALID covariance
    horizontal_fov (float): 0  <- UNKNOWN field of view
    vertical_fov (float): 0    <- UNKNOWN field of view
    quaternion[0] (float): 0   <- INVALID quaternion
    quaternion[1] (float): 0
    quaternion[2] (float): 0
    quaternion[3] (float): 0
    signal_quality (uint8): 0  <- UNKNOWN signal quality

@JonasVautherin JonasVautherin merged commit e2eb37e into mavlink:main Jan 31, 2023
@potaito potaito deleted the potaito/distance-sensor-server branch January 31, 2023 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants