11-17-2022, 06:27 AM
collision_test_scene开放。从这个线程rdk:
//www.sinclairbody.com/forum/Thread-Targets-...rgets-move
Now close the station and try to access Joints(). Fails as expected:
Now reopen the same station and try again. t.Joints() now points at the robot's joints. You can verify this by jogging a robot joint and then querying Joints() again. t.Name() still raises an exception as it should.
t.setJoints() likewise moves the robot's joints.
Seems like what you intended is for Joints() to raise an exception like the other methods do after the station has been closed.
//www.sinclairbody.com/forum/Thread-Targets-...rgets-move
Code:
>>> t = rdk.Item('Target 5')
>>> t.Joints()
Matrix: (6, 1)
[[ 64.011 ],
[ -123.779 ],
[ -112.164 ],
[ -34.057 ],
[ 90.000 ],
[ 64.011 ]]
Now close the station and try to access Joints(). Fails as expected:
Code:
>>> t.Joints()
Invalid item provided: The item identifier provided is not valid or it does not exist.
Traceback (most recent call last):
File "", line 1, in
File "/home/j/RoboDK/Python/robodk/robolink.py", line 4775, in Joints
self.link._check_status()
File "/home/j/RoboDK/Python/robodk/robolink.py", line 764, in _check_status
raise Exception(self.LAST_STATUS_MESSAGE)
Exception: Invalid item provided: The item identifier provided is not valid or it does not exist.
Now reopen the same station and try again. t.Joints() now points at the robot's joints. You can verify this by jogging a robot joint and then querying Joints() again. t.Name() still raises an exception as it should.
Code:
>>> t.Joints()
Matrix: (6, 1)
[[ 0.985 ],
[ -90.520 ],
[ -90.341 ],
[ -0.524 ],
[ 90.000 ],
[ 0.985 ]]
>>> t.Name()
Invalid item provided: The item identifier provided is not valid or it does not exist.
Traceback (most recent call last):
File "", line 1, in
File "/home/j/RoboDK/Python/robodk/robolink.py", line 4227, in Name
self.link._check_status()
File "/home/j/RoboDK/Python/robodk/robolink.py", line 764, in _check_status
raise Exception(self.LAST_STATUS_MESSAGE)
Exception: Invalid item provided: The item identifier provided is not valid or it does not exist.
t.setJoints() likewise moves the robot's joints.
Seems like what you intended is for Joints() to raise an exception like the other methods do after the station has been closed.