Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'GripperInterface' object has no attribute 'metadata' #17

Open
Ynao3 opened this issue May 24, 2024 · 9 comments
Open

Comments

@Ynao3
Copy link

Ynao3 commented May 24, 2024

WARNING:polymetis.gripper_interface:Metadata unavailable from server.
ERROR:zerorpc.core:
Traceback (most recent call last):
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/zerorpc/core.py", line 153, in _async_task
functor.pattern.process_call(self._context, bufchan, event, functor)
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/zerorpc/patterns.py", line 30, in process_call
result = functor(*req_event.args)
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/zerorpc/decorators.py", line 44, in call
return self._functor(*args, **kargs)
File "/home/zhu/droid/droid/franka/robot.py", line 38, in launch_robot
self._max_gripper_width = self._gripper.metadata.max_width
AttributeError: 'GripperInterface' object has no attribute 'metadata'
/home/zhu/droid/droid/franka/launch_gripper.sh: line 4: 17424 Killed launch_gripper.py gripper=franka_hand
/home/zhu/anaconda3/envs/polymetis-local/bin/launch_robot.py:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import('pkg_resources').require('polymetis==0.2')
/home/zhu/anaconda3/envs/polymetis-local/bin/launch_gripper.py:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import('pkg_resources').require('polymetis==0.2')
Traceback (most recent call last):
File "/home/zhu/droid/droid/fairo/polymetis/polymetis/python/scripts/launch_robot.py", line 84, in main
client.run()
File "/home/zhu/droid/droid/fairo/polymetis/polymetis/python/polymetis/robot_client/executable_robot_client.py", line 79, in run
subprocess.run(
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['sudo', 'env', '"PATH=$PATH"', '/home/zhu/droid/droid/fairo/polymetis/polymetis/build/franka_panda_client', '/tmp/tmpk3l9o1zi']' died with <Signals.SIGKILL: 9>.

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
--- Logging error ---
Traceback (most recent call last):
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/logging/init.py", line 1085, in emit
self.flush()
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/logging/init.py", line 1065, in flush
self.stream.flush()
BrokenPipeError: [Errno 32] Broken pipe
Call stack:
File "/home/zhu/droid/droid/fairo/polymetis/polymetis/python/scripts/launch_robot.py", line 59, in cleanup
log.info(
Message: 'Using sudo to kill subprocess with pid 17455, pgid 17455...'
Arguments: ()
Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe
/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/hydra/plugins/config_source.py:190: UserWarning:
Missing @Package directive robot_client/franka_hardware.yaml in file:///home/zhu/droid/droid/fairo/polymetis/polymetis/conf.
See https://hydra.cc/docs/next/upgrades/0.11_to_1.0/adding_a_package_directive
warnings.warn(message=msg, category=UserWarning)
/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/hydra/plugins/config_source.py:190: UserWarning:
Missing @Package directive gripper/franka_hand.yaml in pkg://polymetis.conf.
See https://hydra.cc/docs/next/upgrades/0.11_to_1.0/adding_a_package_directive
warnings.warn(message=msg, category=UserWarning)

ip_address: localhost
port: 50051

ERROR:zerorpc.core:
Traceback (most recent call last):
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/zerorpc/core.py", line 153, in _async_task
functor.pattern.process_call(self._context, bufchan, event, functor)
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/zerorpc/patterns.py", line 30, in process_call
result = functor(*req_event.args)
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/zerorpc/decorators.py", line 44, in call
return self._functor(*args, **kargs)
File "/home/zhu/droid/droid/franka/robot.py", line 36, in launch_robot
self._robot = RobotInterface(ip_address="localhost")
File "/home/zhu/droid/droid/fairo/polymetis/polymetis/python/polymetis/robot_interface.py", line 352, in init
super().init(*args, **kwargs)
File "/home/zhu/droid/droid/fairo/polymetis/polymetis/python/polymetis/robot_interface.py", line 93, in init
else self.grpc_connection.GetRobotClientMetadata(EMPTY)
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/grpc/_channel.py", line 946, in call
return _end_unary_response_blocking(state, call, False, None)
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/grpc/_channel.py", line 849, in _end_unary_response_blocking
raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "Socket closed"
debug_error_string = "{"created":"@1716544316.061056411","description":"Error received from peer ipv4:127.0.0.1:50051","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"Socket closed","grpc_status":14}"

@AlexanderKhazatsky
Copy link
Contributor

This issue usually comes up on the first launch of the server, and goes away on the second, has this been the case for you? Any other information would be helpful.

@Ynao3
Copy link
Author

Ynao3 commented Jun 12, 2024

I have tried many times,but still cannot get the metadata.This error occurs when i run run_server.py in my nuc,and run collect_trajectory.py in my desktop.Then this error occurs in my nuc.By the way,the code " stream = os.popen("git describe --tags")
version_string = [line for line in stream][0]. #Modify to same format as conda env variable GIT_DESCRIBE_NUMBER.
version_items = version_string.strip("\n").split("-") ." has problem too. Specifically,there are issues with executing "git describe --tags".I get "fatal: No names found, cannot describe anything". So,i changed the code to version="v1.0".I dont know if this is right.

Warning: Failed to load 'libtorchscript_pinocchio.so' from CONDA_PREFIX, loading from default build directory instead: '/home/zhu/droid/droid/fairo/polymetis/polymetis/build/torch_isolation/libtorchscript_pinocchio.so'
Warning: Failed to load 'libtorchrot.so' from CONDA_PREFIX, loading from default build directory instead: '/home/zhu/droid/droid/fairo/polymetis/polymetis/build/torch_isolation/libtorchrot.so'
chmod: cannot access '/dev/ttyUSB0': No such file or directory
/home/zhu/anaconda3/envs/polymetis-local/bin/launch_gripper.py:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import('pkg_resources').require('polymetis==0.2')
/home/zhu/anaconda3/envs/polymetis-local/bin/launch_robot.py:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import('pkg_resources').require('polymetis==0.2')
fatal: No names found, cannot describe anything.
fatal: No names found, cannot describe anything.
/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/hydra/plugins/config_source.py:190: UserWarning:
Missing @Package directive gripper/franka_hand.yaml in pkg://polymetis.conf.
See https://hydra.cc/docs/next/upgrades/0.11_to_1.0/adding_a_package_directive
warnings.warn(message=msg, category=UserWarning)
/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/hydra/plugins/config_source.py:190: UserWarning:
Missing @Package directive robot_client/franka_hardware.yaml in pkg://polymetis.conf.
See https://hydra.cc/docs/next/upgrades/0.11_to_1.0/adding_a_package_directive
warnings.warn(message=msg, category=UserWarning)
WARNING:polymetis.gripper_interface:Metadata unavailable from server.
ERROR:zerorpc.core:
Traceback (most recent call last):
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/zerorpc/core.py", line 153, in _async_task
functor.pattern.process_call(self._context, bufchan, event, functor)
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/zerorpc/patterns.py", line 30, in process_call
result = functor(*req_event.args)
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/zerorpc/decorators.py", line 44, in call
return self._functor(*args, **kargs)
File "/home/zhu/droid/droid/franka/robot.py", line 38, in launch_robot
self._max_gripper_width = self._gripper.metadata.max_width
AttributeError: 'GripperInterface' object has no attribute 'metadata'
chmod: cannot access '/dev/ttyUSB0': No such file or directory
/home/zhu/droid/droid/franka/launch_gripper.sh: line 5: 32073 Killed launch_gripper.py
/home/zhu/anaconda3/envs/polymetis-local/bin/launch_gripper.py:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import('pkg_resources').require('polymetis==0.2')
Traceback (most recent call last):
File "/home/zhu/droid/droid/fairo/polymetis/polymetis/python/scripts/launch_robot.py", line 84, in main
client.run()
File "/home/zhu/droid/droid/fairo/polymetis/polymetis/python/polymetis/robot_client/executable_robot_client.py", line 78, in run
subprocess.run(
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['sudo', 'env', '"PATH=$PATH"', '/home/zhu/droid/droid/fairo/polymetis/polymetis/build/franka_panda_client', '/tmp/tmpj460dsb7']' died with <Signals.SIGKILL: 9>.

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
--- Logging error ---
Traceback (most recent call last):
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/logging/init.py", line 1085, in emit
self.flush()
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/logging/init.py", line 1065, in flush
self.stream.flush()
BrokenPipeError: [Errno 32] Broken pipe
Call stack:
File "/home/zhu/droid/droid/fairo/polymetis/polymetis/python/scripts/launch_robot.py", line 59, in cleanup
log.info(
Message: 'Using sudo to kill subprocess with pid 32099, pgid 32099...'
Arguments: ()
/home/zhu/anaconda3/envs/polymetis-local/bin/launch_robot.py:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import('pkg_resources').require('polymetis==0.2')
Exception ignored in: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe
fatal: No names found, cannot describe anything.
fatal: No names found, cannot describe anything.
/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/hydra/plugins/config_source.py:190: UserWarning:
Missing @Package directive gripper/franka_hand.yaml in pkg://polymetis.conf.
See https://hydra.cc/docs/next/upgrades/0.11_to_1.0/adding_a_package_directive
warnings.warn(message=msg, category=UserWarning)
/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/hydra/plugins/config_source.py:190: UserWarning:
Missing @Package directive robot_client/franka_hardware.yaml in pkg://polymetis.conf.
See https://hydra.cc/docs/next/upgrades/0.11_to_1.0/adding_a_package_directive
warnings.warn(message=msg, category=UserWarning)
ERROR:zerorpc.core:
Traceback (most recent call last):
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/zerorpc/core.py", line 153, in _async_task
functor.pattern.process_call(self._context, bufchan, event, functor)
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/zerorpc/patterns.py", line 30, in process_call
result = functor(*req_event.args)
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/zerorpc/decorators.py", line 44, in call
return self._functor(*args, **kargs)
File "/home/zhu/droid/droid/franka/robot.py", line 36, in launch_robot
self._robot = RobotInterface(ip_address="localhost")
File "/home/zhu/droid/droid/fairo/polymetis/polymetis/python/polymetis/robot_interface.py", line 348, in init
super().init(*args, **kwargs)
File "/home/zhu/droid/droid/fairo/polymetis/polymetis/python/polymetis/robot_interface.py", line 89, in init
else self.grpc_connection.GetRobotClientMetadata(EMPTY)
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/grpc/_channel.py", line 946, in call
return _end_unary_response_blocking(state, call, False, None)
File "/home/zhu/anaconda3/envs/polymetis-local/lib/python3.8/site-packages/grpc/_channel.py", line 849, in _end_unary_response_blocking
raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "Socket closed"
debug_error_string = "{"created":"@1718183171.575967411","description":"Error received from peer ipv4:127.0.0.1:50051","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"Socket closed","grpc_status":14}"

@AlexanderKhazatsky
Copy link
Contributor

Hmm okay, within franka/robot.py, launch_robot(), can you call self._gripper.get_state() and see if there is a max_width value in there?

@AlexanderKhazatsky
Copy link
Contributor

You may have an older version of polymetis

@Ynao3
Copy link
Author

Ynao3 commented Jun 13, 2024

I can't call self._gripper.get_state() because it need metadata in GripperInterface.My polymetis's version is "v1.0-1251-g0a01a7fa7".I'm not sure if this version is possible.if so,how can i git the latest version?
#Get metadata
try:
self.metadata = self.grpc_connection.GetRobotClientMetadata(EMPTY)
except grpc.RpcError:
log.warning("Metadata unavailable from server.")

`

@AlexanderKhazatsky
Copy link
Contributor

Hmm okay I have not seen this issue before. Did you set up polymetis using our docker feature or on your own?

@AlexanderKhazatsky
Copy link
Contributor

If you didn't and installed on your own, could you try to follow these guidelines?

https://droid-dataset.github.io/droid/software-setup/host-installation.html

@doyoungkim-ml
Copy link

Same issue here; I followed the exact installation with robot version 5.6.0 and libfranka version 0.13.3.

@AlexanderKhazatsky
Copy link
Contributor

Hmm, could you try using 0.9.0 if you have a panda and 0.10.0 if you have an FR3? Alternatively, you could just set fingers length to a fixed value in robot.py and sidestep calling the gripper metadata

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants