13 #include <type_traits> 25 template<
typename T, typename ::std::enable_if_t<
26 ::std::is_same<T, ::ros::Time>::value ||
27 ::std::is_same<T, ::ros::WallTime>::value ||
28 ::std::is_same<T, ::ros::SteadyTime>::value ||
29 ::std::is_same<T, ::ros::Duration>::value ||
30 ::std::is_same<T, ::ros::WallDuration>::value
34 ::std::stringstream ss;
39 template<
typename T, typename ::std::enable_if_t<
40 ::std::is_same<T, ::ros::Rate>::value ||
41 ::std::is_same<T, ::ros::WallRate>::value
43 inline ::std::string
to_string(
const T& value)
45 ::std::stringstream ss;
50 template<typename M, ::std::enable_if_t<::ros::message_traits::IsMessage<M>::value>* =
nullptr>
53 ::std::stringstream ss;
55 ::std::string
s = ss.str();
56 if (!s.empty() && s[s.length() - 1] ==
'\n')
57 s.erase(s.length()-1);
inline ::std::string to_string(const ::Eigen::Matrix< Scalar, Rows, Cols, Options, MaxRows, MaxCols > &value)
double frequency(const ::ros::Rate &rate, bool maxCycleTimeMeansZero=false)
Return the frequency represented by the given rate.
Utilities for working with time.
::std::string replace(const ::std::string &str, const ::std::string &from, const ::std::string &to, const ::cras::ReplacePosition &where=::cras::ReplacePosition::EVERYWHERE)
Replace all occurrences of from in str with to.