Skip to content

Commit

Permalink
Tools: add REP-147 Global Position Control
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Friedman <[email protected]>
  • Loading branch information
Ryanf55 committed Dec 7, 2023
1 parent 431ddd8 commit 417b938
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Tools/ros2/ardupilot_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ project(ardupilot_msgs)
# Find dependencies.

find_package(ament_cmake REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)

# --------------------------------------------------------------------------- #
# Generate and export message interfaces.

rosidl_generate_interfaces(${PROJECT_NAME}
"msg/GlobalPosition.msg"
"srv/ArmMotors.srv"
"srv/ModeSwitch.srv"
DEPENDENCIES geometry_msgs std_msgs
ADD_LINTER_TESTS
)

Expand Down
30 changes: 30 additions & 0 deletions Tools/ros2/ardupilot_msgs/msg/GlobalPosition.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Experimental REP-147 Goal Interface
# https://ros.org/reps/rep-0147.html#goal-interface

std_msgs/Header header

uint8 coordinate_frame
uint8 FRAME_GLOBAL_INT = 5
uint8 FRAME_GLOBAL_REL_ALT = 6
uint8 FRAME_GLOBAL_TERRAIN_ALT = 11

uint16 type_mask
uint16 IGNORE_LATITUDE = 1 # Position ignore flags
uint16 IGNORE_LONGITUDE = 2
uint16 IGNORE_ALTITUDE = 4
uint16 IGNORE_VX = 8 # Velocity vector ignore flags
uint16 IGNORE_VY = 16
uint16 IGNORE_VZ = 32
uint16 IGNORE_AFX = 64 # Acceleration/Force vector ignore flags
uint16 IGNORE_AFY = 128
uint16 IGNORE_AFZ = 256
uint16 FORCE = 512 # Force in af vector flag
uint16 IGNORE_YAW = 1024
uint16 IGNORE_YAW_RATE = 2048

float64 latitude
float64 longitude
float32 altitude # in meters, AMSL or above terrain
geometry_msgs/Twist velocity
geometry_msgs/Twist acceleration_or_force
float32 yaw
3 changes: 3 additions & 0 deletions Tools/ros2/ardupilot_msgs/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>

<depend>std_msgs</depend>
<depend>geometry_msgs</depend>

<exec_depend>rosidl_default_runtime</exec_depend>

<test_depend>ament_cmake_copyright</test_depend>
Expand Down

0 comments on commit 417b938

Please sign in to comment.