ros2_control - rolling
Loading...
Searching...
No Matches
sleeping_policies.hpp
1// Copyright 2026 ROS2-Control Development Team
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 <chrono>
18#include <memory>
19
20#include "rclcpp/time.hpp"
21
22namespace controller_manager
23{
25
27{
28 bool use_sim_time{false};
29 bool manage_overruns{true};
30 bool expect_blocking_read_write{false};
31 double minimum_cycle_time{0.0001};
32};
33
35{
36 rclcpp::Time previous_time;
37 std::chrono::steady_clock::time_point next_iteration_time;
38 std::chrono::nanoseconds period{0};
39 rclcpp::Time cycle_end_time; //< The time when work was done in the current cycle.
40};
41} // namespace controller_manager
42
43bool sleep_for_sim_time(
44 std::shared_ptr<controller_manager::ControllerManager> cm,
46
47void sleep_for_blocking_read_write(
48 std::shared_ptr<controller_manager::ControllerManager> cm,
51
52void sleep_for_periodic_cycle(
53 std::shared_ptr<controller_manager::ControllerManager> cm,
Definition controller_manager.hpp:72
Definition sleeping_policies.hpp:35
Definition sleeping_policies.hpp:27