Skip to content

Commit 0f2afe5

Browse files
authored
Remove action_tutorials_interfaces. (#701)
We have this message duplicated three times in the core; once in here, once in example_interfaces, and once in test_interface_files. That seems a bit excessive, so remove this third copy and make the action_tutorials use the example_interfaces version of Fibonacci.action instead. This change obviously changes the dependencies of the action_tutorials_cpp and action_tutorials_py packages, in that it removes action_tutorials_interfaces and adds in example_interfaces. I believe that this should be fine from an inter-repository standpoint, as the demos repository already contains other packages (composition, quality_of_service_demo_cpp, demo_nodes_py, demo_nodes_cpp) that depend on example_interfaces. Signed-off-by: Chris Lalancette <[email protected]>
1 parent 32169a1 commit 0f2afe5

File tree

13 files changed

+28
-307
lines changed

13 files changed

+28
-307
lines changed

action_tutorials/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,3 @@ Once the action is finished executing, the action client logs the resulting sequ
1717

1818
- [action_tutorials_cpp](./action_tutorials_cpp) implements the described action server and client using the rclcpp library in C++.
1919
- [action_tutorials_py](./action_tutorials_py) implements the described action server and client using the rclpy library in Python.
20-
- [action_tutorials_interfaces](./action_tutorials_interfaces) defines the interface for the Fibonacci action.
21-
This interface takes an *order* as a goal, returns a *partial sequence* as feedback and a *sequence* as a result.

action_tutorials/action_tutorials_cpp/CMakeLists.txt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,29 @@ endif()
1818

1919
# find dependencies
2020
find_package(ament_cmake REQUIRED)
21-
find_package(action_tutorials_interfaces REQUIRED)
21+
find_package(example_interfaces REQUIRED)
2222
find_package(rclcpp REQUIRED)
2323
find_package(rclcpp_action REQUIRED)
2424
find_package(rclcpp_components REQUIRED)
2525

26-
include_directories(include)
27-
2826
add_library(action_tutorials SHARED
2927
src/fibonacci_action_client.cpp
3028
src/fibonacci_action_server.cpp)
3129
rclcpp_components_register_node(action_tutorials PLUGIN "action_tutorials_cpp::FibonacciActionClient" EXECUTABLE fibonacci_action_client)
3230
rclcpp_components_register_node(action_tutorials PLUGIN "action_tutorials_cpp::FibonacciActionServer" EXECUTABLE fibonacci_action_server)
3331
target_compile_definitions(action_tutorials
3432
PRIVATE "ACTION_TUTORIALS_CPP_BUILDING_DLL")
35-
ament_target_dependencies(action_tutorials
36-
"action_tutorials_interfaces"
37-
"rclcpp"
38-
"rclcpp_action"
39-
"rclcpp_components")
40-
41-
install(TARGETS
42-
action_tutorials
33+
target_include_directories(action_tutorials PRIVATE
34+
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
35+
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
36+
target_link_libraries(action_tutorials PRIVATE
37+
${example_interfaces_TARGETS}
38+
rclcpp::rclcpp
39+
rclcpp_action::rclcpp_action
40+
rclcpp_components::component
41+
)
42+
43+
install(TARGETS action_tutorials
4344
ARCHIVE DESTINATION lib
4445
LIBRARY DESTINATION lib
4546
RUNTIME DESTINATION bin)

action_tutorials/action_tutorials_cpp/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<buildtool_depend>ament_cmake</buildtool_depend>
1717

18-
<depend>action_tutorials_interfaces</depend>
18+
<depend>example_interfaces</depend>
1919
<depend>rclcpp</depend>
2020
<depend>rclcpp_action</depend>
2121
<depend>rclcpp_components</depend>

action_tutorials/action_tutorials_cpp/src/fibonacci_action_client.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <string>
1717
#include <sstream>
1818

19-
#include "action_tutorials_interfaces/action/fibonacci.hpp"
19+
#include "example_interfaces/action/fibonacci.hpp"
2020
#include "rclcpp/rclcpp.hpp"
2121
#include "rclcpp_action/rclcpp_action.hpp"
2222
#include "rclcpp_components/register_node_macro.hpp"
@@ -28,7 +28,7 @@ namespace action_tutorials_cpp
2828
class FibonacciActionClient : public rclcpp::Node
2929
{
3030
public:
31-
using Fibonacci = action_tutorials_interfaces::action::Fibonacci;
31+
using Fibonacci = example_interfaces::action::Fibonacci;
3232
using GoalHandleFibonacci = rclcpp_action::ClientGoalHandle<Fibonacci>;
3333

3434
ACTION_TUTORIALS_CPP_PUBLIC
@@ -82,7 +82,7 @@ class FibonacciActionClient : public rclcpp::Node
8282
{
8383
std::stringstream ss;
8484
ss << "Next number in sequence received: ";
85-
for (auto number : feedback->partial_sequence) {
85+
for (auto number : feedback->sequence) {
8686
ss << number << " ";
8787
}
8888
RCLCPP_INFO(this->get_logger(), "%s", ss.str().c_str());

action_tutorials/action_tutorials_cpp/src/fibonacci_action_server.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#include <memory>
1616

17-
#include "action_tutorials_interfaces/action/fibonacci.hpp"
17+
#include "example_interfaces/action/fibonacci.hpp"
1818
#include "rclcpp/rclcpp.hpp"
1919
#include "rclcpp_action/rclcpp_action.hpp"
2020
#include "rclcpp_components/register_node_macro.hpp"
@@ -26,7 +26,7 @@ namespace action_tutorials_cpp
2626
class FibonacciActionServer : public rclcpp::Node
2727
{
2828
public:
29-
using Fibonacci = action_tutorials_interfaces::action::Fibonacci;
29+
using Fibonacci = example_interfaces::action::Fibonacci;
3030
using GoalHandleFibonacci = rclcpp_action::ServerGoalHandle<Fibonacci>;
3131

3232
ACTION_TUTORIALS_CPP_PUBLIC
@@ -85,7 +85,7 @@ class FibonacciActionServer : public rclcpp::Node
8585
rclcpp::Rate loop_rate(1);
8686
const auto goal = goal_handle->get_goal();
8787
auto feedback = std::make_shared<Fibonacci::Feedback>();
88-
auto & sequence = feedback->partial_sequence;
88+
auto & sequence = feedback->sequence;
8989
sequence.push_back(0);
9090
sequence.push_back(1);
9191
auto result = std::make_shared<Fibonacci::Result>();

action_tutorials/action_tutorials_interfaces/CHANGELOG.rst

Lines changed: 0 additions & 203 deletions
This file was deleted.

action_tutorials/action_tutorials_interfaces/CMakeLists.txt

Lines changed: 0 additions & 31 deletions
This file was deleted.

action_tutorials/action_tutorials_interfaces/README.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

action_tutorials/action_tutorials_interfaces/action/Fibonacci.action

Lines changed: 0 additions & 5 deletions
This file was deleted.

action_tutorials/action_tutorials_interfaces/package.xml

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)