Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add action_msgs package #41

Merged
merged 3 commits into from
Oct 25, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions action_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
cmake_minimum_required(VERSION 3.5)

project(action_msgs)

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(ament_cmake REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)

set(msg_files
"msg/GoalStatus.msg"
"msg/GoalStatusArray.msg"
"msg/UUID.msg"
)
set(srv_files
"srv/CancelGoal.srv"
)

rosidl_generate_interfaces(${PROJECT_NAME}
${msg_files}
${srv_files}
DEPENDENCIES builtin_interfaces
ADD_LINTER_TESTS
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_export_dependencies(rosidl_default_runtime)

ament_package()
18 changes: 18 additions & 0 deletions action_msgs/msg/GoalStatus.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# An action goal can be in one of these states after it is accepted by an action server.
# For more information, see http://design.ros2.org/articles/actions.html
uint8 STATUS_ACCEPTED = 0
uint8 STATUS_EXECUTING = 1
uint8 STATUS_CANCELING = 2
uint8 STATUS_SUCCEEDED = 3
uint8 STATUS_CANCELED = 4
uint8 STATUS_ABORTED = 5

# Goal ID
# TODO(jacobperron): Use a ported version of https://github.com/ros-geographic-info/unique_identifier/blob/master/uuid_msgs
UUID goal_id

# Time when the goal was accepted
builtin_interfaces/Time stamp

# Goal status
uint8 status
2 changes: 2 additions & 0 deletions action_msgs/msg/GoalStatusArray.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# An array of goal statuses
GoalStatus[] status_list
2 changes: 2 additions & 0 deletions action_msgs/msg/UUID.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# TODO(jacobperron): Remove UUID.msg in favor of ported version of https://github.com/ros-geographic-info/unique_identifier/blob/master/uuid_msgs
uint8[16] uuid
28 changes: 28 additions & 0 deletions action_msgs/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>action_msgs</name>
<version>0.5.0</version>
<description>Messages and service definitions common among all ROS actions.</description>
<maintainer email="[email protected]">Karsten Knese</maintainer>
<license>Apache License 2.0</license>

<author email="[email protected]">Jacob Perron</author>

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>

<build_depend>builtin_interfaces</build_depend>

<exec_depend>builtin_interfaces</exec_depend>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think <depend>builtin_interfaces</depend> to get all three build_depend, exec_depend, and build_export_depend would make sense because a C generator would export a header with an include to builtin_interfaces/msg/Time.h

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general there are only two types of dependencies: the ones for build time and the ones for run time. Internally exec_depend and build_export_depend do the same thing - they are only named separately since users found it "easier" / more intuitive than run_depend.

Anyway if you use both then using depend makes sense 👍

<exec_depend>rosidl_default_runtime</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<member_of_group>rosidl_interface_packages</member_of_group>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
16 changes: 16 additions & 0 deletions action_msgs/srv/CancelGoal.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Cancel one or more goals with the following policy:
#
# - If the goal ID is zero and timestamp is zero, cancel all goals.
# - If the goal ID is zero and timestamp is not zero, cancel all goals accepted
# at or before the timestamp.
# - If the goal ID is not zero and timestamp is zero, cancel the goal with the
# given ID regardless of the time it was accepted.
# - If the goal ID is not zero and timestamp is not zero, cancel the goal with
# the given ID and all goals accepted at or before the timestamp.
#
# Goal ID
# TODO(jacobperron): Use a ported version of https://github.com/ros-geographic-info/unique_identifier/blob/master/uuid_msgs
UUID goal_id
builtin_interfaces/Time stamp
---
UUID[] goals_canceling