Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5

RobotIQ controller through RoboDK

#9
Hi all,

After a few requests privately, I thought I'd share the latest:

Since posting this, I've found Robotiq actually has a GitHub repository for exactly this only that it's geared towards ROS. Nonetheless, the gripper still communicates via Modbus serial so, it will work on any application as long as you can run python.

https://github.com/ros-industrial/roboti...dbusRtu.py

Do note on line 86 they mention a TODO to add a Try/Except block around line 88. I've found on occasion line 88 response can be None so you need to test for it's type before proceeding and parsing data from it.

For example:


Code:
try:

rr = self.client.read_holding_registers(INPUT_REG, 3, unit=self.id,timeout=2)
retries = 50
#绕过spuratic -对象哈s no attribute 'registers'
while not isinstance(rr, ReadHoldingRegistersResponse):
rr = self.client.read_holding_registers(INPUT_REG, 3, unit=self.id)
retries -= 1
time.sleep(0.01)
if retries <= 0: raise TypeError("Failed to get status after 50 tries")
except TypeError as e:
print(e)
return None


Messages In This Thread
RobotIQ controller through RoboDK - bymattmct- 10-23-2018, 06:30 AM
RE: RobotIQ controller through RoboDK - byAlbert- 10-31-2018, 10:59 AM
RE: RobotIQ controller through RoboDK - bymattmct- 08-20-2021, 12:14 AM
RE: RobotIQ controller through RoboDK - byJeremy- 08-23-2021, 02:17 PM
RE: RobotIQ controller through RoboDK - bySamira- 03-14-2023, 09:00 AM
RE: RobotIQ controller through RoboDK - bySamira- 03-14-2023, 11:12 AM



Users browsing this thread:
1 Guest(s)