gavanderhoorn / dominh

Poor man's RPC interface to Fanuc robot controllers in Python
Apache License 2.0
44 stars 4 forks source link

Support retrieving current position #12

Closed gavanderhoorn closed 3 years ago

gavanderhoorn commented 3 years ago

In some cases it may be nice to be able to retrieve the current pose of the robot.

Depending on how this gets implemented this would not be something to do too frequently though (ie: no 100 Hz polling loops).

Didier-Surface commented 3 years ago

Thanks for setting that up.

One use case we have where this functionality would be helpful is with DI/DO and read the current pose when there is a change in DI/DO. For more precision, we have a touch probe as end-effector for part localization. We move the probe to verification points and need to collect the position information. We are currently writing in position registers then fetching the values with dominh.

It would be interesting to skip writing to registers or have an alternative way, by just reading current pose when needed (and doing forward kinematics to get the position information).

gavanderhoorn commented 3 years ago

and doing forward kinematics to get the position information

you mean to get to the EEF instead of the flange?

It's probably possible to retrieve the pose of any (tool)frame, which could make additional post-processing of the pose unnecessary.

Thanks for describing your use-case.

gavanderhoorn commented 3 years ago

@Didier-Surface: could you see whether #13 works for your use-case?

Didier-Surface commented 3 years ago

@gavanderhoorn

you mean to get to the EEF instead of the flange?

Yes exactly, getting the pose of a tool frame is what we are primarily looking for. #13 looks like it is a good solution. We will give it a try this week, thanks for that. Another idea for getting joints state would be an occasional check to see if there is any deviation from simulation when sending cartesian trajectories (as LS code), verify that joints are within limits and get a better idea how IK is done in a Fanuc controller (if that's even possible)

gavanderhoorn commented 3 years ago

I'm closing this as I believe #13 has addressed the immediate need.

There's room for improvement, but that can happen in follow-up PRs.

gavanderhoorn commented 3 years ago

@Didier-Surface: did this work?

Didier-Surface commented 3 years ago

@gavanderhoorn Yes, we just tested to see if the function works. We will do more tests to see how fast we can retrieve the TCP position and how to loop the request command (basically doing the TCP position read request when the touch probe signal gets on)

gavanderhoorn commented 3 years ago

We will do more tests to see how fast we can retrieve the TCP position

the current implementation isn't really meant for high-rate polling. I'd probably recommend using some other way of retrieving the current pose in that case.