···133 flags af = get_flags(a);
134 flags bf = get_flags(b);
135136- // If either of the relations does not have a valid or tracked flag, the entire chain loses that flag.
137- flags nf = {};
138- nf.has_orientation = af.has_orientation && bf.has_orientation;
139- nf.has_position = af.has_position && bf.has_position;
140- nf.has_tracked_orientation = af.has_tracked_orientation && bf.has_tracked_orientation;
141- nf.has_tracked_position = af.has_tracked_position && bf.has_tracked_position;
142- nf.has_linear_velocity = af.has_linear_velocity && bf.has_linear_velocity;
143- nf.has_angular_velocity = af.has_angular_velocity && bf.has_angular_velocity;
144-145 struct xrt_pose pose = XRT_POSE_IDENTITY;
146 struct xrt_vec3 linear_velocity = XRT_VEC3_ZERO;
147 struct xrt_vec3 angular_velocity = XRT_VEC3_ZERO;
···158 // work. The flags of the result are determined in nf and not taken from the result of the transform.
159 make_valid_pose(af, &a->pose, &body_pose);
160 make_valid_pose(bf, &b->pose, &base_pose);
000000000000000000000000000000161162 // Not already valid poses needed to be made valid because the transoformed pose would be undefined otherwise
163 // and we still want e.g. valid positions.
···133 flags af = get_flags(a);
134 flags bf = get_flags(b);
135000000000136 struct xrt_pose pose = XRT_POSE_IDENTITY;
137 struct xrt_vec3 linear_velocity = XRT_VEC3_ZERO;
138 struct xrt_vec3 angular_velocity = XRT_VEC3_ZERO;
···149 // work. The flags of the result are determined in nf and not taken from the result of the transform.
150 make_valid_pose(af, &a->pose, &body_pose);
151 make_valid_pose(bf, &b->pose, &base_pose);
152+153+154+ // This is a band aid to make 3dof devices work until we have a real solution.
155+ // A 3dof device may return a relation with only orientation valid/tracked and no position.
156+ //
157+ // Monado wants to apply a predefined offset to 3dof devices, giving them a position.
158+ //
159+ // But per the comment below "If either of the relations does not have a valid or tracked flag, the entire chain
160+ // loses that flag".
161+ //
162+ // For now we upgrade every relation that only has an orientation, to also have a position. Note that
163+ // make_valid_pose zeroed the position if has_position was not set originally, ensuring there are no garbage
164+ // values propagated.
165+ if (af.has_orientation && !af.has_position) {
166+ af.has_position = true;
167+ }
168+ if (bf.has_orientation && !bf.has_position) {
169+ bf.has_position = true;
170+ }
171+172+173+ // If either of the relations does not have a valid or tracked flag, the entire chain loses that flag.
174+ flags nf = {};
175+ nf.has_orientation = af.has_orientation && bf.has_orientation;
176+ nf.has_position = af.has_position && bf.has_position;
177+ nf.has_tracked_orientation = af.has_tracked_orientation && bf.has_tracked_orientation;
178+ nf.has_tracked_position = af.has_tracked_position && bf.has_tracked_position;
179+ nf.has_linear_velocity = af.has_linear_velocity && bf.has_linear_velocity;
180+ nf.has_angular_velocity = af.has_angular_velocity && bf.has_angular_velocity;
181+182183 // Not already valid poses needed to be made valid because the transoformed pose would be undefined otherwise
184 // and we still want e.g. valid positions.