Make Tool look at point- Printable Version +- RoboDK Forum (//www.sinclairbody.com/forum) +-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN) + - - -论坛:通用RoboDK问题(//www.sinclairbody.com/forum/Forum-General-questions-about-RoboDK) +---Thread: Make Tool look at point (/Thread-Make-Tool-look-at-point) |
Make Tool look at point-Sinistans-06-08-2022 Hello, I'm new to RoboDK and robots in general, and I got problems with orientation and rotation of the tool. My task is to build a "simple scanner" for inspection. A Sensor is attached to a UR5e and I want to move the sensor to a number of points, to look at the target from different angles. Therefore, I need to move the arm to certain position and then orient the sensor, so that the (e.g.) X-Axes of the Tool Frame points at a fixed point. Moving to the point is no problem, but the rotation of the Tool gives me a headache. I tried calculating the necessary rotation angles, but they are somehow wrong. I attached my current script. Does anyone know where my error lies in calculating the rotation, or is there a better approach to keeping a fixed focus on a point? I want to script the movement via python because in later stages of the project, I want to send trigger impulses when a point is reached and continue when the measurement is finished. Thank you for your help RE: Make Tool look at point-Olivier-06-08-2022 Can you attach the file again? I see no attachment. RE: Make Tool look at point-Sinistans-06-09-2022 Sorry, my bad. I think I didn't click "Add Attachment" RE: Make Tool look at point-Olivier-06-09-2022 I suggest you create a RoboDK program to handle the movements and then include python scripts inside the program to trigger the impulses. If you really need it to be all inside a python script, you can read a position from the API and increment its values directly instead of re-calculating all the math behind the scene. RE: Make Tool look at point-Sinistans-06-10-2022 Are there examples you recommend for these approaches? Is there a build in function to handle the orientation of the robot? The sensor we are using has a very narrow field of view and I need it to look exactly at the desired point. Therefore, manually adjusting each orientation is not an option. That is why I tried to calculate the orientation. I come from a programming background and have a lot of experience with python, so this was more intuitive for me. RE: Make Tool look at point-Olivier-06-10-2022 If I understand correctly, you want to move the camera around an object and have the camera precisely pointing toward the object at all time? I suggest you create a TCP that is offset to the center of rotation of the needed movement and then use linear moves between targets to re-orient the camera where you need. See the attached example. |