Page 1 of 1

Communication with N Pioneer

Posted: 09 Jan 2019, 18:48
by crisannik
Hi guys, I want to realize a project where there are N pioneer (e.g. two or three) in a room. Every pioneer, when to see other pioneers, must to send a message to visible pioneer. How can I resolve this problem? Does it exist one way or one instrument to solve this problem? Thanks

Re: Communication with N Pioneer

Posted: 11 Jan 2019, 09:43
by coppelia
Hello,

you will have to add a proximity sensor or a vision sensor to the Pioneer, so that it can detect the others. Set that proximity sensor in explicit handling mode. Then, on a regular basis call sim.handleProximitySensor. The forth returned argument is the handle of the detected object. Follow that object's parent (sim.getObjectParent) , until it doesn't have any parent anymore. Then you can either check its name (sim.getObjectName), or better, check whether it contains a tag that you have added previously (sim.writeCustomDataBlock and sim.readCustomDataBlock). Then you can inform that pioneer about something using sim.WriteCustomDataBlock or by calling one of its functions (sim.callScriptFunction).

Cheers

Re: Communication with N Pioneer

Posted: 13 Jan 2019, 16:16
by crisannik
I have only a question. Can I use a Lidar sensor as proximity sensor?? I ask these question because it is the first time that I study the robotic discipline

Re: Communication with N Pioneer

Posted: 16 Jan 2019, 08:33
by coppelia
Yes of course, you can. But this is more complicated, since the lidar models dor not return the handle of the detected objects.

Cheers