## Exchange information between ePucks

Typically: "How do I... ", "How can I... " questions
DavideIng
Posts: 39
Joined: 21 Sep 2017, 17:27

### Exchange information between ePucks

I have set up a scene where a swarm of ePuck have to to exchange informations between closer neighbor like position or a color vector read from vision sensor ( there is a screen in front of all vision sensors painted with a uniform color).
Any suggestions?

Many thanks
Davide

coppelia
Posts: 7857
Joined: 14 Dec 2012, 00:25

### Re: Exchange information between ePucks

Hello,

you have several possibilities for that. For instance:

Code: Select all

--in script 1:
simWriteCustomDataBlock(objectHandle,'myData',simPackTable(myLuaVariable))

--in script 2:
local myLuaVariable=simUnpackTable(data)
in above example, myLuaVariable can be a variable of any complexity (e.g. table of table of map of random elements, etc.). Tables, maps, Boolean, nil, numbers, and strings are supported.

Cheers