Here are my steps:1. Clone https://github.com/ros-industrial/robotiq.git into a clean catkin workspace and catkin_make.2. $ rosrun robotiq_2f_gripper_control TestRobotiq2FGripperRtuNode.py /dev/ttyUSB03. $ rostopic hz /Robotiq2FGripperRobotInputFollowing are the results, coupled with their respective treatments:Machine A: Linux crslab 4.19.72-rt26 #1 SMP PREEMPT RT Wed Oct 23 21:38:50 +08 2019 x86_64 x86_64 x86_64 GNU/LinuxBaseline: average rate: 2.482 min: 0.403s max: 0.403s std dev: 0.00011s window: 5$ setserial -a /dev/ttyUSB0 low_latencyaverage rate: 2.481 min: 0.403s max: 0.403s std dev: 0.00007s window: 15#change timeout from 0.2 to 0.05 in Line56 of https://github.com/ros-industrial/robotiq/blob/kinetic-devel/robotiq_modbus_rtu/src/robotiq_modbus_rtu/comModbusRtu.pyaverage rate: 9.852 min: 0.101s max: 0.102s std dev: 0.00007s window: 59#change timeout from 0.2 to 0.01 in Line56 of https://github.com/ros-industrial/robotiq/blob/kinetic-devel/robotiq_modbus_rtu/src/robotiq_modbus_rtu/comModbusRtu.pyAttributeError: 'ModbusIOException' object has no attribute 'getRegister'#change timeout from 0.2 to 0.01 in Line56 of https://github.com/ros-industrial/robotiq/blob/kinetic-devel/robotiq_modbus_rtu/src/robotiq_modbus_rtu/comModbusRtu.py+$ setserial -a /dev/ttyUSB0 low_latencyaverage rate: 47.159 min: 0.020s max: 0.022s std dev: 0.00010s window: 378Machine B: Linux crslab 4.19.135-rt60 #1 SMP PREEMPT RT Mon Aug 10 18:21:21 +08 2020 x86_64 x86_64 x86_64 GNU/LinuxBaseline: average rate: 31.243 min: 0.029s max: 0.035s std dev: 0.00018s window: 6352$ setserial -a /dev/ttyUSB0 low_latencyTopic statistics:average rate: 89.078 min: 0.01s max: 0.013s std dev: 0.00018s window: 444#change timeout from 0.2 to 0.05 in Line56 of https://github.com/ros-industrial/robotiq/blob/kinetic-devel/robotiq_modbus_rtu/src/robotiq_modbus_rtu/comModbusRtu.pyaverage rate: 93.728 min: 0.009s max: 0.012s std dev: 0.00052s window: 873#change timeout from 0.2 to 0.01 in Line56 of https://github.com/ros-industrial/robotiq/blob/kinetic-devel/robotiq_modbus_rtu/src/robotiq_modbus_rtu/comModbusRtu.pyAttributeError: 'ModbusIOException' object has no attribute 'getRegister'#change timeout from 0.2 to 0.01 in Line56 of https://github.com/ros-industrial/robotiq/blob/kinetic-devel/robotiq_modbus_rtu/src/robotiq_modbus_rtu/comModbusRtu.py+$ setserial -a /dev/ttyUSB0 low_latencyaverage rate: 94.128 min: 0.009s max: 0.012s std dev: 0.00061s window: 2170I can observe that 1. For machine A, the period of the ros messages is approx. 2x of the timeout, whereas for machine B, the period is independent of the timeout.2. Both machines benefit from setserial low_latency.Note that standard deviations are all low and the period is systematic.Does anyone knows what is causing the differing behavior?Do let me know if I should supplement this post with my hardware/motherboard information.
Here are my steps:
1. Clone https://github.com/ros-industrial/robotiq.git into a clean catkin workspace and catkin_make.
2. $ rosrun robotiq_2f_gripper_control TestRobotiq2FGripperRtuNode.py /dev/ttyUSB0
3. $ rostopic hz /Robotiq2FGripperRobotInput
Following are the results, coupled with their respective treatments:
Machine A: Linux crslab 4.19.72-rt26 #1 SMP PREEMPT RT Wed Oct 23 21:38:50 +08 2019 x86_64 x86_64 x86_64 GNU/Linux
Baseline:
average rate: 2.482
average rate: 2.481
min: 0.403s max: 0.403s std dev: 0.00007s window: 15
#change timeout from 0.2 to 0.05 in Line56 of https://github.com/ros-industrial/robotiq/blob/kinetic-devel/robotiq_modbus_rtu/src/robotiq_modbus_rtu/comModbusRtu.py
average rate: 9.852
min: 0.101s max: 0.102s std dev: 0.00007s window: 59
#change timeout from 0.2 to 0.01 in Line56 of https://github.com/ros-industrial/robotiq/blob/kinetic-devel/robotiq_modbus_rtu/src/robotiq_modbus_rtu/comModbusRtu.py
AttributeError: 'ModbusIOException' object has no attribute 'getRegister'
#change timeout from 0.2 to 0.01 in Line56 of https://github.com/ros-industrial/robotiq/blob/kinetic-devel/robotiq_modbus_rtu/src/robotiq_modbus_rtu/comModbusRtu.py
+
$ setserial -a /dev/ttyUSB0 low_latency
min: 0.020s max: 0.022s std dev: 0.00010s window: 378
Machine B: Linux crslab 4.19.135-rt60 #1 SMP PREEMPT RT Mon Aug 10 18:21:21 +08 2020 x86_64 x86_64 x86_64 GNU/Linux
Baseline:
average rate: 31.243
min: 0.029s max: 0.035s std dev: 0.00018s window: 6352
average rate: 89.078
min: 0.01s max: 0.013s std dev: 0.00018s window: 444
average rate: 93.728
min: 0.009s max: 0.012s std dev: 0.00052s window: 873
#change timeout from 0.2 to 0.01 in Line56 of https://github.com/ros-industrial/robotiq/blob/kinetic-devel/robotiq_modbus_rtu/src/robotiq_modbus_rtu/comModbusRtu.py
AttributeError: 'ModbusIOException' object has no attribute 'getRegister'
#change timeout from 0.2 to 0.01 in Line56 of https://github.com/ros-industrial/robotiq/blob/kinetic-devel/robotiq_modbus_rtu/src/robotiq_modbus_rtu/comModbusRtu.py
+
$ setserial -a /dev/ttyUSB0 low_latency
average rate: 94.128
I can observe that
1. For machine A, the period of the ros messages is approx. 2x of the timeout, whereas for machine B, the period is independent of the timeout.
2. Both machines benefit from setserial low_latency.
Note that standard deviations are all low and the period is systematic.
Does anyone knows what is causing the differing behavior?
Do let me know if I should supplement this post with my hardware/motherboard information.