Communication webots emitter and receiver

1k Views Asked by At

I´m trying to comunicate two controllers in webots, in fact, a normal control and a supervisor. I have put the emitter node but I don´t know what function I have to use to send message. I have included too <webots/Emitter.hpp> but the function send() is not recognized. I am doing my code in C++. If anyone could help me I would be so grateful.

Documentation explain that the function to use is:

#include "<webots/Emitter.hpp>"

namespace webots {
  class Emitter : public Device {
    virtual int send(const void *data, int size);
    // ...
  }
}

But I don´t have idea how works this.

1

There are 1 best solutions below

0
On

You will find a simple example of using an Emitter in C++ here. The corresponding Receiver code is here. That should clarify the use of these methods.