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: 'NoneType' object has no attribute 'read_holding_registers' when reading robotiq 2f-85 gripper status #6

Closed
gabriellapizzuto opened this issue Jun 9, 2022 · 7 comments

Comments

@gabriellapizzuto
Copy link

Hi, I was wondering if you could help us with this issue. I would like to read the state of our robotiq 2f-85 gripper using the following (please feel free to advice alternative way if this is a known recurring bug):

status = self.RobotiqGripper.client.getStatus(6)

However, I am getting the following error: in ... ..ws/src/robotiq/robotiq_modbus_rtu/src/robotiq_modbus_rtu/comModbusRtu.py", line 100, in getStatus

response = self.client.read_holding_registers(0x07D0, numRegs, unit=0x0009)

AttributeError: 'NoneType' object has no attribute 'read_holding_registers'

I am working with ros-noetic using robostack conda environment python 3.8.

Would you have any suggestions on how to fix this please? Thanks in advance :)

@lianghongzhuo
Copy link
Member

Which version of robotiq are you using?
You could test with our fork: https://github.com/TAMS-Group/robotiq

@CCFQ
Copy link

CCFQ commented Oct 16, 2022

@lianghongzhuo
hello
We had the same problem。
We used Ubuntu20.04。

@CCFQ
Copy link

CCFQ commented Oct 18, 2022

@gabriellapizzuto hi
I want to know,How did you solve it

@crislampon
Copy link

Hi, I had been getting a similar error, though not exactly the same, and could solve it eventually.
We are using a 2f-85 gripper, with ros-noeting and python 3.9 in Ubuntu 20.

Here is the error I was getting:

Could not read registers on gripper. Please check connection and chosen device.
Traceback (most recent call last):
File "/home/ws/catkin_tams_robotiq/src/robotiq_2f_gripper_control/nodes/Robotiq2FGripperRtuNode.py", line 95, in
mainLoop(sys.argv[1])
File "/home/ws/catkin_tams_robotiq/src/robotiq_2f_gripper_control/nodes/Robotiq2FGripperRtuNode.py", line 80, in mainLoop
status = gripper.getStatus()
File "/home/ws/catkin_tams_robotiq/src/robotiq_2f_gripper_control/src/robotiq_2f_gripper_control/baseRobotiq2FGripper.py", line 108, in getStatus
status = self.client.getStatus(6)
File "/home/ws/catkin_tams_robotiq/src/robotiq_modbus_rtu/src/robotiq_modbus_rtu/comModbusRtu.py", line 125, in getStatus
output.append((response.getRegister(i) & 0xFF00) >> 8)
AttributeError: 'NoneType' object has no attribute 'getRegister'

So I changed to Windows and tried with the Robotiq UI (Support section of Robotiq website). According to the UI manual, if the UI is not connecting to the gripper it can be because "slave ID is not 9". Luckily, the UI shows you the current slave_ID of your gripper and allows you to change the slave_ID of the gripper (if you try this, remember restarting the gripper so the changes apply). Indeed, our gripper had a different value for slave_ID.
After saving slave_ID as 9, I went back to Ubuntu and could control the gripper straight away.

Hope this helps!

@CCFQ
Copy link

CCFQ commented Mar 24, 2023 via email

@lianghongzhuo
Copy link
Member

Maybe you could try @crislampon 's solution? And report if it works here.

@lianghongzhuo
Copy link
Member

Closed due to no response. Feel free to reopen if you still have a problem.

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

4 participants