xArm-Developer / xArm-Python-SDK

Python SDK for UFACTORY robots, 850, xArm5/6/7, and Lite6.
https://www.ufactory.cc
BSD 3-Clause "New" or "Revised" License
163 stars 105 forks source link

How does position-triggered IO work? #53

Closed joshuafishman closed 1 year ago

joshuafishman commented 1 year ago

I would expect

        xyz = self.get_position()[1][:3]
        code = self.set_cgpio_digital_with_xyz(
            gpio_port, value, xyz=xyz, fault_tolerance_radius=float("inf")
        )

to have the same result as

        code = self.set_cgpio_digital(gpio_port, value)

but the latter works and the former seemingly does nothing. Firmware & SDK are version 1.10.0.

joshuafishman commented 1 year ago

On further investigation, it seems that position-triggered IO only works when the robot is enabled but regular GPIO works regardless -- is this accurate?

vimior commented 1 year ago

set_cgpio_digital_with_xyz is similar to specifying an event, when the robotic arm moves to a given xyz as the center, and the function of set_cgpio_digital is triggered when the fault_tolerance_radius is the radius of the sphere. set_cgpio_digital_with_xyz will only be valid for the motion path received behind it, and each setting will only be triggered once at most.

joshuafishman commented 1 year ago

Update: set_cgpio_digital_with_xyz has worked well for us