Live sync via CSV
Posted: 24 Sep 2021, 09:04
Hello,
I want to synchronize live my robot and my simulation on Coppelia.
For this, I write positions values continuously in a CSV file (the CSV is rewritten).
Then, I read at the same time, every "y" milliseconds, the values from this CSV on a Coppelia script.
My program seems to work, but I was wondering if there was a more proper way of doing that, or if this code could cause possible errors that I have not spotted.
I want to synchronize live my robot and my simulation on Coppelia.
For this, I write positions values continuously in a CSV file (the CSV is rewritten).
Then, I read at the same time, every "y" milliseconds, the values from this CSV on a Coppelia script.
Code: Select all
--lua
while true do
sim.wait(y)
PoseTable = readcsvf_function('path/to/csv_file_test',',')
-- need the following condition because sometimes readcsvf_function return nothing
if PoseTable ~= nil then
....do things