Choreonoid  1.5
BodyCustomizerInterface.h
Go to the documentation of this file.
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 
76 
77 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
78 #define CNOID_BODY_CUSTOMIZER_EXPORT extern "C" __declspec(dllexport)
79 //extern "C" __declspec(dllexport) cnoid::BodyCustomizerInterface*
80 //getHrpBodyCustomizerInterface(cnoid::Bodyinterface* bodyinterface);
81 #else
82 #define CNOID_BODY_CUSTOMIZER_EXPORT extern "C"
83 //extern "C" cnoid::BodyCustomizerInterface*
84 //getHrpBodyCustomizerInterface(cnoid::Bodyinterface* bodyinterface);
85 #endif
86 
87 #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:129
CNOID_EXPORT BodyCustomizerInterface * findBodyCustomizer(std::string modelName)
Definition: BodyCustomizerInterface.cpp:222
const char **(* BodyCustomizerGetTargetModelNamesFunc)()
Definition: BodyCustomizerInterface.h:37
BodyCustomizerCalcAnalyticIkFunc calcAnalyticIk
Definition: BodyCustomizerInterface.h:61
void * BodyCustomizerHandle
Definition: Body.h:22
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
Defines the minimum processing for performing pasing file for STL.
Definition: AbstractSceneLoader.h:9
void * BodyHandle
Definition: BodyCustomizerInterface.h:17
Definition: BodyCustomizerInterface.h:26
Eigen::Vector3d Vector3
Definition: EigenTypes.h:58
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:37
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:57
BodyCustomizerDestroyFunc destroy
Definition: BodyCustomizerInterface.h:59