27 #include <ISM/tools/RecordedObjectsTransformer.hpp> 31 std::vector<double>& position, std::vector<double>& orientation)
35 if (!nh.
getParam(
"source", source_file) || source_file.empty())
37 ROS_INFO(
"Missing parameter: \"source\"");
45 if (!nh.
getParam(
"target", target_file) || target_file.empty())
47 ROS_INFO(
"Missing parameter: \"target\"");
55 if (!nh.
getParam(
"object_type", object_type) || object_type.empty())
57 ROS_INFO(
"Missing parameter: \"object_type\"");
65 if (!nh.
getParam(
"object_id", object_id) || object_id.empty())
67 ROS_INFO(
"Missing parameter: \"object_id\"");
75 if (!nh.
getParam(
"position", position) || position.size() != 3)
77 ROS_INFO(
"Missing or not full defined parameter: \"position\"");
82 ROS_INFO_STREAM(
"position: " << position[0] <<
" " << position[1] <<
" " << position[2]);
85 if (!nh.
getParam(
"orientation", orientation) || orientation.size() != 4)
87 ROS_INFO(
"Missing or not full defined parameter: \"orientation\"");
92 ROS_INFO_STREAM(
"orientation: " << orientation[0] <<
" " << orientation[1] <<
" " << orientation[2] <<
" " << orientation[3]);
98 int main (
int argc,
char **argv)
101 ros::init(argc, argv,
"recorded_objects_transformer");
103 ISM::RecordedObjectsTransformer recorded_objects_transformer;
105 std::string source_file;
106 std::string target_file;
107 std::string object_type;
108 std::string object_id;
109 std::vector<double> point;
110 std::vector<double> quat;
113 if(
getNodeParameters(nh, source_file, target_file, object_type, object_id, point, quat))
115 recorded_objects_transformer.transformRecordedObjects(source_file, target_file, object_type, object_id,
116 point[0], point[1], point[2], quat[0], quat[1], quat[2], quat[3]);
117 ROS_INFO(
"TRANSFORMATION COMPLETE!");
121 ROS_INFO(
"TRANSFORMATION ABORTED! Check launch-file for missing parameter.");
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
#define ROS_INFO_STREAM(args)
bool getParam(const std::string &key, std::string &s) const