Post

Replies

Boosts

Views

Activity

Reply to Type 'VNRecognizedPointKey' has no member 'thumbTip'
Sorry to answer my own question, I have got it working. I think they not only changed the naming, but also changed how the function is called. Lastly, wrist is no longer a joint group name, so you can just obtain the point "wrist" instead of obtaining the group first. For these who are interested:        try handler.perform([handPoseRequest])       // Continue only when a hand was detected in the frame.       // Since we set the maximumHandCount property of the request to 1, there will be at most one observation.       guard let observation = handPoseRequest.results?.first else {         self.state = "no hand"         return       }       // Get points for thumb and index finger.       let thumbPoints = try observation.recognizedPoints(VNHumanHandPoseObservation.JointsGroupName.thumb)       let indexFingerPoints = try observation.recognizedPoints(VNHumanHandPoseObservation.JointsGroupName.indexFinger)       let middleFingerPoints = try observation.recognizedPoints(VNHumanHandPoseObservation.JointsGroupName.middleFinger)       let ringFingerPoints = try observation.recognizedPoints(VNHumanHandPoseObservation.JointsGroupName.ringFinger)       let littleFingerPoints = try observation.recognizedPoints(VNHumanHandPoseObservation.JointsGroupName.littleFinger)       let wristPoint = try observation.recognizedPoint(VNHumanHandPoseObservation.JointName.wrist)               // Look for tip points.       guard let thumbTipPoint = thumbPoints[.thumbIP],          let thumbIpPoint = thumbPoints[.thumbIP],          let thumbMpPoint = thumbPoints[.thumbMP],          let thumbCMCPoint = thumbPoints[.thumbCMC] else {         self.state = "no tip"         return       }               guard let indexTipPoint = indexFingerPoints[.indexTip],          let indexDipPoint = indexFingerPoints[.indexDIP],          let indexPipPoint = indexFingerPoints[.indexPIP],          let indexMcpPoint = indexFingerPoints[.indexMCP] else {         self.state = "no index"         return       }               guard let middleTipPoint = middleFingerPoints[.middleTip],          let middleDipPoint = middleFingerPoints[.middleDIP],          let middlePipPoint = middleFingerPoints[.middlePIP],          let middleMcpPoint = middleFingerPoints[.middleMCP] else {         self.state = "no middle"         return       }               guard let ringTipPoint = ringFingerPoints[.ringTip],          let ringDipPoint = ringFingerPoints[.ringDIP],          let ringPipPoint = ringFingerPoints[.ringPIP],          let ringMcpPoint = ringFingerPoints[.ringMCP] else {         self.state = "no ring"         return       }               guard let littleTipPoint = littleFingerPoints[.littleTip],          let littleDipPoint = littleFingerPoints[.littleDIP],          let littlePipPoint = littleFingerPoints[.littlePIP],          let littleMcpPoint = littleFingerPoints[.littleMCP] else {         self.state = "no little"         return       }
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’21
Reply to Fatal errorUnexpectedly found nil while unwrapping an Optional value
Sorry the previous code was the old version, the rest of the lines are not suppose to have ! Anyway I tried and indeed found that it is complaining the scene is not found from the console output. couldn't find scene: art.scnassets/Pokeball.scn How can it failed to find the file?
Topic: Spatial Computing SubTopic: ARKit Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to Type 'VNRecognizedPointKey' has no member 'thumbTip'
Sorry to answer my own question, I have got it working. I think they not only changed the naming, but also changed how the function is called. Lastly, wrist is no longer a joint group name, so you can just obtain the point "wrist" instead of obtaining the group first. For these who are interested:        try handler.perform([handPoseRequest])       // Continue only when a hand was detected in the frame.       // Since we set the maximumHandCount property of the request to 1, there will be at most one observation.       guard let observation = handPoseRequest.results?.first else {         self.state = "no hand"         return       }       // Get points for thumb and index finger.       let thumbPoints = try observation.recognizedPoints(VNHumanHandPoseObservation.JointsGroupName.thumb)       let indexFingerPoints = try observation.recognizedPoints(VNHumanHandPoseObservation.JointsGroupName.indexFinger)       let middleFingerPoints = try observation.recognizedPoints(VNHumanHandPoseObservation.JointsGroupName.middleFinger)       let ringFingerPoints = try observation.recognizedPoints(VNHumanHandPoseObservation.JointsGroupName.ringFinger)       let littleFingerPoints = try observation.recognizedPoints(VNHumanHandPoseObservation.JointsGroupName.littleFinger)       let wristPoint = try observation.recognizedPoint(VNHumanHandPoseObservation.JointName.wrist)               // Look for tip points.       guard let thumbTipPoint = thumbPoints[.thumbIP],          let thumbIpPoint = thumbPoints[.thumbIP],          let thumbMpPoint = thumbPoints[.thumbMP],          let thumbCMCPoint = thumbPoints[.thumbCMC] else {         self.state = "no tip"         return       }               guard let indexTipPoint = indexFingerPoints[.indexTip],          let indexDipPoint = indexFingerPoints[.indexDIP],          let indexPipPoint = indexFingerPoints[.indexPIP],          let indexMcpPoint = indexFingerPoints[.indexMCP] else {         self.state = "no index"         return       }               guard let middleTipPoint = middleFingerPoints[.middleTip],          let middleDipPoint = middleFingerPoints[.middleDIP],          let middlePipPoint = middleFingerPoints[.middlePIP],          let middleMcpPoint = middleFingerPoints[.middleMCP] else {         self.state = "no middle"         return       }               guard let ringTipPoint = ringFingerPoints[.ringTip],          let ringDipPoint = ringFingerPoints[.ringDIP],          let ringPipPoint = ringFingerPoints[.ringPIP],          let ringMcpPoint = ringFingerPoints[.ringMCP] else {         self.state = "no ring"         return       }               guard let littleTipPoint = littleFingerPoints[.littleTip],          let littleDipPoint = littleFingerPoints[.littleDIP],          let littlePipPoint = littleFingerPoints[.littlePIP],          let littleMcpPoint = littleFingerPoints[.littleMCP] else {         self.state = "no little"         return       }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’21