···262262 return true;
263263}
264264265265+// note: you should be using "position" and "orientation" and lower-case xyz(w)
266266+bool
267267+u_json_get_pose(const cJSON *json, struct xrt_pose *out_pose)
268268+{
269269+ struct xrt_pose tmp;
270270+271271+ bool good = true;
272272+ good = good && u_json_get_vec3(u_json_get(json, "position"), &tmp.position);
273273+ good = good && u_json_get_quat(u_json_get(json, "orientation"), &tmp.orientation);
274274+275275+ if (good) {
276276+ *out_pose = tmp;
277277+ }
278278+ return good;
279279+}
280280+281281+265282size_t
266283u_json_get_float_array(const cJSON *json_array, float *out_array, size_t max_size)
267284{
+9
src/xrt/auxiliary/util/u_json.h
···102102u_json_get_quat(const cJSON *json, struct xrt_quat *out_quat);
103103104104/*!
105105+ * @brief Parse a pose from a JSON object, composed of a vec3 named "position" and a quat named "orientation".
106106+ *
107107+ * @return true if successful, false if not.
108108+ */
109109+bool
110110+u_json_get_pose(const cJSON *json, struct xrt_pose *out_pose);
111111+112112+113113+/*!
105114 * @brief Parse up to max_size floats from a JSON array.
106115 *
107116 * @return the number of elements set.