I'm looking for some guidance on a project that I've been doing for quite a long time; the project is about a 4WD robotic platform for obstacle avoidance with haptic feedback. If you know about the appropriate communication protocols for my project and can tell me something based on your experience with some similar projects - I will really appreciate it. So, I'm going to tell you what I've done so far.

I'm already taking the distances where the obstacle is located to my ESP8266. This is through a 340° detector made out of two Vl53L0X TOF sensors that use I2C CP, and a micro servo motor to make them turn around. With the same board, I control four Servos Dynamixel that use UART CP.

I command the robot through a web page and receive the data of each sensor in real-time (a delay of 2s) using TCPIP protocol and HTTP.

My questions are:

  1. How can I read the data on the web page using VREP which is where the haptic control will be implemented?

  2. Do you know any other way to connect via WIFI the ESP8266 with VREP and establish a bidirectional communication?

  3. I tried using MATLAB to read the data from the web page and send it back to VREP afterward, but I haven't succeeded, yet. I can just write data, so far. All this using the function TCPIP and TCPCLIENT. Is it convenient to use MATLAB as a bridge between the ESP8266 and VREP? If so, What am I missing to succeed in this?

  • 1
    $\begingroup$ It is not an answer to you question, but if you have a 2s communication delay, you will not be able to implement haptic control. For haptic control (if you mean impedance control by that, you would need a delay less then 10ms, ideally less then 1 ms) $\endgroup$
    – 50k4
    Jan 20, 2020 at 13:48
  • $\begingroup$ Thanks a lot. I didn't know this. I'll try to do some effort to reduce that delay. $\endgroup$ Jan 23, 2020 at 22:19

1 Answer 1

  1. and 2.

VREP is a simulator system. you can develop plug-ins for it which can run custom code (i.e. communicate with your robot). Here is a short intro on how to start. You can establish a bidirectional TCP-IP Communication from the plug-in. You can make a C TCP-IP Server (as presented here) and run this on a different thread so it does not block your simulation. The message() function of the plug-in can then handle the inter-thread communication between V-REP and the TCP-IP Server. I would ditch HTTP as there is no need for it. You can also consider other protocols, like MQTT instead of TCP-IP (as there are some tutorials, like this, on getting this running on the ESP)

  1. Technically, you can have Matlab in-between, acting as a bridge, but it does not make much sense since it ads additional complexity. If this helps you in any way getting the system running, then make the prototype with Matlab and then work on eliminating Matlab form the solution. This would be a programming exercise, again, I cannot see a technical advantage for having Matlab as a bridge, but it can have a didactic motivation.

  • 1
    $\begingroup$ Just so future visitors are aware, VREP has been superseded by coppeliaSim $\endgroup$ May 6, 2021 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.