【V-REP Learning Record 02】Understanding the vrep_plugin

【V-REP Learning Record 01】Setting up V-REP with ROS

Most of the content refers to the book "Lentin Joseph - Mastering ROS for Robotics Programming"

vrep_plugin is part of the V-REP API framework. Even if the plugin is correctly installed on the system, the loading operation will fail if roscore is not running at the time. A pop-up error will inform the user whether the simulation scenario requires vrep_plugin because roscore was not running before running the simulator, or it is not installed in the system: the error message is as follows

 After starting V-REP by loading vrep_plugin correctly, V-REP will act as a ROS node named /vrep. It can be displayed using the following command:

rosnode list

Other ROS nodes can communicate with V-REP in the following ways: 

  • vrep_plugin provides ROS services. After starting V-REP, different services can be used to control the simulation scenario or its state.
  • vrep_plugin can subscribe to or publish topics. The simulation model acts as an ordinary ROS node and can communicate through topics.

We can start using services to interact with V-REP. Let's create a ROS package with the following dependencies: 

catkin_create_pkg vrep_demo_pkg roscpp vrep_common std_msgs geometry_msgs

Alternatively, the entire package can be cloned from the following GitHub repository:

git clone https://github.com/jocacace/vrep_demo_pkg.git

Guess you like

Origin blog.csdn.net/cz_include/article/details/131386203