By using ROS Humble, Moveit2, and ros2_control, I am trying to accomplish manipulation tasks with the CRX-10iA/L Fanuc robot. Currently, I am implementing ros2_control hardware_interface part. Inside the default write function I am sending motion commands to robot.
I have two motion command options from the provided robot interface. One of them should be sent except the last write command and the other one must be sent lastly. Otherwise, communication can't go further.
I was wondering whether I can access to the total number of write commands that will be sent by hardware_interface? Then I can set a simple if-else logic.
I thought about accessing total number of joint trajectory commands but I realized that when moveit generated a joint trajectory point with 22 positions, write() function was called 5 times in hardware_interface. Less than ideal as expected due to real hardware constraints.
Any suggestion is appreciated. Thank you for your time.