33 #ifndef RC_JSON_CONVERSIONS_COMMON_H 34 #define RC_JSON_CONVERSIONS_COMMON_H 38 #include <geometry_msgs/Point.h> 39 #include <geometry_msgs/Pose.h> 40 #include <geometry_msgs/Quaternion.h> 41 #include <geometry_msgs/Vector3.h> 42 #include <geometry_msgs/PoseStamped.h> 44 #include <json/json.hpp> 55 j.at(
"x").get_to(r.x);
56 j.at(
"y").get_to(r.y);
57 j.at(
"z").get_to(r.z);
67 j.at(
"x").get_to(r.x);
68 j.at(
"y").get_to(r.y);
69 j.at(
"z").get_to(r.z);
74 j =
nlohmann::json{ {
"x", r.x }, {
"y", r.y }, {
"z", r.z }, {
"w", r.w } };
79 j.at(
"x").get_to(r.x);
80 j.at(
"y").get_to(r.y);
81 j.at(
"z").get_to(r.z);
82 j.at(
"w").get_to(r.w);
87 j[
"position"] = r.position;
88 j[
"orientation"] = r.orientation;
93 j.at(
"position").get_to(r.position);
94 j.at(
"orientation").get_to(r.orientation);
109 j.at(
"sec").get_to(r.
sec);
110 j.at(
"nsec").get_to(r.
nsec);
115 #endif // RC_JSON_CONVERSIONS_COMMON_H void from_json(const nlohmann::json &j, geometry_msgs::Point &r)
void to_json(nlohmann::json &j, const geometry_msgs::Point &r)