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/RegionOfInterest.h> 44 #include <rc_silhouettematch_client/ObjectToDetect.h> 46 #include <rc_silhouettematch_client/CalibrateBasePlane.h> 47 #include <rc_silhouettematch_client/GetBasePlaneCalibration.h> 48 #include <rc_silhouettematch_client/DeleteBasePlaneCalibration.h> 49 #include <rc_silhouettematch_client/SetRegionOfInterest.h> 50 #include <rc_silhouettematch_client/GetRegionsOfInterest.h> 51 #include <rc_silhouettematch_client/DeleteRegionsOfInterest.h> 52 #include <rc_silhouettematch_client/DetectObject.h> 58 j.at(
"value").get_to(r.value);
59 j.at(
"message").get_to(r.message);
68 j.at(
"timestamp").get_to(r.timestamp);
69 j.at(
"id").get_to(r.id);
70 j.at(
"object_id").get_to(r.object_id);
71 j.at(
"pose_frame").get_to(r.pose_frame);
72 j.at(
"pose").get_to(r.pose);
77 j[
"distance"] = r.distance;
78 j[
"normal"] = r.normal;
83 j.at(
"pose_frame").get_to(r.pose_frame);
84 j.at(
"distance").get_to(r.distance);
85 j.at(
"normal").get_to(r.normal);
91 j[
"offset_x"] = r.offset_x;
92 j[
"offset_y"] = r.offset_y;
94 j[
"height"] = r.height;
99 j.at(
"id").get_to(r.id);
100 j.at(
"offset_x").get_to(r.offset_x);
101 j.at(
"offset_y").get_to(r.offset_y);
102 j.at(
"width").get_to(r.width);
103 j.at(
"height").get_to(r.height);
108 j[
"object_id"] = r.object_id;
109 j[
"region_of_interest_2d_id"] = r.region_of_interest_2d_id;
114 j.at(
"object_id").get_to(r.object_id);
115 j.at(
"region_of_interest_2d_id").get_to(r.region_of_interest_2d_id);
120 j[
"object_to_detect"] = r.object_to_detect;
121 j[
"offset"] = r.offset;
122 j[
"pose_frame"] = r.pose_frame;
123 j[
"robot_pose"] = r.robot_pose;
128 j.at(
"timestamp").get_to(r.timestamp);
129 j.at(
"return_code").get_to(r.return_code);
130 j.at(
"object_id").get_to(r.object_id);
131 j.at(
"instances").get_to(r.instances);
136 j[
"pose_frame"] = r.pose_frame;
137 j[
"robot_pose"] = r.robot_pose;
138 j[
"plane_estimation_method"] = r.plane_estimation_method;
139 j[
"region_of_interest_2d_id"] = r.region_of_interest_2d_id;
140 j[
"offset"] = r.offset;
141 if (r.plane_estimation_method ==
"STEREO")
143 j[
"stereo"] = { {
"plane_preference", r.stereo.plane_preference } };
147 j[
"plane"] = r.plane;
153 j.at(
"timestamp").get_to(r.timestamp);
154 j.at(
"return_code").get_to(r.return_code);
155 j.at(
"plane").get_to(r.plane);
160 j[
"pose_frame"] = r.pose_frame;
161 j[
"robot_pose"] = r.robot_pose;
166 j.at(
"return_code").get_to(r.return_code);
167 j.at(
"plane").get_to(r.plane);
177 j.at(
"return_code").get_to(r.return_code);
182 j[
"region_of_interest_2d"] = r.region_of_interest_2d;
187 j.at(
"return_code").get_to(r.return_code);
192 j[
"region_of_interest_2d_ids"] = r.region_of_interest_2d_ids;
197 j.at(
"regions_of_interest").get_to(r.regions_of_interest);
198 j.at(
"return_code").get_to(r.return_code);
203 j[
"region_of_interest_2d_ids"] = r.region_of_interest_2d_ids;
208 j.at(
"return_code").get_to(r.return_code);
213 #endif // RC_SILHOUETTEMATCH_CLIENT_JSON_CONVERSIONS_H void to_json(nlohmann::json &j, const DeleteRegionsOfInterest::Request &r)
void from_json(const nlohmann::json &j, ReturnCode &r)