00001 /* 00002 * Copyright (C) 2013-2014 Unbounded Robotics Inc. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 // Author: Michael Ferguson 00018 00019 #ifndef ROBOT_CALIBRATION_CALIBRATION_OFFSET_PARSER_H 00020 #define ROBOT_CALIBRATION_CALIBRATION_OFFSET_PARSER_H 00021 00022 #include <kdl/chain.hpp> 00023 00024 namespace robot_calibration 00025 { 00026 00032 class CalibrationOffsetParser 00033 { 00034 public: 00035 CalibrationOffsetParser(); 00036 virtual ~CalibrationOffsetParser() {} 00037 00043 bool add(const std::string name); 00044 00049 bool addFrame(const std::string name, 00050 bool calibrate_x, bool calibrate_y, bool calibrate_z, 00051 bool calibrate_roll, bool calibrate_pitch, bool calibrate_yaw); 00052 00054 bool update(const double* const free_params); 00055 00057 double get(const std::string name) const; 00058 00065 bool getFrame(const std::string name, KDL::Frame& offset) const; 00066 00068 int size(); 00069 00071 std::string getOffsetYAML(); 00072 00074 std::string updateURDF(const std::string& urdf); 00075 00076 private: 00077 // Names of parameters being calibrated. The order of this vector 00078 // is the same as the free_param order will be interpreted. 00079 std::vector<std::string> parameter_names_; 00080 00081 // Names of frames being calibrated. 00082 std::vector<std::string> frame_names_; 00083 00084 // Values of parameters from last update 00085 std::vector<double> parameter_offsets_; 00086 00087 // No copy 00088 CalibrationOffsetParser(const CalibrationOffsetParser&); 00089 CalibrationOffsetParser& operator=(const CalibrationOffsetParser&); 00090 }; 00091 00092 } // namespace robot_calibration 00093 00094 #endif // ROBOT_CALIBRATION_CALIBRATION_OFFSET_PARSER_H