ROBOMATH.POINT_AXIS_2_POSE DOES NOT EXIST可打印版本 +- RoboDK Forum (//m.sinclairbody.com/forum) +-- Forum: RoboDK (EN) (//m.sinclairbody.com/forum/Forum-RoboDK-EN) + - - -论坛:RoboDK错误(//m.sinclairbody.com/forum/Forum-RoboDK-bugs) +--- Thread: ROBOMATH.POINT_AXIS_2_POSE DOES NOT EXIST (/Thread-ROBOMATH-POINT-AXIS-2-POSE-DOES-NOT-EXIST) |
ROBOMATH.POINT_AXIS_2_POSE DOES NOT EXIST-sig.johnnson-05-10-2023 In `robomath.py`, `point_Zaxis_2_pose()` exists, but `point_Xaxis_2_pose()`and `point_Yaxis_2_pose()` do not exist, even though they are documented in the API reference://m.sinclairbody.com/doc/en/PythonAPI/robodk.html#robodk.robomath.point_Xaxis_2_pose RE: ROBOMATH.POINT_AXIS_2_POSE DOES NOT EXIST-Sam-05-10-2023 These additions are fairly recent. Did you update the robodk package? pip install robodk --upgrade You can see they are present in the source code: https://github.com/RoboDK/RoboDK-API/blob/496fa60af5beff03e342624aec2b13794fa784ae/Python/robodk/robomath.py#L233 RE: ROBOMATH.POINT_AXIS_2_POSE DOES NOT EXIST-sig.johnnson-05-10-2023 Thanks, Sam. I'm on 5.5.5. It looks like `pip install robodk --upgrade` did nothing, unfortunately. Pip has been problematic for me lately, so I'm just going to copy-paste the GitHub code. Would you be able to provide additional information for how this method works? Specifically: 1. What reference frame is the returned pose in? 2. What reference frame is the hint assumed to be in? If you have an example use, that would be very helpful. I am having some trouble figuring out why it is behaving like it is behaving. RE: ROBOMATH.POINT_AXIS_2_POSE DOES NOT EXIST-Sam-05-10-2023 You can use point_Zaxis_2_pose() when converting from a point with a normal vector (xyzijk) to a pose. As points don't have orientation around the normal axis, this function will attempt to align the Y axis to the axis hints. Attempt, as it can fail if the z axis and the axis hint are the parallel. To point the Z axis of a pose along IJK, and attempt to point the Y axis to Z+, you would use point_Zaxis_2_pose(xyz, ijk, [0,0,1]) Here's an example: https://github.com/RoboDK/Plug-In-Interface/blob/master/PluginAppLoader/Apps/CurveUtilities/CurveToTargets.py#L78 I agree they should be better documented. RE: ROBOMATH.POINT_AXIS_2_POSE DOES NOT EXIST-sig.johnnson-05-10-2023 Thanks, Sam. That makes sense. Looks like this is behaving as-expected. The problem is in another part of my code. |