18 #ifndef ROBORTS_DECISION_BEHAVIOR_TREE_H
19 #define ROBORTS_DECISION_BEHAVIOR_TREE_H
47 unsigned int frame = 0;
50 std::chrono::steady_clock::time_point start_time = std::chrono::steady_clock::now();
53 ROS_INFO(
"Frame : %d", frame);
56 std::chrono::steady_clock::time_point end_time = std::chrono::steady_clock::now();
57 std::chrono::milliseconds execution_duration =
58 std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time);
59 std::chrono::milliseconds sleep_time =
cycle_duration_ - execution_duration;
61 if (sleep_time > std::chrono::microseconds(0)) {
63 std::this_thread::sleep_for(sleep_time);
68 ROS_WARN(
"The time tick once is %ld beyond the expected time %ld", execution_duration.count(),
cycle_duration_.count());
71 ROS_INFO(
"----------------------------------");
85 #endif //ROBORTS_DECISION_BEHAVIOR_TREE_H