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 when trying to connect to the gripper on ROS Noetic #5

Closed
PatrickReitz opened this issue May 23, 2022 · 10 comments
Closed

Comments

@PatrickReitz
Copy link

Hi,

I am currently trying to connect the robotiq_2f_85 gripper to ROS Noetic on Ubuntu 20.04
The package built just fine, but now I am trying to run the commands from the original tutorial
When I try to connect to the gripper with the command

rosrun robotiq_2f_gripper_control Robotiq2FGripperRtuNode.py /dev/ttyUSB0

I get the following error:

File "/home/user/reitz/workspace/src/robotiq/robotiq_2f_gripper_control/nodes/Robotiq2FGripperRtuNode.py", line 86, in
mainLoop(sys.argv[1])

File "/home/user/reitz/workspace/src/robotiq/robotiq_2f_gripper_control/nodes/Robotiq2FGripperRtuNode.py", line 72, in mainLoop
status = gripper.getStatus()

File "/home/user/reitz/workspace/src/robotiq/robotiq_2f_gripper_control/src/robotiq_2f_gripper_control/baseRobotiq2FGripper.py", line 107, in getStatus
status = self.client.getStatus(6);

File "/home/user/reitz/workspace/src/robotiq/robotiq_modbus_rtu/src/robotiq_modbus_rtu/comModbusRtu.py", line 108, in getStatus
response = self.client.read_holding_registers(0x07D0, numRegs, unit=0x0009)

File "/usr/lib/python3/dist-packages/pymodbus/client/common.py", line 114, in read_holding_registers
return self.execute(request)

File "/home/user/reitz/workspace/src/robotiq/robotiq_modbus_rtu/src/robotiq_modbus_rtu/robotiqmodbus/client/sync.py", line 85, in execute
return self.transaction.execute(request)

File "/usr/lib/python3/dist-packages/pymodbus/transaction.py", line 116, in execute
_buffer = hexlify_packets(self.client.framer._buffer)

AttributeError: 'ModbusRtuFramer' object has no attribute '_buffer'

Any idea how to fix this?

@lianghongzhuo
Copy link
Member

There is an incompatible version upgrade for pymodbus. We grab the v1.2 to our fork.
https://github.com/TAMS-Group/robotiq/blob/noetic-devel/robotiq_modbus_rtu/src/robotiq_modbus_rtu/robotiqmodbus/README.md
You can try our fork to see if the problem still exists.

@blueed9696
Copy link

How did you install v1.2 pymodbus?

@lianghongzhuo
Copy link
Member

lianghongzhuo commented May 24, 2022

we do not need to install v1.2 pymodbus. We import this file https://github.com/TAMS-Group/robotiq/blob/noetic-devel/robotiq_modbus_rtu/src/robotiq_modbus_rtu/robotiqmodbus/client/robotiqrtuframer.py instead
Just install our fork https://github.com/TAMS-Group/robotiq and test your gripper.
Install the pymodbus from deb package.

@lianghongzhuo
Copy link
Member

@Patrick-Re Hi, have you tried our fork of robotiq? Is it work on your 2finger gripper?
It would be great if you can let us know. As we only have a 3finger gripper for testing.

@blueed9696
Copy link

blueed9696 commented May 25, 2022

@lianghongzhuo I have tried it, but it does not work for 2 finger gripper. I have same issues with Patrick.

@lianghongzhuo
Copy link
Member

If the above modification works, feel free to make a pull request and I can update our code

@PatrickReitz
Copy link
Author

PatrickReitz commented Jun 2, 2022

Hi, sorry for the late update.
Thank you very much for your help, it is working now.
v1.2 of pymodbus did not work for us and we had issues elsewhere. But we installed v1.3.1 on our system instead and that fixed all issues.

pip uninstall pymodbus pip install pymodbus==1.3.1

was all it took

@lianghongzhuo
Copy link
Member

Hi, sorry for the late update. Thank you very much for your help, it is working now. v1.2 of pymodbus did not work for us and we had issues elsewhere. But we installed v1.3.1 on our system instead and that fixed all issues.

pip uninstall pymodbus pip install pymodbus==1.3.1

was all it took

Yes, install v 1.3.1 works, or you could also try the new commit I just pushed.

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