The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

d/ulv5: Rename internal variables/macros

+30 -30
+30 -30
src/xrt/drivers/ultraleap_v5/ulv5_driver.cpp
··· 168 168 void 169 169 ulv5_process_hand(LEAP_HAND hand, struct ulv5_device *ulv5d, int handedness) 170 170 { 171 - struct xrt_hand_joint_set dummy_joint_set; 171 + struct xrt_hand_joint_set joint_set; 172 172 // gives access to individual joints of the joint_set 173 - #define dummy_joint_set(y) &dummy_joint_set.values.hand_joint_set_default[XRT_HAND_JOINT_##y] 173 + #define joint_set(y) &joint_set.values.hand_joint_set_default[XRT_HAND_JOINT_##y] 174 174 175 - ulv5_process_joint(hand.palm.position, hand.palm.orientation, hand.palm.width, dummy_joint_set(PALM)); 175 + ulv5_process_joint(hand.palm.position, hand.palm.orientation, hand.palm.width, joint_set(PALM)); 176 176 // wrist is the next_joint of the arm 177 - ulv5_process_joint(hand.arm.next_joint, hand.arm.rotation, hand.arm.width, dummy_joint_set(WRIST)); 177 + ulv5_process_joint(hand.arm.next_joint, hand.arm.rotation, hand.arm.width, joint_set(WRIST)); 178 178 // thumb 179 179 ulv5_process_joint(hand.thumb.proximal.prev_joint, hand.thumb.proximal.rotation, hand.thumb.proximal.width, 180 - dummy_joint_set(THUMB_METACARPAL)); 180 + joint_set(THUMB_METACARPAL)); 181 181 ulv5_process_joint(hand.thumb.intermediate.prev_joint, hand.thumb.intermediate.rotation, 182 - hand.thumb.intermediate.width, dummy_joint_set(THUMB_PROXIMAL)); 182 + hand.thumb.intermediate.width, joint_set(THUMB_PROXIMAL)); 183 183 ulv5_process_joint(hand.thumb.distal.prev_joint, hand.thumb.distal.rotation, hand.thumb.distal.width, 184 - dummy_joint_set(THUMB_DISTAL)); 184 + joint_set(THUMB_DISTAL)); 185 185 ulv5_process_joint(hand.thumb.distal.next_joint, hand.thumb.distal.rotation, hand.thumb.distal.width, 186 - dummy_joint_set(THUMB_TIP)); 186 + joint_set(THUMB_TIP)); 187 187 // index 188 188 ulv5_process_joint(hand.index.metacarpal.prev_joint, hand.index.metacarpal.rotation, 189 - hand.index.metacarpal.width, dummy_joint_set(INDEX_METACARPAL)); 189 + hand.index.metacarpal.width, joint_set(INDEX_METACARPAL)); 190 190 ulv5_process_joint(hand.index.proximal.prev_joint, hand.index.proximal.rotation, hand.index.proximal.width, 191 - dummy_joint_set(INDEX_PROXIMAL)); 191 + joint_set(INDEX_PROXIMAL)); 192 192 ulv5_process_joint(hand.index.intermediate.prev_joint, hand.index.intermediate.rotation, 193 - hand.index.intermediate.width, dummy_joint_set(INDEX_INTERMEDIATE)); 193 + hand.index.intermediate.width, joint_set(INDEX_INTERMEDIATE)); 194 194 ulv5_process_joint(hand.index.distal.prev_joint, hand.index.distal.rotation, hand.index.distal.width, 195 - dummy_joint_set(INDEX_DISTAL)); 195 + joint_set(INDEX_DISTAL)); 196 196 ulv5_process_joint(hand.index.distal.next_joint, hand.index.distal.rotation, hand.index.distal.width, 197 - dummy_joint_set(INDEX_TIP)); 197 + joint_set(INDEX_TIP)); 198 198 // middle 199 199 ulv5_process_joint(hand.middle.metacarpal.prev_joint, hand.middle.metacarpal.rotation, 200 - hand.middle.metacarpal.width, dummy_joint_set(MIDDLE_METACARPAL)); 200 + hand.middle.metacarpal.width, joint_set(MIDDLE_METACARPAL)); 201 201 ulv5_process_joint(hand.middle.proximal.prev_joint, hand.middle.proximal.rotation, hand.middle.proximal.width, 202 - dummy_joint_set(MIDDLE_PROXIMAL)); 202 + joint_set(MIDDLE_PROXIMAL)); 203 203 ulv5_process_joint(hand.middle.intermediate.prev_joint, hand.middle.intermediate.rotation, 204 - hand.middle.intermediate.width, dummy_joint_set(MIDDLE_INTERMEDIATE)); 204 + hand.middle.intermediate.width, joint_set(MIDDLE_INTERMEDIATE)); 205 205 ulv5_process_joint(hand.middle.distal.prev_joint, hand.middle.distal.rotation, hand.middle.distal.width, 206 - dummy_joint_set(MIDDLE_DISTAL)); 206 + joint_set(MIDDLE_DISTAL)); 207 207 ulv5_process_joint(hand.middle.distal.next_joint, hand.middle.distal.rotation, hand.middle.distal.width, 208 - dummy_joint_set(MIDDLE_TIP)); 208 + joint_set(MIDDLE_TIP)); 209 209 // ring 210 210 ulv5_process_joint(hand.ring.metacarpal.prev_joint, hand.ring.metacarpal.rotation, hand.ring.metacarpal.width, 211 - dummy_joint_set(RING_METACARPAL)); 211 + joint_set(RING_METACARPAL)); 212 212 ulv5_process_joint(hand.ring.proximal.prev_joint, hand.ring.proximal.rotation, hand.ring.proximal.width, 213 - dummy_joint_set(RING_PROXIMAL)); 213 + joint_set(RING_PROXIMAL)); 214 214 ulv5_process_joint(hand.ring.intermediate.prev_joint, hand.ring.intermediate.rotation, 215 - hand.ring.intermediate.width, dummy_joint_set(RING_INTERMEDIATE)); 215 + hand.ring.intermediate.width, joint_set(RING_INTERMEDIATE)); 216 216 ulv5_process_joint(hand.ring.distal.prev_joint, hand.ring.distal.rotation, hand.ring.distal.width, 217 - dummy_joint_set(RING_DISTAL)); 217 + joint_set(RING_DISTAL)); 218 218 ulv5_process_joint(hand.ring.distal.next_joint, hand.ring.distal.rotation, hand.ring.distal.width, 219 - dummy_joint_set(RING_TIP)); 219 + joint_set(RING_TIP)); 220 220 // pinky 221 221 ulv5_process_joint(hand.pinky.metacarpal.prev_joint, hand.pinky.metacarpal.rotation, 222 - hand.pinky.metacarpal.width, dummy_joint_set(LITTLE_METACARPAL)); 222 + hand.pinky.metacarpal.width, joint_set(LITTLE_METACARPAL)); 223 223 ulv5_process_joint(hand.pinky.proximal.prev_joint, hand.pinky.proximal.rotation, hand.pinky.proximal.width, 224 - dummy_joint_set(LITTLE_PROXIMAL)); 224 + joint_set(LITTLE_PROXIMAL)); 225 225 ulv5_process_joint(hand.pinky.intermediate.prev_joint, hand.pinky.intermediate.rotation, 226 - hand.pinky.intermediate.width, dummy_joint_set(LITTLE_INTERMEDIATE)); 226 + hand.pinky.intermediate.width, joint_set(LITTLE_INTERMEDIATE)); 227 227 ulv5_process_joint(hand.pinky.distal.prev_joint, hand.pinky.distal.rotation, hand.pinky.distal.width, 228 - dummy_joint_set(LITTLE_DISTAL)); 228 + joint_set(LITTLE_DISTAL)); 229 229 ulv5_process_joint(hand.pinky.distal.next_joint, hand.pinky.distal.rotation, hand.pinky.distal.width, 230 - dummy_joint_set(LITTLE_TIP)); 230 + joint_set(LITTLE_TIP)); 231 231 232 232 // copy over to ulv5d joint set 233 233 os_thread_helper_lock(&ulv5d->oth); 234 - memcpy(&ulv5d->joint_set[handedness], &dummy_joint_set, sizeof(struct xrt_hand_joint_set)); 234 + memcpy(&ulv5d->joint_set[handedness], &joint_set, sizeof(struct xrt_hand_joint_set)); 235 235 os_thread_helper_unlock(&ulv5d->oth); 236 236 } 237 237 ··· 339 339 return XRT_SUCCESS; 340 340 } 341 341 342 - } // extern "C" 342 + } // extern "C"