|
| 1 | +// Copyright 2024 Intelligent Robotics Lab |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | + |
| 16 | +#ifndef CS4HOME_CORE__MASTER_HPP_ |
| 17 | +#define CS4HOME_CORE__MASTER_HPP_ |
| 18 | + |
| 19 | +#include <map> |
| 20 | +#include <string> |
| 21 | + |
| 22 | +#include "cs4home_core/CognitiveModule.hpp" |
| 23 | + |
| 24 | +#include "rclcpp_lifecycle/lifecycle_node.hpp" |
| 25 | +#include "rclcpp/rclcpp.hpp" |
| 26 | +#include "rclcpp/macros.hpp" |
| 27 | + |
| 28 | +namespace cs4home_core |
| 29 | +{ |
| 30 | + |
| 31 | +class Master : public rclcpp_lifecycle::LifecycleNode |
| 32 | +{ |
| 33 | +public: |
| 34 | + RCLCPP_SMART_PTR_DEFINITIONS(Master) |
| 35 | + using CallbackReturnT = |
| 36 | + rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn; |
| 37 | + |
| 38 | + explicit Master(const rclcpp::NodeOptions & options = rclcpp::NodeOptions()); |
| 39 | + |
| 40 | + CallbackReturnT on_configure(const rclcpp_lifecycle::State & state); |
| 41 | + CallbackReturnT on_activate(const rclcpp_lifecycle::State & state); |
| 42 | + CallbackReturnT on_deactivate(const rclcpp_lifecycle::State & state); |
| 43 | + CallbackReturnT on_cleanup(const rclcpp_lifecycle::State & state); |
| 44 | + CallbackReturnT on_shutdown(const rclcpp_lifecycle::State & state); |
| 45 | + CallbackReturnT on_error(const rclcpp_lifecycle::State & state); |
| 46 | + |
| 47 | +protected: |
| 48 | + std::map<std::string, cs4home_core::CognitiveModule::SharedPtr> cog_modules_; |
| 49 | +}; |
| 50 | + |
| 51 | +} // namespace cs4home_core |
| 52 | + |
| 53 | +#endif // CS4HOME_CORE__MASTER_HPP_ |
| 54 | + |
| 55 | +// #include "rclcpp_components/register_node_macro.hpp" |
| 56 | +// |
| 57 | +// // Register the component with class_loader. |
| 58 | +// // This acts as a sort of entry point, allowing the component to be discoverable when its library |
| 59 | +// // is being loaded into a running process. |
| 60 | +// RCLCPP_COMPONENTS_REGISTER_NODE(cs4home_core::Master) |
0 commit comments