Closed alexanderdsmith closed 6 months ago
Update - it appears that the Robot Model was not being properly initialized in the RobotInterfaceBase. This was resolved by adding a setting for the robot model, then setting self._klamptModel to the robotModel loaded in klampt_control
I am attempting to control a real robot using ur5_ril.py, with an added make function using a RobotInterfaceCompleter.
q_in is an 8 float array, and buf['q_commanded'] from the shared map for the XML RPC controller is a 6 float array. Removing the first and last elements of q_in match the buffer causes the following error:
$ klampt_control --server localhost:7881 Klampt-examples/robotinfo/ur5/ur5_real.json klampt.vis: using Qt5 as the visualization backend klampt_control: a GUI to control a Klamp't Robot Interface Layer (RIL) robot
Loading /home/eye-exam-system/Documents/Code/Klampt-examples/data/robots/ur5.rob from paths ['Klampt-examples/robotinfo/ur5'] WorldModel::LoadRobot: /home/eye-exam-system/Documents/Code/Klampt-examples/data/robots/ur5.rob RobParser: Reading robot file /home/eye-exam-system/Documents/Code/Klampt-examples/data/robots/ur5.rob... RobParser: Parsing robot file, 8 links read... RobParser: Loaded geometries in time 0.002629s, 5340 total primitive elements RobParser: Done loading robot file /home/eye-exam-system/Documents/Code/Klampt-examples/data/robots/ur5.rob Try path /home/eye-exam-system/Documents/Code/Klampt-examples/robotinfo/ur5/controller Attempting to connect to UR5 dashboard Connected: Universal Robots Dashboard Server Opening RIL server on localhost 7881 Beginning Robot Interface Layer server for controller Completer(UR5RobotInterface) Press Ctrl+C to exit... Server initializing base interface StatefulWrapper(Completer(UR5RobotInterface)) Arm already activated Waiting for connection from UR5... RobotInterfaceCompleter(UR5RobotInterface): Starting with clock 0.0007038116455078125 Error received during first call of beginStep of base Completer(UR5RobotInterface) Traceback (most recent call last): File "/home/eye-exam-system/.local/lib/python3.10/site-packages/klampt/control/robotinterfaceutils.py", line 1577, in _try if self._has[fn]: KeyError: 'beginStep'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/eye-exam-system/.local/bin/klampt_control", line 8, in
sys.exit(main())
File "/home/eye-exam-system/.local/lib/python3.10/site-packages/klampt/apps/klampt_control.py", line 1328, in main
server.serve()
File "/home/eye-exam-system/.local/lib/python3.10/site-packages/klampt/control/networkrobotinterface.py", line 286, in serve
if not ServerRobotInterfaceBase.initialize(self):
File "/home/eye-exam-system/.local/lib/python3.10/site-packages/klampt/control/networkrobotinterface.py", line 208, in initialize
if not self._base.initialize():
File "/home/eye-exam-system/.local/lib/python3.10/site-packages/klampt/control/robotinterfaceutils.py", line 1607, in initialize
self._try('beginStep',())
File "/home/eye-exam-system/.local/lib/python3.10/site-packages/klampt/control/robotinterfaceutils.py", line 1582, in _try
res = getattr(self._base,fn)(*args)
File "/home/eye-exam-system/.local/lib/python3.10/site-packages/klampt/control/robotinterfaceutils.py", line 2629, in beginStep
self._emulator.initialize(qsns,vsns,tsns,qcmd,vcmd,tcmd)
File "/home/eye-exam-system/.local/lib/python3.10/site-packages/klampt/control/robotinterfaceutils.py", line 4239, in initialize
assert qcmd is None or len(qcmd) == len(self.jointData)
AssertionError