forked from s-nakaoka/openhrp-plugin
-
Notifications
You must be signed in to change notification settings - Fork 4
/
BodyInfo_impl.h
61 lines (50 loc) · 1.73 KB
/
BodyInfo_impl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
\file
\author Shizuko Hattori
*/
#ifndef CNOID_OPENHRP_MODELLOADER_BODYINFO_IMPL_H
#define CNOID_OPENHRP_MODELLOADER_BODYINFO_IMPL_H
#include <cnoid/corba/OpenHRPModelLoader/ModelLoader.hh>
#include <cnoid/corba/OpenHRPModelLoader/ViewSimulator.hh>
#include "ShapeSetInfo_impl.h"
#include <cnoid/BodyLoader>
#include <cnoid/Body>
#include <cnoid/ForceSensor>
#include <string>
#include <iostream>
namespace cnoid {
class BodyInfo_impl : public virtual POA_OpenHRP::BodyInfo,
public virtual ShapeSetInfo_impl
{
public:
BodyInfo_impl(PortableServer::POA_ptr poa);
virtual ~BodyInfo_impl();
virtual char* name() override;
virtual char* url() override;
virtual OpenHRP::StringSequence* info() override;
virtual OpenHRP::LinkInfoSequence* links() override;
virtual OpenHRP::AllLinkShapeIndexSequence* linkShapeIndices() override;
virtual OpenHRP::ExtraJointInfoSequence* extraJoints() override;
void loadModelFile(const std::string& filename);
void setMessageSink(std::ostream& os_) { os = &os_; };
private :
std::ostream* os;
BodyPtr body;
std::string name_;
std::string url_;
OpenHRP::StringSequence info_;
OpenHRP::LinkInfoSequence links_;
OpenHRP::AllLinkShapeIndexSequence linkShapeIndices_;
OpenHRP::ExtraJointInfoSequence extraJoints_;
void setLinks();
void setLink(OpenHRP::LinkInfo& linkInfo, Link& link);
void setSegment(OpenHRP::LinkInfo& linkInfo, Link& link);
void setHwc(OpenHRP::LinkInfo& linkInfo, Link& link);
void setDevices();
void setSensor(Device* device);
void setLight(Device* device);
void setExtraJoints();
void setExtraJoint(OpenHRP::ExtraJointInfo& extraJoiontInfo, ExtraJoint& joint);
};
}
#endif