Forward/backward compatibilityCoppeliaSim is developed by a small team. Unlike larger entities, we embrace an agile development methodology, which means a more frequent update cycle and rapid deployment of fixes. This approach may lead to occasional issues, but allows for swift resolution and the introduction of new features. User feedback, particularly through bug reports on the CoppeliaSim forum, is crucial to this process and is an important means of identifying and addressing problems. Introduction of script objects in CoppeliaSim V4.7Forward compatibilityAssociated scripts remain operational, it is however recommended to convert them to script objects. Automatic conversion is not perfect, and several manual adjustments might have to be done, additionally. Backward compatibilityScenes and models containing script objects can be converted back to scenes and models containing only associated scripts, by setting the user settings parameter scriptConversion to -1. The related script code is however not touched by this conversion, and manual adjustments will have to be done. In case of serious unexpected problems with script objects, one can revert to using old associated scripts, by setting the user settings parameter useSceneObjectScripts to false. Introduction of buffers in CoppeliaSim V4.7Forward compatibilityThere are potentially two problematic situations with existing code:
function sendData(data)
if type(data) == 'string' then
-- this does not execute when data is a buffer
end
end
print(sim.getVisionSensorImg(h) == anyStringData) -- always prints false
local packedTable1 = sim.packTable({'Txt'})
local packedTable2 = sim.packTable({'Txt\0'})
local packedTable3 = sim.packTable({tobuffer('Txt')})
print(packedTable1) -- prints: [buffer (16 bytes)]
print(packedTable2) -- prints: [buffer (17 bytes)
print(packedTable3) -- prints: [buffer (16 bytes)
print(packedTable1 == packedTable2) -- prints: false
print(packedTable1 == packedTable3) -- prints: false
print(packedTable2 == packedTable3) -- prints: false
print(sim.unpackTable(packedTable1)) -- prints: {'Txt'}
print(sim.unpackTable(packedTable2)) -- prints: {[binary string (4 bytes)]}
print(sim.unpackTable(packedTable3)) -- prints: {[buffer (3 bytes)]}
Workarounds:
Backward compatibilityisbuffer and tobuffer are not recognized functions. Workaround:
function tobuffer(a)
return a
end
function isbuffer(a)
return false
end
|