gavanderhoorn / fanuc_driver_exp

An alternative - experimental - Fanuc robot driver for ROS-Industrial
Apache License 2.0
29 stars 16 forks source link

TRAJ_STOP doesn't appear to work as expected #3

Closed gavanderhoorn closed 3 years ago

gavanderhoorn commented 7 years ago

Two reasons:

  1. "JointTrajectoryStreamer does not send TRAJ_STOP if in IDLE state" (ros-industrial/industrial_core#175)
  2. there is no support in the current industrial_robot_client for a server to signal a client to send the next traj point. The client will always send a next point upon receiving an ACK to the previously sent point. This leads to the situation where ROS_TRAJ -- with a full point buffer -- will not send out ACKs, which makes industrial_robot_client hang in sendAndRecieve(..). Any pending TRAJ_STOP JOINT_TRAJ_PTs will be blocked at this point.

    For sparse trajectories with long (joint space) distances between subsequent traj pts this will lead to the driver first having to 'finish' a (potentially long) segment until it can ACK again, and only then the TRAJ_STOP will be received.

gavanderhoorn commented 7 years ago

To address 2, the fanuc_driver nodes could adopt the approach the motoman_driver is using, with explicit BUSY responses to incoming JOINT_TRAJ_PTs if the buffer is full, and the client node retrying every so often.

That would allow TRAJ_STOP msgs to be multiplexed into the message stream.

Ideally this would be integrated into industrial_robot_client itself to avoid duplication of code/effort, etc.

gavanderhoorn commented 4 years ago

https://github.com/ros-industrial/industrial_core/pull/199 should address https://github.com/ros-industrial/industrial_core/issues/175.

jediofgever commented 4 years ago

The PR partially helped indeed, but when robot is close to get to the given goal, stop() function does not take effect, on the teach pendant I see the trajectory points are already been pushed while robot is still on the move, is there any suggestion to address this ?

gavanderhoorn commented 4 years ago

on the teach pendant I see the trajectory points are already been pushed while robot is still on the move

I don't really understand what you mean by this.

Network handling and motion are decoupled in this driver. The ROS side could push 100 pts, with the robot still not moving, depending on what buffer length is configured.

is there any suggestion to address this ?

Without checking this myself it's hard to provide you with any advice.

There is no way to really CANCEL a motion right now with the way the driver is implemented. The problem is essentially similar to https://github.com/ros-industrial/fanuc/issues/93.

You could add a SKIP condition to the J statement and trigger that somehow, or perhaps implement a general ABORT upon receiving a stop.

Another alternative: create something that drops HOLD and then reset ROS_TRAJ.


Edit:

stop() function

please note: there is no "stop() function" anywhere in the driver. You are referring to the MoveIt side of things here, I believe.

jediofgever commented 4 years ago

I don't really understand what you mean by this.

I meant, once the controller received all the trajectory points that are going to be executed, the TRAJ_STOP doesn't stop robot anymore, and all points received points are executed, after that TRAJ_STOP is being executed.

stop() function yes I was referring to move_group->stop()

unfortunately I could not understand the alternatives you listed above as I have no experience in KAREL programming

jediofgever commented 4 years ago

so after some head scratching and getting lost in fanuc's not so clever documentations, I found a temporary solution using your fanuc_ros_cgio. But as you described in the project, the timing is not that desirable. I still hope to get some more reliable solution for this.

in https://github.com/ros-industrial/fanuc/issues/93 you said;

This will not be addressed any more in fanuc_driver - other developments will take priority.

But this issue is still open here, is there any willingness to go on this issue in future ?

gavanderhoorn commented 4 years ago

I found a temporary solution using your fanuc_ros_cgio. But as you described in the project, the timing is not that desirable. I still hope to get some more reliable solution for this.

Switching to an actual fieldbus would immediately reduce latency and increase determinism.

in ros-industrial/fanuc#93 you said;

This will not be addressed any more in fanuc_driver - other developments will take priority.

But this issue is still open here, is there any willingness to go on this issue in future ?

I would be OK with PRs being submitted to address this issue, but I don't have time in the foreseeable future to work on it myself.

The easiest way to integrate this would probably be something I described in my previous comment:

  1. add a SKIP condition to the motion instruction in ROS_TRAJ
  2. make that condition evaluate to true based on an IO signal that is triggered using a fieldbus (or similar) or by sending a message to ROS_TRAJ

Unfortunately using ROS_TRAJ and industrial_robot_client will run into bullet nr 2 in the OP of this thread.

gavanderhoorn commented 3 years ago

https://github.com/ros-industrial/industrial_core/issues/175 was fixed. I expect this to work now here in fanuc_driver_exp as well.

Closing.