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 {
00036 struct TolerancedJointValue
00037 {
00038   TolerancedJointValue(double nominal, double lower, double upper) : nominal(nominal), lower(lower), upper(upper)
00039   {
00040   }
00041 
00042   TolerancedJointValue(double nominal) : nominal(nominal), lower(nominal), upper(nominal)
00043   {
00044   }
00045 
00046   double range() const
00047   {
00048     return upper - lower;
00049   }
00050 
00051   double nominal, lower, upper;
00052 };
00053 
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 
00092   JointTrajectoryPt(const std::vector<TolerancedJointValue> &joints,
00093                     const descartes_core::TimingConstraint &timing = descartes_core::TimingConstraint());
00094 
00099   JointTrajectoryPt(const std::vector<double> &joints,
00100                     const descartes_core::TimingConstraint &timing = descartes_core::TimingConstraint());
00101 
00102   virtual ~JointTrajectoryPt(){};
00103 
00108   // TODO complete
00109   virtual bool getClosestCartPose(const std::vector<double> &seed_state, const descartes_core::RobotModel &model,
00110                                   Eigen::Affine3d &pose) const;
00111 
00112   // TODO complete
00113   virtual bool getNominalCartPose(const std::vector<double> &seed_state, const descartes_core::RobotModel &model,
00114                                   Eigen::Affine3d &pose) const;
00115 
00116   // TODO complete
00117   virtual void getCartesianPoses(const descartes_core::RobotModel &model, EigenSTL::vector_Affine3d &poses) const;
00124   // TODO complete
00125   virtual bool getClosestJointPose(const std::vector<double> &seed_state, const descartes_core::RobotModel &model,
00126                                    std::vector<double> &joint_pose) const;
00127   // TODO complete
00128   virtual bool getNominalJointPose(const std::vector<double> &seed_state, const descartes_core::RobotModel &model,
00129                                    std::vector<double> &joint_pose) const;
00130 
00131   // TODO complete
00132   virtual void getJointPoses(const descartes_core::RobotModel &model,
00133                              std::vector<std::vector<double> > &joint_poses) const;
00136   // TODO complete
00137   virtual bool isValid(const descartes_core::RobotModel &model) const;
00138 
00139   // TODO complete
00145   virtual bool setDiscretization(const std::vector<double> &discretization);
00146 
00147   virtual descartes_core::TrajectoryPtPtr copy() const
00148   {
00149     return descartes_core::TrajectoryPtPtr(new JointTrajectoryPt(*this));
00150   }
00151 
00152   void setJoints(const std::vector<TolerancedJointValue> &joints);
00153 
00154   inline void setTool(const descartes_core::Frame &tool)
00155   {
00156     tool_ = tool;
00157   }
00158 
00159   inline void setWobj(const descartes_core::Frame &wobj)
00160   {
00161     wobj_ = wobj;
00162   }
00165   inline const std::vector<double> &nominal() const
00166   {
00167     return nominal_;
00168   }
00169 
00170   inline const std::vector<double> &upper() const
00171   {
00172     return upper_;
00173   }
00174 
00175   inline const std::vector<double> &lower() const
00176   {
00177     return lower_;
00178   }
00179 
00180 protected:
00181   std::vector<double> nominal_;
00182   std::vector<double> lower_;
00183   std::vector<double> upper_;
00184   std::vector<double> discretization_; 
00189   descartes_core::Frame tool_; 
00190   descartes_core::Frame wobj_; 
00192 };
00193 
00194 } /* namespace descartes_trajectory */
00195 
00196 #endif /* JOINT_TRAJECTORY_PT_H_ */


descartes_trajectory
Author(s): Jorge Nicho
autogenerated on Thu Jun 6 2019 21:36:04