Skip to content

Commit

Permalink
E-Stop-Manager loadable as component
Browse files Browse the repository at this point in the history
  • Loading branch information
Joschi3 committed Jan 18, 2024
1 parent 931e5ea commit 39b0e0b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions e_stop_manager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(e_stop_manager_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(rclcpp_components REQUIRED)

set(CMAKE_CXX_STANDARD 14)

Expand All @@ -14,15 +15,19 @@ set(CMAKE_CXX_STANDARD 14)

include_directories(include)

# library
add_library(${PROJECT_NAME} SHARED
src/e_stop_manager.cpp)
ament_target_dependencies(${PROJECT_NAME}
rclcpp
e_stop_manager_msgs
rclcpp_components
std_msgs
)
rclcpp_components_register_nodes(${PROJECT_NAME} "e_stop_manager::EStopManager")


# node
add_executable(${PROJECT_NAME}_node src/e_stop_manager_node.cpp)
target_link_libraries(${PROJECT_NAME}_node
${PROJECT_NAME}
Expand Down
1 change: 1 addition & 0 deletions e_stop_manager/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<buildtool_depend>ament_cmake</buildtool_depend>
<depend>std_msgs</depend>
<depend>e_stop_manager_msgs</depend>
<depend>rclcpp_components</depend>
<test_depend>ros_testing</test_depend>

<!-- The export tag contains other, unspecified, tags -->
Expand Down
10 changes: 9 additions & 1 deletion e_stop_manager/src/e_stop_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,12 @@ namespace e_stop_manager
}
}

}
}// namespace e_stop_manager

#include "rclcpp_components/register_node_macro.hpp"

// Register the component with class_loader.
// This acts as a sort of entry point, allowing the component to be discoverable when its library
// is being loaded into a running process.
RCLCPP_COMPONENTS_REGISTER_NODE(e_stop_manager::EStopManager);

0 comments on commit 39b0e0b

Please sign in to comment.