Communication with N Pioneer

Typically: "How do I... ", "How can I... " questions
Post Reply
crisannik
Posts: 4
Joined: 29 Nov 2018, 18:45

Communication with N Pioneer

Post by crisannik » 09 Jan 2019, 18:48

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

coppelia
Site Admin
Posts: 7077
Joined: 14 Dec 2012, 00:25

Re: Communication with N Pioneer

Post by coppelia » 11 Jan 2019, 09:43

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

crisannik
Posts: 4
Joined: 29 Nov 2018, 18:45

Re: Communication with N Pioneer

Post by crisannik » 13 Jan 2019, 16:16

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

coppelia
Site Admin
Posts: 7077
Joined: 14 Dec 2012, 00:25

Re: Communication with N Pioneer

Post by coppelia » 16 Jan 2019, 08:33

Yes of course, you can. But this is more complicated, since the lidar models dor not return the handle of the detected objects.

Cheers

Post Reply