Yaskawa-Global / motoros2

ROS 2 (rcl, rclc & micro-ROS) node for MotoPlus-compatible Yaskawa Motoman robot controllers
89 stars 14 forks source link

reset hasUnprocessedData to prevent zero pulses being sent by mpExRcsIncrementMove after trajectory is finished #191

Closed iydv closed 7 months ago

iydv commented 7 months ago

Fix for #190 . Currently, hasUnprocessedData is never reset after the queue is fully processed inside Ros_MotionControl_IncMoveLoopStart, which means that empty queue is constantly being read and zero pulse increment is constantly being sent by mpExRcsIncrementMove

iydv commented 7 months ago

I have conducted a test similar to #190 and resulting debug log shows that FSU speed handling part still works fine but empty mpExRcsIncrementMove is no longer sent when trajectory is finished. 20231116T135527_motoros2_debug_log.txt

ted-miller commented 7 months ago

Hi @iydv Good catch. I definitely missed that during testing.

This won't work for a multi-group system. The hasUnprocessedData would get cleared when calculating for R2.

I think we can simply move the hasUnprocessedData = FALSE; up a few lines so that it outside of the for-each-group loop.

What do you think?

iydv commented 7 months ago

Yes, you are right, I forgot about the multi-group system. I guess it should be moved here .

ted-miller commented 7 months ago

Looks good to me. My system is currently configured for single-group. But I should be able to reconfigure it on Wednesday for a quick test.