Skip to content

Commit

Permalink
Merge pull request #106 from BluEye-Robotics/oculus-sonar
Browse files Browse the repository at this point in the history
Add multibeam protocol definition
  • Loading branch information
jp-pino authored May 28, 2024
2 parents 235ef5f + 21acf46 commit aa09cf2
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci-dotnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
- name: Push generated package to GitHub registry
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: dotnet nuget push ./out/*.nupkg --skip-duplicate --no-symbols --api-key $NUGET_AUTH_TOKEN
run: dotnet nuget push ./out/*.nupkg --skip-duplicate --no-symbols --api-key $NUGET_AUTH_TOKEN
14 changes: 14 additions & 0 deletions protobuf_definitions/control.proto
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,17 @@ message SetAquaTrollConnectionStatusCtrl {
// Message with information about which parameter to set and the unit to set it to.
SetAquaTrollConnectionStatus connection_status = 1;
}

// Update multibeam settings
message SetMultibeamConfigCtrl {
MultibeamConfig config = 1; // Message with the multibeam ping configuration to set.
}

// Activate multibeam
message ActivateMultibeamCtrl {
MultibeamConfig config = 1; // Message with the multibeam ping configuration to set on connect
}

// Deactivate multibeam
message DeactivateMultibeamCtrl {
}
78 changes: 78 additions & 0 deletions protobuf_definitions/message_formats.proto
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ message RecordState {
int32 main_seconds = 2; // Main record time (s)
bool guestport_is_recording = 3; // If the guestport camera is recording
int32 guestport_seconds = 4; // Guestport record time (s)
bool multibeam_is_recording = 5; // If the multibeam is recording
int32 multibeam_seconds = 6; // Multibeam record time (s)
}

// Interval type for time-lapse photos.
Expand Down Expand Up @@ -509,6 +511,7 @@ message DiveTime {
message RecordOn {
bool main = 1; // Record the main camera
bool guestport = 2; // Record external camera
bool multibeam = 3; // Record multibeam
}

// Storage space.
Expand Down Expand Up @@ -940,3 +943,78 @@ message MedusaSpectrometerData {
uint32 countrate = 4; // Counts per second inside the spectrum (rounded)
uint32 cosmics = 5; // Detected counts above the last channel
}

enum MultibeamFrequencyMode {
MULTIBEAM_FREQUENCY_MODE_UNSPECIFIED = 0;
MULTIBEAM_FREQUENCY_MODE_AUTO = 1; // Auto switching mode (if available)
MULTIBEAM_FREQUENCY_MODE_LOW_FREQUENCY = 2; // Low frequency mode (wide aperture, navigation)
MULTIBEAM_FREQUENCY_MODE_HIGH_FREQUENCY = 3; // High frequency mode (narrow aperture, target identification)
}

// Multibeam sonar ping
//
// Contains all the information for rendering a multibeam sonar frame
message MultibeamPing {
double range = 1; // Maximum range value (m)
double gain = 2; // Percentage of gain (0 to 1)
double frequency = 3; // Ping acoustic frequency (Hz)
double speed_of_sound_used = 4; // Speed of sound used by the sonar for range calculations (m/s)
MultibeamFrequencyMode frequency_mode = 5; // Frequency mode used by the sonar for this frame
uint32 number_of_ranges = 6; // Height of the ping image data.
uint32 number_of_beams = 7; // Width of the ping image data.
uint32 step = 8; // Size in bytes of each row in the ping data image.

// Bearing angle of each column of the sonar data
// (in 100th of a degree, multiply by 0.01 to get a value in degrees).
// The sonar image is not sampled uniformly in the bearing direction.
repeated float bearings = 9;

bytes ping_data = 10; // Ping data (row major, 2D, grayscale image)
GuestPortDeviceID device_id = 11; // Device ID of the sonar
}


// Configuration message for sonar devices
message MultibeamConfig {
MultibeamFrequencyMode frequency_mode = 1; // Frequency mode used by the sonar if supported

enum PingRate {
PING_RATE_UNSPECIFIED = 0;
PING_RATE_NORMAL = 1; // 10Hz max ping rate
PING_RATE_HIGH = 2; // 15Hz max ping rate
PING_RATE_HIGHEST = 3; // 40Hz max ping rate
PING_RATE_LOW = 4; // 5Hz max ping rate
PING_RATE_LOWEST = 5; // 2Hz max ping rate
PING_RATE_STANDBY = 6; // Disable ping
}

PingRate ping_rate = 2; // Sets the maximum ping rate.
double gamma_correction = 3; // Gamma correction (0..1.0)
bool gain_assist = 4; // Enable gain assist

enum MaximumNumberOfBeams {
MAXIMUM_NUMBER_OF_BEAMS_UNSPECIFIED = 0;
MAXIMUM_NUMBER_OF_BEAMS_MAX_128 = 1; // 128 beams
MAXIMUM_NUMBER_OF_BEAMS_MAX_256 = 2; // 256 beams
MAXIMUM_NUMBER_OF_BEAMS_MAX_512 = 3; // 512 beams
MAXIMUM_NUMBER_OF_BEAMS_MAX_1024 = 4; // 1024 beams
}

MaximumNumberOfBeams maximum_number_of_beams = 5; // Maximum number of beams. Used to throttle bandwidth.

double range = 6; // The range demand (m)
double gain = 7; // The gain demand (0..1)
double salinity = 8; // Set water salinity (ppt). Defaults to zero in fresh water
GuestPortDeviceID device_id = 9; // Device ID of the sonar
}

// Discovery message for sonar devices
message MultibeamDiscovery {
bool enabled = 1; // If the sonar driver is enabled
string ip = 2; // IP address of the sonar
string mask = 3; // Subnet mask of the sonar
string serial_number = 4; // Serial number of the sonar
string fw_version = 5; // Firmware version of the sonar
string connected_ip = 6; // IP address of the connected device
GuestPortDeviceID device_id = 7; // Device ID of the sonar
}
15 changes: 15 additions & 0 deletions protobuf_definitions/telemetry.proto
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,18 @@ message Imu2Tel {
message MedusaSpectrometerDataTel {
MedusaSpectrometerData data = 1;
}

// Multibeam sonar ping data
message MultibeamPingTel {
MultibeamPing ping = 1; // Ping data from a multibeam sonar
}

// Multibeam sonar config
message MultibeamConfigTel {
MultibeamConfig config = 1; // Config data from a multibeam sonar
}

// Multibeam sonar status message
message MultibeamDiscoveryTel {
MultibeamDiscovery discovery = 1; // Discovery data from a multibeam sonar
}

0 comments on commit aa09cf2

Please sign in to comment.