SMACC2
Loading...
Searching...
No Matches
cl_ros2_timer.hpp
Go to the documentation of this file.
1// Copyright 2021 RobosoftAI Inc.
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#pragma once
16
17#include <boost/signals2.hpp>
18#include <chrono>
19#include <optional>
20#include <smacc2/smacc.hpp>
21
24
26{
27template <typename TSource, typename TOrthogonal>
28struct EvTimer : sc::event<EvTimer<TSource, TOrthogonal>>
29{
30};
31
33{
34public:
35 ClRos2Timer(rclcpp::Duration duration, bool oneshot = false);
36
37 virtual ~ClRos2Timer();
38
39 // Component-based initialization
40 template <typename TOrthogonal, typename TClient>
42 {
43 // Create the core timer component
46
47 // Create the timer listener component that requires CpRos2Timer
49 }
50
51private:
52 rclcpp::Duration duration_;
54};
55} // namespace cl_ros2_timer
ClRos2Timer(rclcpp::Duration duration, bool oneshot=false)
SmaccComponentType * createComponent(TArgs... targs)