joint_trajectory_pt.h
Go to the documentation of this file.
00001 /*
00002  * Software License Agreement (Apache License)
00003  *
00004  * Copyright (c) 2014, Dan Solomon
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  * joint_trajectory_pt.h
00020  *
00021  *  Created on: Oct 3, 2014
00022  *      Author: Dan Solomon
00023  */
00024 
00025 #ifndef JOINT_TRAJECTORY_PT_H_
00026 #define JOINT_TRAJECTORY_PT_H_
00027 
00028 #include <vector>
00029 #include "descartes_core/trajectory_pt.h"
00030 
00031 namespace descartes_trajectory
00032 {
00033 
00037 struct TolerancedJointValue
00038 {
00039   TolerancedJointValue(double nominal, double lower, double upper)
00040     : nominal(nominal), lower(lower), upper(upper)
00041   {}
00042 
00043   TolerancedJointValue(double nominal)
00044     : nominal(nominal), lower(nominal), upper(nominal)
00045   {}
00046 
00047   double range() const
00048   {
00049     return upper - lower;
00050   }
00051 
00052   double nominal, lower, upper;
00053 };
00054 
00067 class JointTrajectoryPt: public descartes_core::TrajectoryPt
00068 {
00069 public:
00070   EIGEN_MAKE_ALIGNED_OPERATOR_NEW;      //TODO is this needed when Frame already has it?
00071 public:
00076   JointTrajectoryPt(const descartes_core::TimingConstraint& timing = descartes_core::TimingConstraint());
00077 
00084   JointTrajectoryPt(const std::vector<TolerancedJointValue> &joints, const descartes_core::Frame &tool, 
00085                     const descartes_core::Frame &wobj, 
00086                     const descartes_core::TimingConstraint& timing = descartes_core::TimingConstraint());
00087 
00088 
00093   JointTrajectoryPt(const std::vector<TolerancedJointValue> &joints, 
00094                     const descartes_core::TimingConstraint& timing = descartes_core::TimingConstraint());
00095 
00096 
00101   JointTrajectoryPt(const std::vector<double> &joints, 
00102                     const descartes_core::TimingConstraint& timing = descartes_core::TimingConstraint());
00103 
00104   virtual ~JointTrajectoryPt() {};
00105 
00110   //TODO complete
00111   virtual bool getClosestCartPose(const std::vector<double> &seed_state,
00112                                     const descartes_core::RobotModel &model, Eigen::Affine3d &pose) const;
00113 
00114   //TODO complete
00115   virtual bool getNominalCartPose(const std::vector<double> &seed_state,
00116                                     const descartes_core::RobotModel &model, Eigen::Affine3d &pose) const;
00117 
00118   //TODO complete
00119   virtual void getCartesianPoses(const descartes_core::RobotModel &model, EigenSTL::vector_Affine3d &poses) const;
00126   //TODO complete
00127   virtual bool getClosestJointPose(const std::vector<double> &seed_state,
00128                                      const descartes_core::RobotModel &model,
00129                                      std::vector<double> &joint_pose) const;
00130   //TODO complete
00131   virtual bool getNominalJointPose(const std::vector<double> &seed_state,
00132                                      const descartes_core::RobotModel &model,
00133                                      std::vector<double> &joint_pose) const;
00134 
00135   //TODO complete
00136   virtual void getJointPoses(const descartes_core::RobotModel &model,
00137                                std::vector<std::vector<double> > &joint_poses) const;
00140   //TODO complete
00141   virtual bool isValid(const descartes_core::RobotModel &model) const;
00142 
00143   //TODO complete
00148   virtual bool setDiscretization(const std::vector<double> &discretization);
00149 
00150   virtual descartes_core::TrajectoryPtPtr copy() const
00151   {
00152     return descartes_core::TrajectoryPtPtr(new JointTrajectoryPt(*this));
00153   }
00154 
00155   void setJoints(const std::vector<TolerancedJointValue> &joints);
00156 
00157   inline
00158   void setTool(const descartes_core::Frame &tool)
00159   {
00160     tool_ = tool;
00161   }
00162 
00163   inline
00164   void setWobj(const descartes_core::Frame &wobj)
00165   {
00166     wobj_ = wobj;
00167   }
00170   inline
00171   const std::vector<double>& nominal() const
00172   {
00173     return nominal_;
00174   }
00175 
00176   inline
00177   const std::vector<double>& upper() const
00178   {
00179     return upper_;
00180   }
00181 
00182   inline
00183   const std::vector<double>& lower() const
00184   {
00185     return lower_;
00186   }
00187 
00188 protected:
00189   std::vector<double> nominal_;
00190   std::vector<double> lower_;
00191   std::vector<double> upper_;
00192   std::vector<double> discretization_;  
00197   descartes_core::Frame                         tool_;                  
00198   descartes_core::Frame                         wobj_;                  
00201 };
00202 
00203 } /* namespace descartes_trajectory */
00204 
00205 
00206 
00207 #endif /* JOINT_TRAJECTORY_PT_H_ */


descartes_trajectory
Author(s): Jorge Nicho
autogenerated on Wed Aug 26 2015 11:21:27