ODEJoint.hh
00001 /*
00002  * Copyright 2011 Nate Koenig & Andrew Howard
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 /* Desc: The ODE base joint class
00018  * Author: Nate Keonig, Andrew Howard
00019  * Date: 12 Oct 2009
00020  */
00021 
00022 #ifndef ODEJOINT_HH
00023 #define ODEJOINT_HH
00024 
00025 #include "physics/ode/ODEPhysics.hh"
00026 #include "physics/Joint.hh"
00027 
00028 namespace gazebo
00029 {
00030     namespace physics
00031   {
00034     
00037 
00039     class ODEJoint : public Joint
00040     {
00042       public: ODEJoint();
00043     
00045       public: virtual ~ODEJoint();
00046   
00048       public: virtual void Load( sdf::ElementPtr &_sdf );
00049   
00051       public: virtual LinkPtr GetJointLink( int index ) const;
00052   
00054       public: bool virtual AreConnected( LinkPtr one, LinkPtr two ) const;
00055   
00058       public: virtual double GetParam( int /*parameter*/ ) const;
00059   
00061       public: virtual void Attach( LinkPtr parent, LinkPtr child );
00062   
00064       public: virtual void Detach();
00065   
00068       public: virtual void SetParam(int /*parameter*/, double /*value*/);
00069   
00071       public: void SetERP(double newERP);
00072   
00074       public: double GetERP();
00075   
00077       public: void SetCFM(double newCFM);
00078   
00080       public: double GetCFM();
00081   
00083       public: dJointFeedback *GetFeedback();
00084   
00086       public: virtual void SetHighStop(int index, math::Angle angle);
00087   
00089       public: virtual void SetLowStop(int index, math::Angle angle);
00090    
00092       public: virtual math::Angle GetHighStop(int index);
00093   
00095       public: virtual math::Angle GetLowStop(int index);
00096   
00099       public: virtual math::Vector3 GetLinkForce(unsigned int index) const;
00100   
00103       public: virtual math::Vector3 GetLinkTorque(unsigned int index) const;
00104   
00106       public: virtual void SetAttribute( Attribute, int index, double value);
00107    
00108       public: virtual void Reset();
00109 
00111       protected: dJointID jointId;
00112     
00114       private: dJointFeedback *feedback;
00115     };
00118   }
00119 }
00120 #endif