Choreonoid  1.1
BodyCustomizerInterface.h
[詳解]
1 
7 #ifndef CNOID_BODY_CUSTOMIZER_INTERFACE_H_INCLUDED
8 #define CNOID_BODY_CUSTOMIZER_INTERFACE_H_INCLUDED
9 
10 #include <string>
11 #include <cnoid/EigenTypes>
12 #include <cnoid/Config>
13 #include "exportdecl.h"
14 
15 namespace cnoid {
16 
17  typedef void* BodyHandle;
18  typedef void* BodyCustomizerHandle;
19 
20  typedef int (*BodyGetLinkIndexFromNameFunc) (BodyHandle bodyHandle, const char* linkName);
21  typedef const char* (*BodyGetLinkNameFunc) (BodyHandle bodyHandle, int linkIndex);
22  typedef double* (*BodyGetLinkDoubleValuePtrFunc)(BodyHandle bodyHandle, int linkIndex);
23 
24  static const int BODY_INTERFACE_VERSION = 1;
25 
27  {
28  int version;
29 
35  };
36 
37  typedef const char** (*BodyCustomizerGetTargetModelNamesFunc)();
38  typedef BodyCustomizerHandle (*BodyCustomizerCreateFunc)(BodyHandle bodyHandle, const char* modelName);
39 
40  typedef void (*BodyCustomizerDestroyFunc) (BodyCustomizerHandle customizerHandle);
41  typedef int (*BodyCustomizerInitializeAnalyticIkFunc) (BodyCustomizerHandle customizerHandle, int baseLinkIndex, int targetLinkIndex);
42 
43  /*
44  p and R are based on the coordinate of a base link
45  */
46  typedef bool (*BodyCustomizerCalcAnalyticIkFunc) (BodyCustomizerHandle customizerHandle, int ikPathId, const Vector3& p, const Matrix3& R);
47 
48  typedef void (*BodyCustomizerSetVirtualJointForcesFunc)(BodyCustomizerHandle customizerHandle);
49 
50 
51  static const int BODY_CUSTOMIZER_INTERFACE_VERSION = 1;
52 
54  {
55  int version;
56 
63  };
64 
65  typedef BodyCustomizerInterface* (*GetBodyCustomizerInterfaceFunc)(BodyInterface* bodyInterface);
66 
67  CNOID_EXPORT int loadBodyCustomizers(const std::string pathString, BodyInterface* bodyInterface);
68  CNOID_EXPORT int loadBodyCustomizers(const std::string pathString);
71 
73 }
74 
75 #endif
BodyCustomizerCreateFunc create
Definition: BodyCustomizerInterface.h:58
BodyCustomizerInitializeAnalyticIkFunc initializeAnalyticIk
Definition: BodyCustomizerInterface.h:60
BodyGetLinkDoubleValuePtrFunc getJointValuePtr
Definition: BodyCustomizerInterface.h:32
bool(* BodyCustomizerCalcAnalyticIkFunc)(BodyCustomizerHandle customizerHandle, int ikPathId, const Vector3 &p, const Matrix3 &R)
Definition: BodyCustomizerInterface.h:46
CNOID_EXPORT int loadBodyCustomizers(const std::string pathString, BodyInterface *bodyInterface)
Definition: BodyCustomizerInterface.cpp:138
CNOID_EXPORT BodyCustomizerInterface * findBodyCustomizer(std::string modelName)
Definition: BodyCustomizerInterface.cpp:232
const char **(* BodyCustomizerGetTargetModelNamesFunc)()
Definition: BodyCustomizerInterface.h:37
BodyCustomizerCalcAnalyticIkFunc calcAnalyticIk
Definition: BodyCustomizerInterface.h:61
void * BodyCustomizerHandle
Definition: Body.h:43
int version
Definition: BodyCustomizerInterface.h:55
int version
Definition: BodyCustomizerInterface.h:28
int(* BodyGetLinkIndexFromNameFunc)(BodyHandle bodyHandle, const char *linkName)
Definition: BodyCustomizerInterface.h:20
void(* BodyCustomizerSetVirtualJointForcesFunc)(BodyCustomizerHandle customizerHandle)
Definition: BodyCustomizerInterface.h:48
int(* BodyCustomizerInitializeAnalyticIkFunc)(BodyCustomizerHandle customizerHandle, int baseLinkIndex, int targetLinkIndex)
Definition: BodyCustomizerInterface.h:41
Definition: BodyCustomizerInterface.h:53
BodyGetLinkIndexFromNameFunc getLinkIndexFromName
Definition: BodyCustomizerInterface.h:30
BodyCustomizerHandle(* BodyCustomizerCreateFunc)(BodyHandle bodyHandle, const char *modelName)
Definition: BodyCustomizerInterface.h:38
BodyCustomizerSetVirtualJointForcesFunc setVirtualJointForces
Definition: BodyCustomizerInterface.h:62
BodyGetLinkDoubleValuePtrFunc getJointForcePtr
Definition: BodyCustomizerInterface.h:34
Definition: EasyScanner.h:16
void * BodyHandle
Definition: Body.h:41
Definition: BodyCustomizerInterface.h:26
Eigen::Vector3d Vector3
Definition: EigenTypes.h:26
void(* BodyCustomizerDestroyFunc)(BodyCustomizerHandle customizerHandle)
Definition: BodyCustomizerInterface.h:40
double *(* BodyGetLinkDoubleValuePtrFunc)(BodyHandle bodyHandle, int linkIndex)
Definition: BodyCustomizerInterface.h:22
#define CNOID_EXPORT
Definition: Util/exportdecl.h:13
BodyGetLinkNameFunc getLinkName
Definition: BodyCustomizerInterface.h:31
BodyGetLinkDoubleValuePtrFunc getJointVelocityPtr
Definition: BodyCustomizerInterface.h:33
const char *(* BodyGetLinkNameFunc)(BodyHandle bodyHandle, int linkIndex)
Definition: BodyCustomizerInterface.h:21
BodyCustomizerGetTargetModelNamesFunc getTargetModelNames
Definition: BodyCustomizerInterface.h:57
Eigen::Matrix3d Matrix3
Definition: EigenTypes.h:25
BodyCustomizerDestroyFunc destroy
Definition: BodyCustomizerInterface.h:59