00001 /* 00002 * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc. 00003 * All rights reserved. This program is made available under the terms of the 00004 * Eclipse Public License v1.0 which accompanies this distribution, and is 00005 * available at http://www.eclipse.org/legal/epl-v10.html 00006 * Contributors: 00007 * National Institute of Advanced Industrial Science and Technology (AIST) 00008 */ 00009 00010 #ifndef ODE_LINK_H_INCLUDED 00011 #define ODE_LINK_H_INCLUDED 00012 00013 #include <ode/ode.h> 00014 #include <hrpModel/Link.h> 00015 #include <hrpModel/Sensor.h> 00016 #include <hrpUtil/Eigen4d.h> 00017 #include <vector> 00018 00019 class ODE_Link : public hrp::Link{ 00020 public : 00021 00022 void destroy(); 00023 00024 void getTransform(hrp::Vector3& pos, hrp::Matrix33& R); 00025 void setTransform(const hrp::Vector3& pos, const hrp::Matrix33& R); 00026 00027 dReal getAngle(); 00028 dReal getVelocity(); 00029 00030 const dReal* getAngularVel(); 00031 void getLinearVel(hrp::Vector3& v); 00032 void setAbsVelocity(hrp::Vector3& v, hrp::Vector3& w); 00033 const dReal* getForce(); 00034 const dReal* getTorque(); 00035 void setForce(double fx, double fy, double fz); 00036 void setTorque(double fx, double fy, double fz); 00037 void setTorque(dReal data); 00038 00039 dBodyID bodyId; 00040 dJointID odeJointId; 00041 00042 std::vector<dGeomID> geomIds; 00043 dTriMeshDataID triMeshDataId; 00044 std::vector<dReal> vertices; 00045 std::vector<int> indices; 00046 00047 hrp::Vector3 C; 00048 }; 00049 00050 class ODE_ForceSensor : public hrp::ForceSensor 00051 { 00052 public: 00053 dJointFeedback feedback; 00054 }; 00055 00056 #endif