04-17-2024, 06:12 PM
Check out the following code:
The last line provokes the following warning message and fails to add an object:
The warning message implies that the issue with the failed call is that the format of the points list is not valid. However, the actual issue is that a shape may only be added to an object, not a reference frame.
This can lead to pointless troubleshooting (guess how I know haha).
Code:
from robodk import robolink as rl
rdk = rl.Robolink()
my_frame = rdk.Item('my_frame')
my_obj = rdk.Item('my_obj')
pts = [[0,0,0], [0,1,0], [0,1,1]]
add_shape_success = rdk.AddShape(pts, add_to=my_obj)
add_shape_fail = rdk.AddShape(pts, add_to=my_frame)
The last line provokes the following warning message and fails to add an object:
Code:
WARNING: Invalid shape, a 3xN (or 6xN) list of points must be provided (N must be multiple of 3)
The warning message implies that the issue with the failed call is that the format of the points list is not valid. However, the actual issue is that a shape may only be added to an object, not a reference frame.
This can lead to pointless troubleshooting (guess how I know haha).