marker_rotator.cpp
Go to the documentation of this file.
1 
18 //Global includes
19 
20 
21 
22 //Pkg includes
23 #include <ros/ros.h>
24 
25 
26 //ISM includes
27 #include <ISM/tools/MarkerRotator.hpp>
28 
29 
30 bool getNodeParameters(ros::NodeHandle nh, std::string& source_file, std::string& target_file)
31 {
32  bool success = true;
33 
34  if (!nh.getParam("source", source_file) || source_file.empty())
35  {
36  ROS_INFO("Missing parameter: \"source\"");
37  success = false;
38  }
39  else
40  {
41  ROS_INFO_STREAM("source: " << source_file);
42  }
43 
44  if (!nh.getParam("target", target_file) || target_file.empty())
45  {
46  ROS_INFO("Missing parameter: \"target\"");
47  success = false;
48  }
49  else
50  {
51  ROS_INFO_STREAM("target: " << target_file);
52  }
53 
54  return success;
55 }
56 
57 int main (int argc, char **argv)
58 {
59  //Usual ros node stuff
60  ros::init(argc, argv, "marker_rotator");
61  ros::NodeHandle nh("~");
62  ISM::MarkerRotator marker_rotator;
63 
64  std::string target_file;
65  std::string source_file;
66 
67  if(getNodeParameters(nh, source_file, target_file))
68  {
69  marker_rotator.rotateMarker(source_file, target_file);
70 
71  ROS_INFO("ROTATION COMPLETED!");
72  }
73  else
74  {
75  ROS_INFO("ROTATION ABORTED! Check launch-file for missing parameter.");
76  }
77 
78  return 0;
79 }
bool getNodeParameters(ros::NodeHandle nh, std::string &source_file, std::string &target_file)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
#define ROS_INFO(...)
#define ROS_INFO_STREAM(args)
bool getParam(const std::string &key, std::string &s) const
int main(int argc, char **argv)


asr_ism
Author(s): Borella Jocelyn, Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Thu Jan 9 2020 07:20:58