smooth_feedback
Control and estimation on Lie groups
Loading...
Searching...
No Matches
ros.hpp
Go to the documentation of this file.
1// Copyright (C) 2022 Petter Nilsson. MIT License.
2
3#pragma once
4
10#include <rclcpp/time.hpp>
11
12#include "smooth/feedback/time.hpp"
13
14namespace smooth::feedback {
15
17template<>
18struct time_trait<rclcpp::Time>
19{
21 static rclcpp::Time plus(rclcpp::Time t, double t_dbl) { return t + rclcpp::Duration::from_seconds(t_dbl); }
22
24 static double minus(rclcpp::Time t2, rclcpp::Time t1)
25 {
26 return (t2 - t1).to_chrono<std::chrono::duration<double>>().count();
27 }
28};
29
30} // namespace smooth::feedback
A Time type supports right-addition with a double, and subtraction of two time types should be conver...
Definition: time.hpp:25
static double minus(rclcpp::Time t2, rclcpp::Time t1)
Time minus Time.
Definition: ros.hpp:24
static rclcpp::Time plus(rclcpp::Time t, double t_dbl)
Time plus double.
Definition: ros.hpp:21
Trait class to specify Time operations.
Definition: time.hpp:14