Skip to content
Snippets Groups Projects
Commit e260e5c8 authored by jonasspring's avatar jonasspring
Browse files

Changed that the path

parent f7fd6f9f
No related branches found
No related tags found
No related merge requests found
...@@ -62,7 +62,7 @@ PREENABLESYNC allows to preenable the synchronous mode (set to TRUE or FALSE) ...@@ -62,7 +62,7 @@ PREENABLESYNC allows to preenable the synchronous mode (set to TRUE or FALSE)
-XXX.brm: loads an XReality model. -XXX.brm: loads an XReality model.
*/ */
#define COPPELIASIM_EXECUTABLE "cd ~/CoppeliaSim && ./coppeliaSim.sh" #define COPPELIASIM_EXECUTABLE "cd /media/storage/Ubuntu/CoppeliaSim_Edu_V4_1_0_Ubuntu18_04 && ./coppeliaSim.sh"
//----------------------------------------------------------------------------// //----------------------------------------------------------------------------//
int main(int argc, char **argv) int main(int argc, char **argv)
...@@ -71,22 +71,46 @@ int main(int argc, char **argv) ...@@ -71,22 +71,46 @@ int main(int argc, char **argv)
ros::init(argc, argv, "coppeliasim"); ros::init(argc, argv, "coppeliasim");
ROS_INFO("Starting coppeliasim simulator... "); ROS_INFO("Starting coppeliasim simulator... ");
ros::NodeHandle nh;
std::string coppeliasim_path;
if(!nh.getParam("/coppeliasim_path", coppeliasim_path)){
ROS_ERROR("/coppeliasim_path parameter not found");
}
std::stringstream ss; std::stringstream ss;
// switch (argc){
// case 2:
// ss << COPPELIASIM_EXECUTABLE << " " << argv[1];
// break;
// case 3:
// ss << COPPELIASIM_EXECUTABLE << " " << argv[1] << " " << argv[2];
// break;
// case 4:
// ss << COPPELIASIM_EXECUTABLE << " " << argv[1] << " " << argv[2] << " " << argv[3];
// break;
// default:
// ss << COPPELIASIM_EXECUTABLE ;
// }
switch (argc){ switch (argc){
case 2: case 2:
ss << COPPELIASIM_EXECUTABLE << " " << argv[1]; ss << "cd " << coppeliasim_path << " && ./coppeliaSim.sh " << argv[1];
break; break;
case 3: case 3:
ss << COPPELIASIM_EXECUTABLE << " " << argv[1] << " " << argv[2]; ss << "cd " << coppeliasim_path << " && ./coppeliaSim.sh " << argv[1] << " " << argv[2];
break; break;
case 4: case 4:
ss << COPPELIASIM_EXECUTABLE << " " << argv[1] << " " << argv[2] << " " << argv[3]; ss << "cd " << coppeliasim_path << " && ./coppeliaSim.sh " << argv[1] << " " << argv[2] << " " << argv[3];
break; break;
default: default:
ss << COPPELIASIM_EXECUTABLE ; ss << "cd " << coppeliasim_path << " && ./coppeliaSim.sh " ;
} }
if (system( ss.str().c_str() )) {} if (system( ss.str().c_str() )) {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment