.. _program_listing_file__tmp_ws_src_tuw_msgs_tuw_geometry_msgs_include_tuw_geometry_msgs_pose_json.hpp: Program Listing for File pose_json.hpp ====================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/tuw_msgs/tuw_geometry_msgs/include/tuw_geometry_msgs/pose_json.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef TUW_JSON__POSE_JSON_HPP_ #define TUW_JSON__POSE_JSON_HPP_ #include #include #include namespace tuw_json { inline Json::Value toJson(const geometry_msgs::msg::Pose & src) { Json::Value json; json["position"] = toJson(src.position); json["orientation"] = toJson(src.orientation); return json; } inline geometry_msgs::msg::Pose & fromJson(const Json::Value & json, geometry_msgs::msg::Pose & des) { fromJson(json.get("position", ""), des.position); fromJson(json.get("orientation", ""), des.orientation); return des; } } // namespace tuw_json #endif // TUW_JSON__POSE_JSON_HPP_