Move tool based on robotbase frame——打印Version +- RoboDK Forum (//www.sinclairbody.com/forum) +-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN) +--- Forum: RoboDK API (//www.sinclairbody.com/forum/Forum-RoboDK-API) +--- Thread: Move tool based on robotbase frame (/Thread-Move-tool-based-on-robotbase-frame) |
Move tool based on robotbase frame-Kees12Programming-03-14-2023 Hello, im trying to controll a Kuka using a 3D mouse. I use a python crypt to control the Kuka in roboDK live. Currently I can move the tool, but when I turn the coordinates turn aswell. making my upward movement, sideways. i don't understand how I can change that. current code: new_pos = robot.Pose() * transl(moveXYZ) * rotz(moveR) robot.MoveL(new_pos, blocking=False) where moveXYZ is an array consisting of 3 numbers, -1, 0 or 1. example [0, 1, -1]. this array is based on the input of my mouse, so when I point upward and right, the array becomes [-1, 1, 0] this works ofcourse when the tool has no angle. when I turn the tool 90 degrees for example. my array will still be [-1 1, 0] meaning I want to go to the upper right corner(as seen from behind the robotic arm base. but I will now move to the top left(as seen from behind the robotic arm base). How do I move my tool upward? As seen from the robotic base instead of the normal flange/tool frame. 再保险:移动工具基于robotbase框架-Albert-03-15-2023 You can have a translation towards positive Z axis of your coordinate system by multiplying the translation before the robot pose (pre-multiplication):
Code:
new_pos = transl(0,0,moveZ) * robot.Pose() * rotz(moveR)
|