From ff582b91480924c20d75de8d688dd8deb114c486 Mon Sep 17 00:00:00 2001 From: HuanWeng Date: Mon, 12 Oct 2020 00:08:48 -0500 Subject: [PATCH 1/2] Enlarge the input buffer Even though the RDT buffer of the sensor is 1, the force data somehow queues in the network. Here the input buffer size of the UDP port in MATLAB is set to its maximum in order to receive as much data as possible. So then we can flush them all and then read the updated data. Otherwise the input buffer may be filled with outdated data in queue and we can't read the up-to-date force when we use the function netFT_getFreshData(). However, it is still possible that the data is outdated when the sensor samples in high frequency (higher than around 200Hz in my test). --- netFT_openConnection.m | 1 + 1 file changed, 1 insertion(+) diff --git a/netFT_openConnection.m b/netFT_openConnection.m index c4a3dcf..b4c3c30 100644 --- a/netFT_openConnection.m +++ b/netFT_openConnection.m @@ -4,6 +4,7 @@ netFT = '192.168.1.1'; port = 49152; u = udp(netFT,port); +u = InputBufferSize = 8192; fopen(u); end From b3dfc166677354c73f5c740b5fa133704eaf697f Mon Sep 17 00:00:00 2001 From: HuanWeng Date: Mon, 12 Oct 2020 00:11:16 -0500 Subject: [PATCH 2/2] Update netFT_openConnection.m Typo --- netFT_openConnection.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netFT_openConnection.m b/netFT_openConnection.m index b4c3c30..74cc77e 100644 --- a/netFT_openConnection.m +++ b/netFT_openConnection.m @@ -4,7 +4,7 @@ netFT = '192.168.1.1'; port = 49152; u = udp(netFT,port); -u = InputBufferSize = 8192; +u.InputBufferSize = 8192; fopen(u); end