February 2018
Beginner
580 pages
13h 20m
English
As a first example, we will use ROS services to start and stop the simulation scene. To do this, we must call /vrep/simRosStartSimulation and the/vrep/simRosStopSimulation services respectively. We will discuss the source code of the start_stop_scene.cpp file located in the vrep_demo_pkg/src directory:
#include "ros/ros.h" #include "vrep_common/simRosStartSimulation.h" #include "vrep_common/simRosStopSimulation.h" int main( int argc, char** argv ) { ros::init( argc, argv, "start_stop_vrep_node"); ros::NodeHandle n; ros::ServiceClient start_vrep_client = n.serviceClient<vrep_common::simRosStartSimulation>("/vrep/simRosStartSimulation"); vrep_common::simRosStartSimulation start_srv; ros::ServiceClient ...