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

Rmf scheduler msgs #40

Merged
merged 20 commits into from
Jun 6, 2022
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
1 change: 1 addition & 0 deletions rmf_scheduler_msgs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Changelog for package rmf_scheduler_msgs
49 changes: 49 additions & 0 deletions rmf_scheduler_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
cmake_minimum_required(VERSION 3.5)

project(rmf_scheduler_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")
# we dont use add_compile_options with pedantic in message packages
# because the Python C extensions dont comply with it
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
endif()

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

set(msg_files
msg/Payload.msg
msg/Schedule.msg
msg/ScheduleState.msg
msg/Trigger.msg
msg/TriggerState.msg
)

set(srv_files
srv/CancelAll.srv
srv/CancelSchedule.srv
srv/CancelTrigger.srv
srv/CreateSchedule.srv
srv/CreateTrigger.srv
srv/ListSchedules.srv
srv/ListScheduleStates.srv
srv/ListTriggers.srv
srv/ListTriggerStates.srv
)

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

ament_export_dependencies(rosidl_default_runtime)

ament_package()
131 changes: 131 additions & 0 deletions rmf_scheduler_msgs/QUALITY_DECLARATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
This document is a declaration of software quality for the `rmf_scheduler_msgs` package, based on the guidelines in [REP-2004](https://www.ros.org/reps/rep-2004.html).

# `rmf_scheduler_msgs` Quality Declaration

The package `rmf_scheduler_msgs` claims to be in the **Quality Level 3** category.

Below are the rationales, notes, and caveats for this claim, organized by each requirement listed in the [Package Requirements for Quality Level 3 in REP-2004](https://www.ros.org/reps/rep-2004.html).

## Version Policy [1]

### Version Scheme [1.i]

`rmf_scheduler_msgs` uses `semver` according to the recommendation for ROS Core packages in the [ROS 2 Developer Guide](https://index.ros.org/doc/ros2/Contributing/Developer-Guide/#versioning).

### Version Stability [1.ii]

`rmf_scheduler_msgs` is at a stable version, i.e. `>= 1.0.0`.
The current version can be found in its [package.xml](package.xml), and its change history can be found in its [CHANGELOG](CHANGELOG.rst).

### Public API Declaration [1.iii]

All message definition files located the `msg` directory are considered part of the public API.

### API Stability Within a Released ROS Distribution [1.iv]/[1.vi]

`rmf_scheduler_msgs` will not break public API within a released ROS distribution, i.e. no major releases once the ROS distribution is released.

### ABI Stability Within a Released ROS Distribution [1.v]/[1.vi]

`rmf_scheduler_msgs` will not break public ABI within a major version number.

## Change Control Process [2]

`rmf_scheduler_msgs` follows the recommended guidelines for ROS Core packages in the [ROS 2 Developer Guide](https://index.ros.org/doc/ros2/Contributing/Developer-Guide/#package-requirements).

### Change Requests [2.i]

`rmf_scheduler_msgs` requires that all changes occur through a pull request.

### Contributor Origin [2.ii]

`rmf_scheduler_msgs` uses DCO as its confirmation of contributor origin policy. More information can be found in [CONTRIBUTING](../CONTRIBUTING.md).

### Peer Review Policy [2.iii]

All pull requests must have at least 1 peer review.

### Continuous Integration [2.iv]

All pull requests must pass CI on all platforms supported by RMF.

### Documentation Policy [2.v]

All pull requests must resolve related documentation changes before merging.

## Documentation [3]

### Feature Documentation [3.i]

`rmf_scheduler_msgs` has basic comments in the message definition files, but no list of messages or usage guide is provided.
New messages require their own documentation in order to be added.

### Public API Documentation [3.ii]

`rmf_scheduler_msgs` has embedded API documentation, but it is not currently hosted.

### License [3.iii]

The license for `rmf_scheduler_msgs` is Apache 2.0, the type is declared in the [package.xml](package.xml) manifest file, and a full copy of the license is in the repository level [LICENSE](../LICENSE) file.

There are no source files that are currently copyrighted in this package so files are not checked for abbreviated license statements.

### Copyright Statement [3.iv]

There are no copyrighted source files in this package.

### Quality declaration document [3.v]

This quality declaration is linked in the [README file](README.md).

This quality declaration has not been externally peer-reviewed and is not registered on any Level 3 lists.

## Testing [4]

### Feature Testing [4.i]

`rmf_scheduler_msgs` is a package providing strictly message definitions and therefore does not require associated tests.

### Public API Testing [4.ii]

`rmf_scheduler_msgs` is a package providing strictly message definitions and therefore does not require associated tests.

### Coverage [4.iii]

`rmf_scheduler_msgs` is a package providing strictly message definitions and therefore has no coverage requirements.

### Performance [4.iv]

`rmf_scheduler_msgs` is a package providing strictly message definitions and therefore has no performance requirements.

### Linters and Static Analysis [4.v]

`rmf_scheduler_msgs` does not use the standard linters and static analysis tools for its generated C++ and Python code to ensure it follows the [ROS 2 Developer Guide](https://index.ros.org/doc/ros2/Contributing/Developer-Guide/#linters).

## Dependencies [5]

### Direct Runtime ROS Dependencies [5.i]

`rmf_scheduler_msgs` has the following runtime ROS dependencies, which are at or above Quality Level 3:
* `builtin_interfaces`: [QL 3](https://github.com/ros2/rcl_interfaces/tree/master/builtin_interfaces/QUALITY_DECLARATION.md)
* `rosidl_default_runtime` [QL 3](https://github.com/ros2/rosidl_defaults/tree/master/rosidl_default_runtime/QUALITY_DECLARATION.md)

It has several "buildtool" dependencies, which do not affect the resulting quality of the package, because they do not contribute to the public library API.

### Optional Direct Runtime ROS Dependencies [5.ii]

`rmf_scheduler_msgs` does not have any optional direct runtime ROS dependencies.

### Direct Runtime non-ROS Dependency [5.iii]

`rmf_scheduler_msgs` does not have any runtime non-ROS dependencies.

## Platform Support [6]

As a pure message definitions package, `rmf_scheduler_msgs` supports all of the tier 1 platforms as described in [REP-2000](https://www.ros.org/reps/rep-2000.html#support-tiers), but does not currently test each change against all of them.

## Security [7]

### Vulnerability Disclosure Policy [7.i]

This package conforms to the Vulnerability Disclosure Policy in [REP-2006](https://www.ros.org/reps/rep-2006.html).
9 changes: 9 additions & 0 deletions rmf_scheduler_msgs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# rmf_scheduler_msgs

`rmf_scheduler_msgs` provides message types for scheduling RMF events.

For more information about ROS 2 interfaces, see [index.ros2.org](https://index.ros.org/doc/ros2/Concepts/About-ROS-Interfaces/)

## Quality Declaration

This package claims to be in the **Quality Level 3** category. See the [Quality Declaration](QUALITY_DECLARATION.md) for more details.
10 changes: 10 additions & 0 deletions rmf_scheduler_msgs/msg/Payload.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Denotes the type of payload
uint8 type
uint8 PAYLOAD_TYPE_SERIALIZED_MESSAGE=1

string topic

string message_type

# max 2mb
uint8[<=2097152] data
66 changes: 66 additions & 0 deletions rmf_scheduler_msgs/msg/Schedule.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Name to identify the schedule, must be unique across all schedules.
string name

# unix timestamp in seconds
int64 created_at

# ┌─────────────seconds (0 - 59)
# │ ┌───────────── minute (0 - 59)
# │ │ ┌───────────── hour (0 - 23)
# │ │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday)
# │ │ │ │ │ │ ┌───────────── years (1970 - 2099) (optional)
# │ │ │ │ │ │ │
# * * * * * * *
#
# | Field | Required | Allowed value | Allowed special characters |
# | --- | --- | --- | --- |
# | seconds | yes | 0-59 | `*` `,` `-` |
# | minutes | yes | 0-59 | `*` `,` `-` |
# | hours | yes | 0-23 | `*` `,` `-` |
# | days of month | 1-31 | `*` `,` `-` `?` `L` `W` |
# | months | yes | 1-12 | `*` `,` `-` |
# | days of week | yes | `*` `,` `-` `?` `L` `#` |
# | years | no | 1970-2099 | `*` `,` `-` |
#
# The special characters have the following meaning:
#
# | Special character | Meaning | Description |
# | --- | --- | --- |
# | `*` | all values | selects all values within a field |
# | `?` | no specific value | specify one field and leave the other unspecified |
# | `-` | range | specify ranges |
# | `,` | comma | specify additional values |
# | `/` | slash | speficy increments |
# | `L` | last | last day of the month or last day of the week |
# | `W` | weekday | the weekday nearest to the given day |
# | `#` | nth | specify the Nth day of the month |
# Examples:
#
# | CRON | Description |
# | --- | --- |
# | * * * * * * | Every second |
# | */5 * * * * ? | Every 5 seconds |
# | 0 */5 */2 * * ? | Every 5 minutes, every 2 hours |
# | 0 */2 */2 ? */2 */2 | Every 2 minutes, every 2 hours, every 2 days of the week, every 2 months |
# | 0 15 10 * * ? * | 10:15 AM every day |
# | 0 0/5 14 * * ? | Every 5 minutes starting at 2 PM and ending at 2:55 PM, every day |
# | 0 10,44 14 ? 3 WED | 2:10 PM and at 2:44 PM every Wednesday of March |
# | 0 15 10 ? * MON-FRI | 10:15 AM every Monday, Tuesday, Wednesday, Thursday and Friday |
# | 0 15 10 L * ? | 10:15 AM on the last day of every month |
# | 0 0 12 1/5 * ? | 12 PM every 5 days every month, starting on the first day of the month |
# | 0 11 11 11 11 ? | Every November 11th at 11:11 AM |
#
# Reference: https://github.com/mariusbancila/croncpp/blob/999f7685ab683b58872386c0aa019acf97c6570a/README.md
string schedule

# unix time in secs
int64 start_at

# unix time in secs
int64 finish_at 9223372036854775807

string group "default"

Payload payload
17 changes: 17 additions & 0 deletions rmf_scheduler_msgs/msg/ScheduleState.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
string name

# unix time in seconds
int64 last_modified

# unix time in seconds
int64 last_ran

# unix time in seconds
int64 next_run

int8 status
int8 CREATED=1
int8 STARTED=2
int8 FINISHED=3
int8 CANCELLED=4
int8 FAILED=-1
12 changes: 12 additions & 0 deletions rmf_scheduler_msgs/msg/Trigger.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Name to identify the trigger, must be unique across all triggers.
string name

# unix timestamp in seconds
int64 created_at

# unix timestamp in seconds when the trigger should run
int64 at

string group "default"

Payload payload
13 changes: 13 additions & 0 deletions rmf_scheduler_msgs/msg/TriggerState.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
string name

# unix time in seconds
int64 last_modified

# unix time in seconds
int64 last_ran

int8 status
int8 STARTED=2
int8 FINISHED=3
int8 CANCELLED=4
int8 FAILED=-1
26 changes: 26 additions & 0 deletions rmf_scheduler_msgs/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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>rmf_scheduler_msgs</name>
<version>2.0.0</version>
<description>Messages used by rmf_scheduler_msgs</description>
<maintainer email="marco@openrobotics.org">Marco A. Gutiérrez</maintainer>
<license>Apache License 2.0</license>

<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>
<exec_depend>rosidl_default_runtime</exec_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>
11 changes: 11 additions & 0 deletions rmf_scheduler_msgs/srv/CancelAll.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Cancel all triggers and schedules belonging to a group.

string group

---

# Confirmation that the schedule is successfully registered
bool success

# If success is false, this provides a reason for the failure.
string message
12 changes: 12 additions & 0 deletions rmf_scheduler_msgs/srv/CancelSchedule.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
string name

# Indicate that the schedule is considered finished successfully.
bool finished

---

# Confirmation that the schedule is successfully cancelled.
bool success

# If success is false, this provides a reason for the failure.
string message
9 changes: 9 additions & 0 deletions rmf_scheduler_msgs/srv/CancelTrigger.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
string name

---

# Confirmation that the trigger is successfully cancelled.
bool success

# If success is false, this provides a reason for the failure.
string message
13 changes: 13 additions & 0 deletions rmf_scheduler_msgs/srv/CreateSchedule.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Registers a new recurring schedule. Existing schedule with the same name will be replaced.

# The following fields are ignored:
# - created_at
Schedule schedule

---

# Confirmation that the schedule is successfully registered
bool success

# If success is false, this provides a reason for the failure.
string message
Loading