From 0f5bf3c2f9fd7481d6b3c7c5364a08fe3ecdb2fb Mon Sep 17 00:00:00 2001 From: Justin Berger Date: Mon, 2 Apr 2018 16:38:04 -0600 Subject: Added documentation about writing a poser --- include/libsurvive/poser.h | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'include/libsurvive') diff --git a/include/libsurvive/poser.h b/include/libsurvive/poser.h index b0b1a7b..dcd0e93 100644 --- a/include/libsurvive/poser.h +++ b/include/libsurvive/poser.h @@ -30,9 +30,36 @@ typedef struct void *userdata; } PoserData; +/** + * Meant to be used by individual posers to report back their findings on the pose of an object back to the invoker of + * the call. + * + * @param poser_data the data pointer passed into the poser function invocation + * @param so The survive object which we are giving a solution for. + * @param lighthouse @deprecated The lighthouse which observed that position. Make it -1 if it was a combination of + * lighthouses. Will be removed in the future. + * @param pose The actual object pose. This is in world space, not in LH space. It must represent a transformation from + * object space of the SO to global space. + */ void PoserData_poser_raw_pose_func(PoserData *poser_data, SurviveObject *so, uint8_t lighthouse, SurvivePose *pose); + +/** + * Meant to be used by individual posers to report back their findings on the pose of a lighthouse. + * + * Note that you are free to assume the position of the lighthouse and solve for the object or vice versa. Most solvers + * assume that the object is at 0,0,0 but this isn't a hard requirement. + * + * @param poser_data the data pointer passed into the poser function invocation + * @param so The survive object which gave us the info for the solution + * @param lighthouse The lighthouse which to solve for + * @param objUp2world For use when solving for both ligthhouse positions. For the first invocation of this function, + * pass in a zero-inited SurvivePose. This function will set that to a relative transform to normalize the space. + * pass the same pose in again for the second lighthouse to get accurate results. + * @param lighthouse_pose This is the assumed or derived position of the given lighthouse. + * @param object_pose This is the assumed or derived position of the tracked object. + */ void PoserData_lighthouse_pose_func(PoserData *poser_data, SurviveObject *so, uint8_t lighthouse, - /* OUTPARAM */ SurvivePose *objUp2world, SurvivePose *lighthouse_poses, + /* OUTPARAM */ SurvivePose *objUp2world, SurvivePose *lighthouse_pose, SurvivePose *object_pose); typedef struct PoserDataIMU { -- cgit v1.2.3