00001 /* 00002 * Software License Agreement (Apache License) 00003 * 00004 * Copyright (c) 2013, Southwest Research Institute 00005 * 00006 * Licensed under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 00019 00020 #ifndef TEST_IK_H 00021 #define TEST_IK_H 00022 00023 #include "constrained_ik/constrained_ik.h" 00024 #include "constrained_ik/constraints/avoid_joint_limits.h" 00025 #include "constrained_ik/constraints/goal_position.h" 00026 #include "constrained_ik/constraints/goal_orientation.h" 00027 #include "constrained_ik/constraints/goal_tool_orientation.h" 00028 #include "constrained_ik/constraints/goal_minimize_change.h" 00029 #include "constrained_ik/constraints/goal_zero_jvel.h" 00030 #include "constrained_ik/constraints/avoid_singularities.h" 00031 #include "constrained_ik/constraints/joint_vel_limits.h" 00032 00033 namespace constrained_ik 00034 { 00035 namespace test_ik 00036 { 00037 00038 class Test_IK : public Constrained_IK 00039 { 00040 public: 00041 Test_IK(): position_(new constraints::GoalPosition), 00042 orientation_(new constraints::GoalOrientation), 00043 tool_orientation_(new constraints::GoalToolOrientation), 00044 avoid_joint_limits_(new constraints::AvoidJointLimits), 00045 min_change_(new constraints::GoalMinimizeChange), 00046 zero_vel_(new constraints::GoalZeroJVel), 00047 avoid_singularities_(new constraints::AvoidSingularities), 00048 vel_limits_(new constraints::JointVelLimits) 00049 { 00050 addConstraint(position_); 00051 addConstraint(orientation_); 00052 // addConstraint(tool_orientation_); 00053 Eigen::Vector3d w_ori; 00054 w_ori << 1,0.1,1; 00055 orientation_->setWeight(w_ori); 00056 orientation_->setTolerance(.25); 00057 // tool_orientation_->setWeight(w_ori); 00058 00059 // addConstraint(avoid_joint_limits_); 00060 // avoid_joint_limits_->setWeight(.25); 00061 00062 addConstraint(min_change_); 00063 min_change_->setWeight(.3); 00064 00065 // addConstraint(zero_vel_); 00066 // zero_vel_->setWeight(.7); 00067 00068 // addConstraint(avoid_singularities_); 00069 // avoid_singularities_->setWeight(0.25); 00070 00071 addConstraint(vel_limits_); 00072 vel_limits_->setWeight(.75); 00073 } 00074 ~Test_IK() {}; 00075 00076 protected: 00077 00078 constraints::GoalPosition* position_; 00079 constraints::GoalOrientation* orientation_; 00080 constraints::GoalToolOrientation* tool_orientation_; 00081 constraints::AvoidJointLimits* avoid_joint_limits_; 00082 constraints::GoalMinimizeChange* min_change_; 00083 constraints::GoalZeroJVel* zero_vel_; 00084 constraints::AvoidSingularities* avoid_singularities_; 00085 constraints::JointVelLimits* vel_limits_; 00086 }; // class Test_IK 00087 00088 } // namespace test_ik 00089 } // namespace constrained_ik 00090 00091 00092 #endif // TEST_IK_H 00093