Adding the ROS interface to V-REP joint controllers

In this section, we will learn how to interface the seven-DOF arm with the vrep_plugin to stream the state of its joints and receive the control input via topics. As already seen in the previous example, select a component of the robot (for example the base_link_respondable) and create a Lua script that will manage the communication between V-REP and ROS.

Here is the script source code:

if (sim_call_type==sim_childscriptcall_initialization) then -- Check if the required plugin is there (libv_repExtRos.so or libv_repExtRos.dylib): local moduleName=0 local moduleVersion=0 local index=0 local pluginNotFound=true while moduleName do moduleName,moduleVersion=simGetModuleName(index) if (moduleName=='Ros') ...

Get Mastering ROS for Robotics Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.