Skip to content

Commit

Permalink
Add control services to be used for controlling playback
Browse files Browse the repository at this point in the history
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
  • Loading branch information
Emerson Knapp committed Apr 9, 2021
1 parent c2f034d commit 7e9ce9b
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 13 deletions.
29 changes: 19 additions & 10 deletions rosbag2_interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
cmake_minimum_required(VERSION 3.8)
project(rosbag2_interfaces)

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 dependencies
find_package(ament_cmake REQUIRED)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
"srv/GetRate.srv"
"srv/IsPaused.srv"
"srv/Pause.srv"
"srv/PlayNext.srv"
"srv/Resume.srv"
"srv/Seek.srv"
"srv/SetRate.srv"
"srv/TogglePaused.srv"
DEPENDENCIES builtin_interfaces
ADD_LINTER_TESTS
)
ament_export_dependencies(rosidl_default_runtime)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# uncomment the line when a copyright and license is not present in all source files
#set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# uncomment the line when this package is not in a git repo
#set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

Expand Down
17 changes: 14 additions & 3 deletions rosbag2_interfaces/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,27 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>rosbag2_interfaces</name>
<version>0.0.0</version>
<version>0.7.0</version>
<description>Interface definitions for controlling rosbag2</description>
<maintainer email="eknapp@todo.todo">eknapp</maintainer>
<license>Apache 2.0</license>
<maintainer email="karsten@openrobotics.org">Karsten Knese</maintainer>
<maintainer email="michael.jeronimo@openrobotics.org">Michael Jeronimo</maintainer>
<maintainer email="me@emersonknapp.com">Emerson Knapp</maintainer>
<maintainer email="ros-tooling@googlegroups.com">ROS Tooling Working Group</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_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>
Expand Down
2 changes: 2 additions & 0 deletions rosbag2_interfaces/srv/GetRate.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
float64 rate
2 changes: 2 additions & 0 deletions rosbag2_interfaces/srv/IsPaused.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
bool paused
1 change: 1 addition & 0 deletions rosbag2_interfaces/srv/Pause.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
2 changes: 2 additions & 0 deletions rosbag2_interfaces/srv/PlayNext.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
bool success # can only play-next while playback is paused
1 change: 1 addition & 0 deletions rosbag2_interfaces/srv/Resume.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
3 changes: 3 additions & 0 deletions rosbag2_interfaces/srv/Seek.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
builtin_interfaces/Time time
---
bool success # return true if valid time in bag duration, and successful seek
3 changes: 3 additions & 0 deletions rosbag2_interfaces/srv/SetRate.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
float64 rate
---
bool success # true if valid rate (> 0) was set
1 change: 1 addition & 0 deletions rosbag2_interfaces/srv/TogglePaused.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---

0 comments on commit 7e9ce9b

Please sign in to comment.