Skip to content

Commit

Permalink
Remove action_tutorials_interfaces. (#701)
Browse files Browse the repository at this point in the history
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 <clalancette@gmail.com>
  • Loading branch information
clalancette authored Sep 6, 2024
1 parent 32169a1 commit 0f2afe5
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 307 deletions.
2 changes: 0 additions & 2 deletions action_tutorials/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,3 @@ Once the action is finished executing, the action client logs the resulting sequ

- [action_tutorials_cpp](./action_tutorials_cpp) implements the described action server and client using the rclcpp library in C++.
- [action_tutorials_py](./action_tutorials_py) implements the described action server and client using the rclpy library in Python.
- [action_tutorials_interfaces](./action_tutorials_interfaces) defines the interface for the Fibonacci action.
This interface takes an *order* as a goal, returns a *partial sequence* as feedback and a *sequence* as a result.
23 changes: 12 additions & 11 deletions action_tutorials/action_tutorials_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,29 @@ endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(action_tutorials_interfaces REQUIRED)
find_package(example_interfaces REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(rclcpp_components REQUIRED)

include_directories(include)

add_library(action_tutorials SHARED
src/fibonacci_action_client.cpp
src/fibonacci_action_server.cpp)
rclcpp_components_register_node(action_tutorials PLUGIN "action_tutorials_cpp::FibonacciActionClient" EXECUTABLE fibonacci_action_client)
rclcpp_components_register_node(action_tutorials PLUGIN "action_tutorials_cpp::FibonacciActionServer" EXECUTABLE fibonacci_action_server)
target_compile_definitions(action_tutorials
PRIVATE "ACTION_TUTORIALS_CPP_BUILDING_DLL")
ament_target_dependencies(action_tutorials
"action_tutorials_interfaces"
"rclcpp"
"rclcpp_action"
"rclcpp_components")

install(TARGETS
action_tutorials
target_include_directories(action_tutorials PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
target_link_libraries(action_tutorials PRIVATE
${example_interfaces_TARGETS}
rclcpp::rclcpp
rclcpp_action::rclcpp_action
rclcpp_components::component
)

install(TARGETS action_tutorials
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
Expand Down
2 changes: 1 addition & 1 deletion action_tutorials/action_tutorials_cpp/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<buildtool_depend>ament_cmake</buildtool_depend>

<depend>action_tutorials_interfaces</depend>
<depend>example_interfaces</depend>
<depend>rclcpp</depend>
<depend>rclcpp_action</depend>
<depend>rclcpp_components</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <string>
#include <sstream>

#include "action_tutorials_interfaces/action/fibonacci.hpp"
#include "example_interfaces/action/fibonacci.hpp"
#include "rclcpp/rclcpp.hpp"
#include "rclcpp_action/rclcpp_action.hpp"
#include "rclcpp_components/register_node_macro.hpp"
Expand All @@ -28,7 +28,7 @@ namespace action_tutorials_cpp
class FibonacciActionClient : public rclcpp::Node
{
public:
using Fibonacci = action_tutorials_interfaces::action::Fibonacci;
using Fibonacci = example_interfaces::action::Fibonacci;
using GoalHandleFibonacci = rclcpp_action::ClientGoalHandle<Fibonacci>;

ACTION_TUTORIALS_CPP_PUBLIC
Expand Down Expand Up @@ -82,7 +82,7 @@ class FibonacciActionClient : public rclcpp::Node
{
std::stringstream ss;
ss << "Next number in sequence received: ";
for (auto number : feedback->partial_sequence) {
for (auto number : feedback->sequence) {
ss << number << " ";
}
RCLCPP_INFO(this->get_logger(), "%s", ss.str().c_str());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <memory>

#include "action_tutorials_interfaces/action/fibonacci.hpp"
#include "example_interfaces/action/fibonacci.hpp"
#include "rclcpp/rclcpp.hpp"
#include "rclcpp_action/rclcpp_action.hpp"
#include "rclcpp_components/register_node_macro.hpp"
Expand All @@ -26,7 +26,7 @@ namespace action_tutorials_cpp
class FibonacciActionServer : public rclcpp::Node
{
public:
using Fibonacci = action_tutorials_interfaces::action::Fibonacci;
using Fibonacci = example_interfaces::action::Fibonacci;
using GoalHandleFibonacci = rclcpp_action::ServerGoalHandle<Fibonacci>;

ACTION_TUTORIALS_CPP_PUBLIC
Expand Down Expand Up @@ -85,7 +85,7 @@ class FibonacciActionServer : public rclcpp::Node
rclcpp::Rate loop_rate(1);
const auto goal = goal_handle->get_goal();
auto feedback = std::make_shared<Fibonacci::Feedback>();
auto & sequence = feedback->partial_sequence;
auto & sequence = feedback->sequence;
sequence.push_back(0);
sequence.push_back(1);
auto result = std::make_shared<Fibonacci::Result>();
Expand Down
203 changes: 0 additions & 203 deletions action_tutorials/action_tutorials_interfaces/CHANGELOG.rst

This file was deleted.

31 changes: 0 additions & 31 deletions action_tutorials/action_tutorials_interfaces/CMakeLists.txt

This file was deleted.

10 changes: 0 additions & 10 deletions action_tutorials/action_tutorials_interfaces/README.md

This file was deleted.

This file was deleted.

28 changes: 0 additions & 28 deletions action_tutorials/action_tutorials_interfaces/package.xml

This file was deleted.

Loading

0 comments on commit 0f2afe5

Please sign in to comment.