Skip to content

Commit

Permalink
Claire/proto cleanup (#124)
Browse files Browse the repository at this point in the history
Co-authored-by: claire <[email protected]>
  • Loading branch information
lullabee and claire authored Aug 10, 2023
1 parent e7f4903 commit be41bac
Show file tree
Hide file tree
Showing 11 changed files with 84 additions and 353 deletions.
9 changes: 3 additions & 6 deletions protos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
farm_ng_add_protobufs(farm_ng_amiga_proto_defs
NAMESPACE farm_ng_amiga
INCLUDE_DIRS
${Sophus_PROTO_DIR}
${farm_ng_core_PROTO_DIR}
PROTO_FILES
farm_ng/amiga/amiga.proto
farm_ng/canbus/amiga_v6.proto
farm_ng/canbus/canbus.proto
farm_ng/gps/gps.proto
farm_ng/health_monitor/health_monitor.proto
farm_ng/imu/imu.proto
farm_ng/oak/oak.proto
farm_ng/service/service.proto
DEPENDENCIES
Sophus::sophus_linalg_proto_defs
Sophus::sophus_lie_proto_defs
farm_ng_core::farm_ng_core_proto_defs
farm_ng_core::farm_ng_core_proto_defs
)
45 changes: 45 additions & 0 deletions protos/farm_ng/amiga/amiga.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright (c) farm-ng, inc.
//
// Licensed under the Amiga Development Kit License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://github.com/farm-ng/amiga-dev-kit/blob/main/LICENSE
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Copyright (c) farm-ng, inc. All rights reserved.

syntax = "proto3";

import "farm_ng/gps/gps.proto";

import "farm_ng/core/linalg.proto";
import "farm_ng/core/pose.proto";

package farm_ng.amiga.proto;

message AmigaRobotConfig {
repeated WheelConfig wheels = 1;
// List of poses
farm_ng.core.proto.PoseTree pose_tree = 6;
}

message WheelConfig {
// User friendly identifier (front-left, ...)
string name = 1;

// ID of motor controller on canbus
uint32 canbus_id = 2;

// Gear reduction.
// E.g. 1000 rpm motor turns wheel at wheel_from_motor_rate * 1000 rpm.
double wheel_from_motor_rate = 4;

// diameter of wheel (in contact with ground) in meters
double wheel_diameter_m = 5;
}
58 changes: 0 additions & 58 deletions protos/farm_ng/annotations/annotations.proto

This file was deleted.

75 changes: 0 additions & 75 deletions protos/farm_ng/canbus/canbus.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,6 @@ syntax = "proto3";

package farm_ng.canbus.proto;

service CanbusService {
// Streams raw messages received on the CAN bus
rpc streamCanbusMessages(StreamCanbusRequest)
returns (stream StreamCanbusReply) {}
// Sends messages on the CAN bus
rpc sendCanbusMessage(stream SendCanbusMessageRequest)
returns (stream SendCanbusMessageReply) {}

// Streams the states of all detected motors.
// Motors not actively streaming their state will not appear in the StreamMotorStatesReply
rpc streamMotorStates(StreamMotorStatesRequest)
returns (stream StreamMotorStatesReply) {}

// Streams vehicle twist states received on the CAN bus
rpc streamVehicleTwistState(StreamVehicleTwistStateRequest)
returns (stream StreamVehicleTwistStateReply) {}

// Sends twist vehicle commands on the CAN bus
// and responds with the most recent received twist state.
rpc sendVehicleTwistCommand(stream SendVehicleTwistCommandRequest)
returns (stream SendVehicleTwistCommandReply) {}
}

message StreamCanbusRequest {
}

message StreamCanbusReply {
RawCanbusMessages messages = 1;
}

message SendCanbusMessageRequest {
RawCanbusMessage message = 1;
}

message SendCanbusMessageReply {
bool success = 1;
}

// Message to send a twist command to the vehicle
message Twist2d {
// The commanded linear velocity of the vehicle in the x direction in meters per second
Expand All @@ -64,34 +26,6 @@ message Twist2d {
float angular_velocity = 3;
}

// Message to send a twist command to the vehicle
message StreamVehicleTwistStateRequest {
}

// Message to send a twist command to the vehicle
message StreamVehicleTwistStateReply {
// The time the message is "received" / "sent" on the canbus
double stamp = 1;
// The state of the vehicle
Twist2d state = 2;
}

// Message to send a twist command to the vehicle
message SendVehicleTwistCommandRequest {
// The commanded twist to the vehicle
Twist2d command = 1;
}

// Message to send a twist command to the vehicle
message SendVehicleTwistCommandReply {
// Whether the command was successfully sent
bool success = 1;
// The time the message is "received" / "sent" on the canbus
double stamp = 2;
// The state of the vehicle
Twist2d state = 3;
}

message RawCanbusMessage {
// The time the message is "received" / "sent" on the canbus
// in the steady_clock/time.montonic() time domain
Expand All @@ -106,9 +40,6 @@ message RawCanbusMessages {
repeated RawCanbusMessage messages = 1;
}

message StreamMotorStatesRequest {
}

// Enum of motor controller states
enum MotorControllerStatus {
// TODO: Do we want to replace uint32 status=3; in MotorState with this enum?
Expand All @@ -131,9 +62,3 @@ message MotorState {
double current = 6; // Motor current draw, as measured at motor controller
int32 temperature = 7; // Motor temperature
}

// Packages multiple MotorState's for the client
message StreamMotorStatesReply {
// List of MotorState's
repeated MotorState motors = 1;
}
19 changes: 0 additions & 19 deletions protos/farm_ng/gps/gps.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@ import "farm_ng/core/timestamp.proto";

package farm_ng.gps.proto;

service GpsService {
rpc streamFrames(StreamFramesRequest) returns (stream StreamFramesReply) {}
rpc streamRelativePositionFrames(StreamRelPositionRequest) returns (stream StreamRelPositionReply) {}
}

message StreamRelPositionRequest {
}

message StreamFramesRequest {
}

message GpsFrameStatus {
bool time_fully_resolved = 1; // means that the UTC time is known without full seconds ambiguity
bool gnss_fix_ok = 2; // fixes not marked valid should not normally be used
Expand Down Expand Up @@ -107,14 +96,6 @@ message RelativePositionFrame { // NAV-RELPOSNED
GpsCoordinates base_coords = 23; // base / reference station coordinates, if known
}

message StreamRelPositionReply {
RelativePositionFrame frame = 1;
}

message StreamFramesReply {
GpsFrame frame = 1;
}

message GpsCoordinates{
// Not necessarily a reading directly from the GPS receiver.
// Likely a created / calculated set of GPS coordinates.
Expand Down
33 changes: 0 additions & 33 deletions protos/farm_ng/health_monitor/health_monitor.proto

This file was deleted.

27 changes: 27 additions & 0 deletions protos/farm_ng/imu/imu.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) farm-ng, inc. All rights reserved.

syntax = "proto3";

import "farm_ng/core/linalg.proto";
import "farm_ng/core/lie.proto";

package farm_ng.imu.proto;

message ImuBias {
// Gyro bias in radians per second
farm_ng.core.proto.Vec3F64 gyro_bias = 1;
// Accelerometer bias in meters per second squared
farm_ng.core.proto.Vec3F64 accelero_bias = 2;
}

message Imu {
// Angular velocity in radians per second
farm_ng.core.proto.Vec3F64 angular_velocity = 2;
// Linear acceleration in meters per second squared
farm_ng.core.proto.Vec3F64 linear_acceleration = 3;
// Orientation as a quaternion
farm_ng.core.proto.QuaternionF64 orientation = 4;
// Gyro and Accelero bias
ImuBias bias = 5;
}

Loading

0 comments on commit be41bac

Please sign in to comment.