15 #ifndef TRAFFIC_SIMULATOR__TEST__TRAFFIC_LIGHTS__HELPER_HPP_
16 #define TRAFFIC_SIMULATOR__TEST__TRAFFIC_LIGHTS__HELPER_HPP_
18 #include <rclcpp/time.hpp>
19 #include <std_msgs/msg/header.hpp>
29 inline auto getTime(
const builtin_interfaces::msg::Time & time) ->
int
31 static constexpr
int nanosecond_multiplier =
static_cast<int>(1e+9);
32 return static_cast<int>(time.sec) * nanosecond_multiplier +
static_cast<int>(time.nanosec);
36 inline auto getTime(
const std_msgs::msg::Header & header) ->
int {
return getTime(header.stamp); }
39 inline auto getTime(
const rclcpp::Time & time) ->
int
41 return static_cast<int>(time.nanoseconds());
std::string string
Definition: junit5.hpp:26
auto stateFromShape(const std::string &shape) -> std::string
Definition: helper.hpp:25
auto getTime(const builtin_interfaces::msg::Time &time) -> int
Returns time in nanoseconds.
Definition: helper.hpp:29
auto stateFromStatus(const std::string &status) -> std::string
Definition: helper.hpp:24
auto stateFromColor(const std::string &color) -> std::string
Helper functions.
Definition: helper.hpp:23