Skip to content

Commit

Permalink
Merge pull request #97 from UOA-FSAE/feat-proto-msg
Browse files Browse the repository at this point in the history
Added protobuff-compiler submodule
  • Loading branch information
Zane-Larking authored Jun 25, 2024
2 parents ccd4fe5 + d953938 commit ca5ac48
Show file tree
Hide file tree
Showing 23 changed files with 119 additions and 75 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ kaggle.json
.vscode/settings.json
.gitignore
.vscode/c_cpp_properties.json
**/__pycache__/
**/__pycache__/
*.msg
*.srv
29 changes: 16 additions & 13 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
[submodule "src/hardware_drivers/foxglove-bridge"]
path = src/hardware_drivers/foxglove-bridge
url = https://github.com/foxglove/ros-foxglove-bridge.git
[submodule "src/moa/cone-detection/cone_detection/yolov7"]
path = src/perception/cone-detection/cone_detection/yolov7
url = https://github.com/WongKinYiu/yolov7.git
[submodule "src/hardware_drivers/CanTalk"]
path = src/hardware_drivers/CanTalk
url = https://github.com/UOA-FSAE/CanTalk.git
branch = main
[submodule "Tracks/racetrack-database"]
path = src/planning/path_planning/path_planning/shortest_path/Tracks/racetrack-database
url = https://github.com/TUMFTM/racetrack-database.git
[submodule "src/hardware_drivers/foxglove-bridge"]
path = src/hardware_drivers/foxglove-bridge
url = https://github.com/foxglove/ros-foxglove-bridge.git
[submodule "src/moa/cone-detection/cone_detection/yolov7"]
path = src/perception/cone-detection/cone_detection/yolov7
url = https://github.com/WongKinYiu/yolov7.git
[submodule "src/hardware_drivers/CanTalk"]
path = src/hardware_drivers/CanTalk
url = https://github.com/UOA-FSAE/CanTalk.git
branch = main
[submodule "Tracks/racetrack-database"]
path = src/planning/path_planning/path_planning/shortest_path/Tracks/racetrack-database
url = https://github.com/TUMFTM/racetrack-database.git
[submodule "ROS2-protobuff-compiler"]
path = ROS2-protobuff-compiler
url = https://github.com/UOA-FSAE/ROS2-protobuff-compiler.git
1 change: 1 addition & 0 deletions ROS2-protobuff-compiler
97 changes: 97 additions & 0 deletions interfaces.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
syntax = "proto3";

message AllStates {
uint16 id = 1;
repeated ackermann_msgs.AckermannDrive states = 2;
}

message AllTrajectories {
uint16 id = 1;
repeated geometry_msgs.PoseArray trajectories = 2;
}
message BoundaryStamped {
std_msgs.Header header = 1;
repeated float32 coords = 2;
}

message Can {
uint16 id = 1;
bool is_rtr = 2;
repeated uint8 data = 3;
}

message CandidateState {
Ackermann ackermann = 1;
float32 lateralVel = 2;
}

message CandidateStates {
repeated CandidateState candidateState = 1;
}

message CanStamped {
std_msgs.Header header = 1;
CAN can = 2;
}

message Cone {
uint32 id = 0; // ID value of cone (optional, defaults to 0 if not given)

float32 confidence = 1; // The confidence that this is the cone, a percentage value from 0 to 100 (defaults to 0.0)

uint8 colour = 2; // The color of the cone: 0 for Blue, 1 for Orange, 2 for Yellow, and 3 for Other

geometry_msgs.PoseWithCovariance pose = 3; // Position of cone (x, y, z) and rotation

float32 radius = 4; // Size of cone, radius (should default to 0.0)
float32 height = 5; // Size of cone, height (should default to 0.0)

}
// ? can this be renamed to Cones?
message ConeMap {
repeated Cone cones = 1; // List of cones detected and where they are
}
message ConeMapStamped {
std_msgs.Header header = 1;
ConeMap cone_map = 2;
}
message ConeStamped {
std_msgs.Header header = 1;
Cone cone = 2;
}
message HardwareStates {
uint8 ebs_active = 1;
uint8 ts_active = 2;
uint8 in_gear = 3;
uint8 master_switch_on = 4;
uint8 asb_ready = 5;
uint8 brakes_engaged = 6;
}
message HardwareStatesStamped {
std_msgs.Header header = 1;
HardwareStates hardware_states = 2;
}
message MissionStates {
uint8 mission_selected = 1;
uint8 mission_finished = 2;
}
message MissionStatesStamped {
std_msgs.Header header = 1;
MissionStates mission_states = 2;
}

message OccupancyGrid{
std_msgs.Header header = 1;
repeated Rptuint8 occupancyGrid = 2;
float32 resolution = 3;
}

service Services {
rpc CANSendReq (CANSendReqRequest) returns (CANSendReqResponce);
}
message CANSendReqRequest {
CAN can = 1;
}
message CANSendReqResponce {
bool sent =1;
}
1 change: 1 addition & 0 deletions interfaces_clean.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python %~dp0ROS2-protobuff-compiler\protobuf2rosmsg.py -m %~dp0src\moa\moa_msgs\msg -s %~dp0src\moa\moa_msgs\srv -c
1 change: 1 addition & 0 deletions interfaces_run.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python %~dp0ROS2-protobuff-compiler\protobuf2rosmsg.py -f %~dp0interfaces.proto -m %~dp0src\moa\moa_msgs\msg -s %~dp0src\moa\moa_msgs\srv -c
3 changes: 0 additions & 3 deletions src/moa/moa_msgs/msg/AllStates.msg

This file was deleted.

3 changes: 0 additions & 3 deletions src/moa/moa_msgs/msg/AllTrajectories.msg

This file was deleted.

3 changes: 0 additions & 3 deletions src/moa/moa_msgs/msg/BoundaryStamped.msg

This file was deleted.

4 changes: 0 additions & 4 deletions src/moa/moa_msgs/msg/CAN.msg

This file was deleted.

3 changes: 0 additions & 3 deletions src/moa/moa_msgs/msg/CANStamped.msg

This file was deleted.

3 changes: 0 additions & 3 deletions src/moa/moa_msgs/msg/CandidateState.msg

This file was deleted.

1 change: 0 additions & 1 deletion src/moa/moa_msgs/msg/CandidateStates.msg

This file was deleted.

10 changes: 0 additions & 10 deletions src/moa/moa_msgs/msg/Cone.msg

This file was deleted.

2 changes: 0 additions & 2 deletions src/moa/moa_msgs/msg/ConeMap.msg

This file was deleted.

3 changes: 0 additions & 3 deletions src/moa/moa_msgs/msg/ConeMapStamped.msg

This file was deleted.

3 changes: 0 additions & 3 deletions src/moa/moa_msgs/msg/ConeStamped.msg

This file was deleted.

6 changes: 0 additions & 6 deletions src/moa/moa_msgs/msg/HardwareStates.msg

This file was deleted.

3 changes: 0 additions & 3 deletions src/moa/moa_msgs/msg/HardwareStatesStamped.msg

This file was deleted.

2 changes: 0 additions & 2 deletions src/moa/moa_msgs/msg/MissionStates.msg

This file was deleted.

5 changes: 0 additions & 5 deletions src/moa/moa_msgs/msg/MissionStatesStamped.msg

This file was deleted.

4 changes: 0 additions & 4 deletions src/moa/moa_msgs/msg/OccupancyGrid.msg

This file was deleted.

3 changes: 0 additions & 3 deletions src/moa/moa_msgs/srv/CANSendReq.srv

This file was deleted.

0 comments on commit ca5ac48

Please sign in to comment.