Home Questions How to reach a moving target

How to reach a moving target

DWQA QuestionsCategory: Custom Task DevelopmentHow to reach a moving target
Michael Huang asked 6 years ago
Hi, I am trying to reach a moving target. Once it reaches, the target changes the color. But in my program, it changes color when the cursor reach the starting point no matter where the target actually is. So how to solve this problem. Thanks, Michael
1 Answers
Duncan McLean Staff answered 6 years ago
Hi Michael, The hand in target block makes use of the target table to see if your hand is in a target - the target table is static. So if you are moving the targets around you will need to do some programming in order to determine if your hand is in a moving target. The hand in target block is a good place to start. I would suggest that the hand in target block could be un-linked and edited to accept VCodes for targets rather than target table data. If your targets are circles then you would just need: VCode(3:4) - X,Y position, and VCode(10) - radius. Using that information plus the current hand position from KINData_bus you should be able to calculate whether or not your hand is in that target. I hope that helps. Cheers! Duncan