Skip to content
This repository was archived by the owner on Sep 4, 2022. It is now read-only.

Commit b0f64ed

Browse files
committed
config creation code improvement
1 parent cc40f6b commit b0f64ed

2 files changed

Lines changed: 13 additions & 14 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<launch>
2-
<node pkg="tf" type="static_transform_publisher" name="marker6" args="7 10 0 0 0.5 0 world /marker6 100">
3-
<node pkg="tf" type="static_transform_publisher" name="marker0" args="10 0 0 0 0 0 world /marker0 100">
2+
<node pkg="tf" type="static_transform_publisher" name="marker0" args="10 0 10 0 0.5 0 world /marker0 100">
3+
<node pkg="tf" type="static_transform_publisher" name="marker7" args="5 0 0 0 0 0 world /marker7 100">
44
</launch>

rover/src/owr_positioning/src/create_artag_config.cpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,24 @@
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";
1614
std::ofstream launch_file;
1715
bool add_artag = true;
1816

1917
int 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

4443
void artag_localization::run() {

0 commit comments

Comments
 (0)