.. _program_listing_file__tmp_ws_src_tuw_msgs_tuw_msgs_include_tuw_msgs_utils.hpp: Program Listing for File utils.hpp ================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/tuw_msgs/tuw_msgs/include/tuw_msgs/utils.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef TUW_MSGS__UTILS_HPP_ #define TUW_MSGS__UTILS_HPP_ #include #include #include namespace tuw_msgs { using Idx = int64_t; enum Format { COMPACT, LOOSE, }; size_t nr_of_leading_spaces(const std::string & inputString); std::string remove_spaces(std::string str); void rpy_to_quaternion( double roll, double pitch, double yaw, double & qx, double & qy, double & qz, double & qw); template bool is_similar(const T & a, const T & b, T epsilon) { return std::abs(a - b) < epsilon; } bool is_equal(const geometry_msgs::msg::Point & a, const geometry_msgs::msg::Point & b); bool is_equal(const geometry_msgs::msg::Quaternion & a, const geometry_msgs::msg::Quaternion & b); bool is_equal(const geometry_msgs::msg::Pose & a, const geometry_msgs::msg::Pose & b); bool is_similar( const geometry_msgs::msg::Point & a, const geometry_msgs::msg::Point & b, double epsilon = 0.0001); bool is_similar( const geometry_msgs::msg::Quaternion & a, const geometry_msgs::msg::Quaternion & b, double epsilon = 0.0001); bool is_similar( const geometry_msgs::msg::Pose & a, const geometry_msgs::msg::Pose & b, double epsilon_position = 0.0001, double epsilon_orientation = 0.0001); bool is_similar(const std::string & a, const std::string & b); bool is_similar_with_cout(const std::string & a, const std::string & b); } // namespace tuw_msgs #endif // TUW_MSGS__UTILS_HPP_