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 all commits
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/GoalInfo.msg"
"msg/GoalStatus.msg"
"msg/GoalStatusArray.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()
6 changes: 6 additions & 0 deletions action_msgs/msg/GoalInfo.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Goal ID
# TODO(jacobperron): Use a ported version of https://github.com/ros-geographic-info/unique_identifier/blob/master/uuid_msgs
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that uuid_msgs has just a single message, I think the UUID.msg could live in builtin_interfaces rather than porting a package named uuid_msgs. Porting the tools in unique_id wouldn't need to block that.

uint8[16] uuid

# Time when the goal was accepted
builtin_interfaces/Time stamp
15 changes: 15 additions & 0 deletions action_msgs/msg/GoalStatus.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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
int8 STATUS_UNKNOWN = 0
int8 STATUS_ACCEPTED = 1
int8 STATUS_EXECUTING = 2
int8 STATUS_CANCELING = 3
int8 STATUS_SUCCEEDED = 4
int8 STATUS_CANCELED = 5
int8 STATUS_ABORTED = 6

# Goal info (contains ID and timestamp)
GoalInfo goal_info

# Goal status
int8 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
27 changes: 27 additions & 0 deletions action_msgs/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?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>

<depend>builtin_interfaces</depend>

<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>
15 changes: 15 additions & 0 deletions action_msgs/srv/CancelGoal.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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 info containing an ID and timestamp
GoalInfo goal_info
---
# Goals that accepted the cancel request
GoalInfo[] goals_canceling
sloretz marked this conversation as resolved.
Show resolved Hide resolved