33 #ifndef RC_SILHOUETTEMATCH_CLIENT_JSON_CONVERSIONS_H 34 #define RC_SILHOUETTEMATCH_CLIENT_JSON_CONVERSIONS_H 38 #include <rc_common_msgs/ReturnCode.h> 40 #include <rc_silhouettematch_client/Instance.h> 41 #include <rc_silhouettematch_client/Plane.h> 42 #include <rc_silhouettematch_client/EstimatedPlane.h> 43 #include <rc_silhouettematch_client/ObjectToDetect.h> 45 #include <rc_silhouettematch_client/CalibrateBasePlane.h> 46 #include <rc_silhouettematch_client/GetBasePlaneCalibration.h> 47 #include <rc_silhouettematch_client/DeleteBasePlaneCalibration.h> 48 #include <rc_silhouettematch_client/DetectObject.h> 54 j.at(
"value").get_to(r.value);
55 j.at(
"message").get_to(r.message);
64 j.at(
"timestamp").get_to(r.timestamp);
65 j.at(
"id").get_to(r.id);
66 j.at(
"object_id").get_to(r.object_id);
67 j.at(
"pose_frame").get_to(r.pose_frame);
68 j.at(
"pose").get_to(r.pose);
73 j[
"distance"] = r.distance;
74 j[
"normal"] = r.normal;
79 j.at(
"pose_frame").get_to(r.pose_frame);
80 j.at(
"distance").get_to(r.distance);
81 j.at(
"normal").get_to(r.normal);
86 j[
"object_id"] = r.object_id;
87 j[
"region_of_interest_2d_id"] = r.region_of_interest_2d_id;
92 j.at(
"object_id").get_to(r.object_id);
93 j.at(
"region_of_interest_2d_id").get_to(r.region_of_interest_2d_id);
98 j[
"object_to_detect"] = r.object_to_detect;
99 j[
"offset"] = r.offset;
100 j[
"pose_frame"] = r.pose_frame;
101 j[
"robot_pose"] = r.robot_pose;
106 j.at(
"timestamp").get_to(r.timestamp);
107 j.at(
"return_code").get_to(r.return_code);
108 j.at(
"object_id").get_to(r.object_id);
109 j.at(
"instances").get_to(r.instances);
114 j[
"pose_frame"] = r.pose_frame;
115 j[
"robot_pose"] = r.robot_pose;
116 j[
"plane_estimation_method"] = r.plane_estimation_method;
117 j[
"region_of_interest_2d_id"] = r.region_of_interest_2d_id;
118 j[
"offset"] = r.offset;
119 if (r.plane_estimation_method ==
"STEREO")
121 j[
"stereo"] = { {
"plane_preference", r.stereo.plane_preference } };
125 j[
"plane"] = r.plane;
131 j.at(
"timestamp").get_to(r.timestamp);
132 j.at(
"return_code").get_to(r.return_code);
133 j.at(
"plane").get_to(r.plane);
138 j[
"pose_frame"] = r.pose_frame;
139 j[
"robot_pose"] = r.robot_pose;
144 j.at(
"return_code").get_to(r.return_code);
145 j.at(
"plane").get_to(r.plane);
155 j.at(
"return_code").get_to(r.return_code);
160 #endif // RC_SILHOUETTEMATCH_CLIENT_JSON_CONVERSIONS_H
void to_json(nlohmann::json &j, const DeleteBasePlaneCalibration::Request &r)
void from_json(const nlohmann::json &j, ReturnCode &r)