BodyCustomizerInterface.h
Go to the documentation of this file.
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  */
00015 #ifndef HRPMODEL_BODY_CUSTOMIZER_INTERFACE_H_INCLUDED
00016 #define HRPMODEL_BODY_CUSTOMIZER_INTERFACE_H_INCLUDED
00017 
00018 #include "Config.h"
00019 #include <string>
00020 #include <hrpUtil/EigenTypes.h>
00021 
00022 namespace hrp {
00023 
00024     typedef void* BodyHandle;
00025     typedef void* BodyCustomizerHandle;
00026 
00027     typedef int         (*BodyGetLinkIndexFromNameFunc) (BodyHandle bodyHandle, const char* linkName);
00028     typedef const char* (*BodyGetLinkNameFunc)          (BodyHandle bodyHandle, int linkIndex);
00029     typedef double*     (*BodyGetLinkDoubleValuePtrFunc)(BodyHandle bodyHandle, int linkIndex);
00030 
00031     static const int BODY_INTERFACE_VERSION = 1;
00032 
00033     struct BodyInterface
00034     {
00035         int version;
00036                 
00037         BodyGetLinkIndexFromNameFunc   getLinkIndexFromName;
00038         BodyGetLinkNameFunc            getLinkName;
00039         BodyGetLinkDoubleValuePtrFunc  getJointValuePtr;
00040         BodyGetLinkDoubleValuePtrFunc  getJointVelocityPtr;
00041         BodyGetLinkDoubleValuePtrFunc  getJointForcePtr;
00042     };
00043     
00044     typedef const char** (*BodyCustomizerGetTargetModelNamesFunc)();
00045     typedef BodyCustomizerHandle (*BodyCustomizerCreateFunc)(BodyHandle bodyHandle, const char* modelName);
00046         
00047     typedef void (*BodyCustomizerDestroyFunc)              (BodyCustomizerHandle customizerHandle);
00048     typedef int  (*BodyCustomizerInitializeAnalyticIkFunc) (BodyCustomizerHandle customizerHandle, int baseLinkIndex, int targetLinkIndex);
00049 
00050     /*
00051       p and R are based on the coordinate of a base link
00052     */
00053     typedef bool (*BodyCustomizerCalcAnalyticIkFunc)       (BodyCustomizerHandle customizerHandle, int ikPathId, const Vector3& p, const Matrix33& R);
00054         
00055     typedef void (*BodyCustomizerSetVirtualJointForcesFunc)(BodyCustomizerHandle customizerHandle);
00056         
00057 
00058     static const int BODY_CUSTOMIZER_INTERFACE_VERSION = 1;
00059 
00060     struct BodyCustomizerInterface
00061     {
00062         int version;
00063 
00064         BodyCustomizerGetTargetModelNamesFunc getTargetModelNames;
00065         BodyCustomizerCreateFunc create;
00066         BodyCustomizerDestroyFunc destroy;
00067         BodyCustomizerInitializeAnalyticIkFunc initializeAnalyticIk;
00068         BodyCustomizerCalcAnalyticIkFunc calcAnalyticIk;
00069         BodyCustomizerSetVirtualJointForcesFunc setVirtualJointForces;
00070     };
00071 
00072     typedef BodyCustomizerInterface* (*GetBodyCustomizerInterfaceFunc)(BodyInterface* bodyInterface);
00073 
00074     HRPMODEL_API int loadBodyCustomizers(const std::string pathString, BodyInterface* bodyInterface);
00075     HRPMODEL_API int loadBodyCustomizers(const std::string pathString);
00076     HRPMODEL_API int loadBodyCustomizers(BodyInterface* bodyInterface);
00077     HRPMODEL_API int loadBodyCustomizers();
00078     
00079     HRPMODEL_API BodyCustomizerInterface* findBodyCustomizer(std::string modelName);
00080 
00081 }
00082     
00083 #endif


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sun Apr 2 2017 03:43:52