Is it possible to control an ext hard from the simulation?

Requests or suggestions for new features
Post Reply
Julio
Posts: 9
Joined: 02 Oct 2015, 10:18

Is it possible to control an ext hard from the simulation?

Post by Julio »

Hello,

I know that is possible to control the simulation in V-Rep from an external hardware via remote api but i would like know if is possible to control the external hardware from the simulation. For example if i can connect an arduino with the simulation and control its output port status.

Thank you in advance,
Julio

Eric
Posts: 186
Joined: 11 Feb 2013, 16:39

Re: Is it possible to control an ext hard from the simulatio

Post by Eric »

Hi,

Indeed it is possible! for example via the serial port. Have a look at the arduino esplora model...

Cheers

Eric

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

Re: Is it possible to control an ext hard from the simulatio

Post by coppelia »

Hello,

yes, that is correct. You basically have several mechanisms to connect to and communicate with hardware from V-REP:
  • using a plugin. This gives you most flexibility, speed, etc. From within a plugin, you can do everything. Take the example of the haptic device (i.e. force feedback joystick) interface in V-REP, that is based on a plugin. A plugin can also register new Lua functions, that if called, will call-back a function in the plugin: this allows you to use plugin functionality directly from within en embedded script in a very flexible way.
  • using the remote API. But as you mentioned it, V-REP will act as a server. But if the client is listening to a specific signal (e.g. with simxReadStringStream), then you can continuously send data to the client from V-REP by setting string signals (simSetStringSignal). But remember, connection and communication is asynchronous.
  • using ROS. Very similar to the remote API approach.
  • using serial port communication from within an embedded script.
  • using socket communication, from within an embedded script.
  • using any other Lua extension library, from within an embedded script.
Cheers

Julio
Posts: 9
Joined: 02 Oct 2015, 10:18

Re: Is it possible to control an ext hard from the simulatio

Post by Julio »

Thank you very much guys! Also you have done an amazing job with this V-Rep and also us, the students, can use it for our projects and do things that we couldn't do with other softwares as easy as with V-Rep. Congratulations and thanks again.

Post Reply