Skip to content

Commit

Permalink
Convert navigator_msgs to ROS2 (#1159)
Browse files Browse the repository at this point in the history
* Convert navigator_msgs to ROS2

* Fixing small typos/mistakes
  • Loading branch information
cbrxyz authored Mar 19, 2024
1 parent 3027097 commit 2a74ee0
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 124 deletions.
139 changes: 63 additions & 76 deletions NaviGator/utils/navigator_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,88 +1,73 @@
cmake_minimum_required(VERSION 3.0.2)
cmake_minimum_required(VERSION 3.5)
project(navigator_msgs)

find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
message_generation
geometry_msgs
genmsg
actionlib_msgs
actionlib
sensor_msgs
)

add_message_files(
DIRECTORY msg
FILES
Acceleration.msg
PoseTwist.msg
Coordinates.msg
PoseTwistStamped.msg
PerceptionObject.msg
PerceptionObjectArray.msg
DockShape.msg
DockShapes.msg
KillStatus.msg
Host.msg
Hosts.msg
ColoramaDebug.msg
ScanTheCode.msg
)

add_service_files(
DIRECTORY srv
FILES
AcousticBeacon.srv
ChooseAnimal.srv
MoveToWaypoint.srv
ShooterManual.srv
VisionRequest.srv
GetDockShape.srv
GetDockShapes.srv
StartGate.srv
SetROI.srv
CoordinateConversion.srv
StereoShapeDetector.srv
ScanTheCodeMission.srv
ObjectDBQuery.srv
CameraDBQuery.srv
CameraToLidarTransform.srv
KeyboardControl.srv
ColorRequest.srv
FindPinger.srv
SetFrequency.srv
GetDockBays.srv
MessageDetectDock.srv
MessageEntranceExitGate.srv
MessageFindFling.srv
MessageFollowPath.srv
MessageReactReport.srv
MessageUAVReplenishment.srv
MessageUAVSearchReport.srv
TwoClosestCones.srv
)
find_package(rosidl_default_generators REQUIRED)
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(genmsg REQUIRED)
find_package(actionlib_msgs REQUIRED)
find_package(actionlib REQUIRED)
find_package(sensor_msgs REQUIRED)
set(CMAKE_CXX_STANDARD 14)

add_action_files(
DIRECTORY action
FILES
ClassifyUnknown.action
ShooterDo.action
)

generate_messages(
DEPENDENCIES
std_msgs
geometry_msgs
actionlib_msgs
sensor_msgs
)

catkin_package(
CATKIN_DEPENDS
std_msgs
geometry_msgs
sensor_msgs
rosidl_generate_interfaces(
${PROJECT_NAME}
msg/Hosts.msg
msg/ColoramaDebug.msg
msg/PerceptionObject.msg
msg/Acceleration.msg
msg/PerceptionObjectArray.msg
msg/PoseTwistStamped.msg
msg/Host.msg
msg/DockShape.msg
msg/PoseTwist.msg
msg/ScanTheCode.msg
msg/KillStatus.msg
msg/DockShapes.msg
msg/Coordinates.msg
action/ShooterDo.action
action/ClassifyUnknown.action
srv/KeyboardControl.srv
srv/MessageReactReport.srv
srv/ObjectDBQuery.srv
srv/CameraDBQuery.srv
srv/ChooseAnimal.srv
srv/GetDockShape.srv
srv/ShooterManual.srv
srv/MessageUAVSearchReport.srv
srv/VisionRequest.srv
srv/MoveToWaypoint.srv
srv/ScanTheCodeMission.srv
srv/MessageDetectDock.srv
srv/StereoShapeDetector.srv
srv/SetFrequency.srv
srv/CameraToLidarTransform.srv
srv/GetDockBays.srv
srv/MessageFollowPath.srv
srv/FindPinger.srv
srv/ColorRequest.srv
srv/TwoClosestCones.srv
srv/StartGate.srv
srv/CoordinateConversion.srv
srv/MessageEntranceExitGate.srv
srv/MessageUAVReplenishment.srv
srv/SetROI.srv
srv/MessageFindFling.srv
srv/GetDockShapes.srv
srv/AcousticBeacon.srv
DEPENDENCIES
geometry_msgs
std_msgs
actionlib_msgs
sensor_msgs
)

#catkin_package(
Expand All @@ -92,3 +77,5 @@ catkin_package(
#message_runtime
#actionlib_msgs
#)
ament_export_dependencies(std_msgs geometry_msgs sensor_msgs)
ament_package()
13 changes: 6 additions & 7 deletions NaviGator/utils/navigator_msgs/action/ShooterDo.action
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@

---
# Define the result
bool success
string error
string ALREADY_RUNNING=ALREADY_RUNNING
string NOT_LOADED=NOT_LOADED
string ALREADY_LOADED=ALREADY_LOADED
string MANUAL_CONTROL_USED=MANUAL_CONTROL_USED
string KILLED=KILLED
string ALREADY_RUNNING==ALREADY_RUNNING
string NOT_LOADED==NOT_LOADED
string ALREADY_LOADED==ALREADY_LOADED
string MANUAL_CONTROL_USED==MANUAL_CONTROL_USED
string KILLED==KILLED
---
# Define a feedback message
duration time_remaining
builtin_interfaces/Duration time_remaining
18 changes: 7 additions & 11 deletions NaviGator/utils/navigator_msgs/msg/DockShape.msg
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
string Shape
string CROSS=CROSS
string TRIANGLE=TRIANGLE
string CIRCLE =CIRCLE

string CROSS==CROSS
string TRIANGLE==TRIANGLE
string CIRCLE==CIRCLE
string Color
string RED=RED
string BLUE=BLUE
string GREEN=GREEN

string RED==RED
string BLUE==BLUE
string GREEN==GREEN
uint32 CenterX
uint32 CenterY

uint16 img_width
Header header
std_msgs/Header header
geometry_msgs/Point[] points

float32 color_confidence
float32 shape_confidence
3 changes: 1 addition & 2 deletions NaviGator/utils/navigator_msgs/msg/PoseTwistStamped.msg
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# pose is in header.frame_id. twist is in frame defined by pose (ie. body)
Header header
# pose is in header.frame_id. twist is in frame defined by pose (ie. body)std_msgs/Header header
PoseTwist posetwist
35 changes: 17 additions & 18 deletions NaviGator/utils/navigator_msgs/package.xml
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
<?xml version="1.0"?>
<package>
<?xml-model
href="http://download.ros.org/schema/package_format3.xsd"
schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>navigator_msgs</name>
<version>1.0.0</version>
<description>The navigator_msgs package</description>
<maintainer email="[email protected]">zachgoins</maintainer>
<license>BSD</license>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>actionlib</build_depend>
<build_depend>actionlib</build_depend>
<build_depend>actionlib_msgs</build_depend>
<build_depend>actionlib_msgs</build_depend>
<build_depend>geometry_msgs</build_depend>
<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>
<depend>actionlib</depend>
<depend>actionlib_msgs</depend>
<depend>geometry_msgs</depend>
<depend>message_runtime</depend>
<depend>sensor_msgs</depend>
<depend>std_msgs</depend>
<build_depend>message_generation</build_depend>
<build_depend>message_runtime</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>std_msgs</build_depend>
<run_depend>sensor_msgs</run_depend>
<run_depend>actionlib</run_depend>
<run_depend>actionlib_msgs</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>geometry_msgs</run_depend>
<run_depend>message_runtime</run_depend>
<run_depend>actionlib_msgs</run_depend>
<export/>
<exec_depend>rosidl_default_runtime</exec_depend>
<export>
<build_type>ament_cmake</build_type>
</export>
<member_of_group>rosidl_interface_packages</member_of_group>
</package>
20 changes: 10 additions & 10 deletions NaviGator/utils/navigator_msgs/srv/CameraToLidarTransform.srv
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Header header #Stamp of time point was seen for tf
std_msgs/Header header #Stamp of time point was seen for tf
geometry_msgs/Point point #X and Y of point in camera frame, Z is ignored
uint16 tolerance #Number of pixels the projected 3D lidar point can be from the target point to be included in the response
uint16 tolerance#Number of pixels the projected 3D lidar point can be from the target point to be included in the response
---
bool success #True if at least one point found in lidar and transformed
geometry_msgs/Point[] transformed #Points in 3-D in camera frame if success is true
geometry_msgs/Point closest #3D point that is the closest to the target point when transformed and projected
geometry_msgs/Vector3 normal #Normal unit vector in camera frame estimated from transformed points
float64 distance #mean z of transformed points
string error #Describes when went wrong if success if false
string CLOUD_NOT_FOUND=pointcloud not found
string NO_POINTS_FOUND=no points
bool success#True if at least one point found in lidar and transformed
geometry_msgs/Point[] transformed#Points in 3-D in camera frame if success is true
geometry_msgs/Point closest#3D point that is the closest to the target point when transformed and projected
geometry_msgs/Vector3 normal#Normal unit vector in camera frame estimated from transformed points
float64 distance#mean z of transformed points
string error#Describes when went wrong if success if false
string CLOUD_NOT_FOUND==pointcloud not found
string NO_POINTS_FOUND==no points

0 comments on commit 2a74ee0

Please sign in to comment.