88#include < cstdlib>
99#include < fstream>
1010
11- // #define DIR_LOCATION = "/home/ros/owr_software/rover/src/owr_positioning/launch/";
12- // #define FILE_NAME = "artags_location.launch";
11+ #define DIR_LOCATION " /home/ros/owr_software/rover/src/owr_positioning/launch/"
12+ #define FILE_NAME " artags_location.launch"
1313
14- std::string dir_location = " /home/ros/owr_software/rover/src/owr_positioning/launch/" ;
15- std::string file_name = " artags_location.launch" ;
1614std::ofstream launch_file;
1715bool add_artag = true ;
1816
1917int main (int argc, char ** argv) {
20- // std::string dir_location = "/home/ros/owr_software/rover/src/owr_positioning/launch/";
21- // std::string file_name = "artags_location.launch";
22-
2318 ROS_INFO (" Launch file creator started" );
2419 ros::init (argc, argv, " arTag_localization" );
20+
21+ std::string file_path = " " ;
22+ file_path += DIR_LOCATION ;
23+ file_path += FILE_NAME ;
2524
26- ::launch_file.open ((::dir_location + ::file_name) .c_str ());
25+ ::launch_file.open (file_path .c_str ());
2726 if (not ::launch_file){
28- std::cout << " Could not create " << ::dir_location << ::file_name <<" \n " ;
29- return 1 ;
27+ std::cout << " Could not create " << file_path <<" \n " ;
28+ return EXIT_FAILURE ;
3029 }
3130 else {
3231 ::launch_file << " <launch>\n " ;
@@ -36,9 +35,9 @@ int main(int argc, char ** argv) {
3635 if (::launch_file.is_open ()){
3736 ::launch_file << " </launch>\n " ;
3837 ::launch_file.close ();
39- std::cout << " Successfully created " << ::dir_location << ::file_name << " \n " ;
38+ std::cout << " Successfully created " << file_path << " \n " ;
4039 }
41- return 0 ;
40+ return EXIT_SUCCESS ;
4241}
4342
4443void artag_localization::run () {
0 commit comments