DiMP Users Manual Yuichi Tazaki
3 1 5 2 7 2.1............................. 7 2.2........................... 7 3 DiMP 9 3.1............................... 9 3.2........................... 10 3.3................................... 11 3.4..................................... 12 3.5.................................. 14 3.6..................................... 14 3.7..................................... 16 3.8..................................... 19 3.9................................... 21 3.10......................... 23 3.11................................. 27 30 31
5 1 DiMP C++ DiMP
7 2 2.1 DiMP doc lib Base DiMP1 DiMP2 GL Examples.lib Springhead Base DiMP DiMP OpenGL 2.2 DiMP Visual Studio 2010 VS2010 VS2010 DiMP10.sln DiMP
9 3 DiMP 3.1 DiMP DiMP DiMP 3.1 4 DiMP
10 3 DiMP 3.1 DiMP 3.2 3.2.1.h DiMP2 DiMP2 include #include <.h> 3.2.2 DiMP DiMP2 using namespace DiMP2; DiMP2 DiMP2::Object typedef typedef DiMP2:: D;
3.3 11 3.2.3 DiMP public 3.2.4 C++ real t vec3 t vec4 t quat t pose t 3 4 vec3 t quat t float double double float #define DIMP2_USE_SINGLE_PRECISION #include <.h> Springhead Base Springhead 3.3 DiMP2:: graph;
12 3 DiMP * graph = new ; delete class My : public { //... }; graph-> 3.3.1 void SetGravity(const vec3 t&) [0.0, 9.8, 0.0] graph.setgravity(vec3_t()); 3.4 Object Object* obj = graph->createobject(); graph 3.4.1
3.4 13 Object void SetMass(real t m) void SetInertia(real t I) void SetDynamical(bool on) DiMP (inertia ) 1.0 object->setdynamical(false); false 3.4.2 DiMP Object void SetInitialPose (vec3 t p, quat t q) void SetInitialVelocity(vec3 t v, vec3 t w) 3.4.3
14 3 DiMP Object void LockTrajectory() 3.5 Object Connector* CreateConnector(const pose t& p) void DeleteConnector(Connector* con) Connector void SetPose(const pose t& p) void GetPose(pose t& p) pose_t p; p.pos() = vec3_t(0,0,1); p.ori() = quat_t::rot(rad(30.0), x ); Connector* con = object->createconnector(p); [0, 0, 1] x 30 3.6
3.6 15 Box* CreateBox(string t, const vec3 t&) Sphere* CreateSphere(string t, real t) Cylinder* CreateCylinder(string t, real t, real t) void DeleteGeometry(Geometry* geo) DeleteGeometry Geometry 1.0 Box* box = graph->createbox("box1", vec3_t(1.0, 1.0, 1.0)); void void AttachGeometry(Geometry* geo, Connector* con) DetachGeometry(Geometry* geo, Connector* con) AttachGeometry geo con DetachGeometry con geo graph->addgeometry(box, con1); graph->addgeometry(box, con2); box 3.6.1 Box* CreateBox(string t name, const vec3 t& sz)
16 3 DiMP sz x y z 3.6.2 Sphere* CreateSphere(string t name, real t radius) radius 3.6.3 Cylinder* CreateCylinder(string t name, real t radius, real t length) z radius length 3.7 Hinge* CreateHinge (string t, Connector*, Connector*) Slider* CreateSlider (string t, Connector*, Connector*) Balljoint* CreateBalljoint (string t, Connector*, Connector*) Planejoint* CreatePlanejoint(string t, Connector*, Connector*) void DeleteJoint (Joint* jnt)
3.7 17 DiMP DeleteJoint Joint Hinge* hinge = graph->createhinge("hinge1", socket, plug); socket plug 3.7.1 1 z z 0 x x [rad] 3.7.2 1 z z 0 z 3.7.3 3
18 3 DiMP 0 [rad] 1 [rad] 2 [rad] 3.7.4 2 1 xy z xy 0 x 1 y 2 x x [rad] 3.7.5 0 Joint void SetInitialPos(uint i, real t pos) void SetInitialVel(uint i, real t vel) SetInitialPos i pos SetInitialVel i vel 3.7.6
3.8 19 Joint void void void SetPosRange (uint i, real t rmin, real t rmax) SetVelRange (uint i, real t rmin, real t rmax) SetTorqueRange(uint i, real t rmin, real t rmax) i rmin rmax 3.7.7 3.11.1 3.7.8 Object void ForwardKinematics() ForwardKinemaics 3.8 0 0
20 3 DiMP Tick* AddTick(real t) void AddTicks( real t ts, real t dt, real t te) void AddTicks( real t* tbegin, real t* tend) void RemoveTick(Tick*) void ClearTicks() size t NTicks() Tick* GetTick(uint i) real t GetHorizonLength() AddTick t AddTicks AddTicks ts te dt AddTicks [tbegin, tend) graph->addtick(0.0); graph->addtick(1.0); graph->addtick(2.0); graph->addtick(3.0); [0, 3] 3 1 4 3 Tick void SetTime(real t) real t GetTime() graph->gettick(2)->settime(2.1);
3.9 21 DiMP 3.9 DiMP DiMP DiMP TimeSlot* CreateTimeSlot(string t name, real t ts = 0.0, real t te = 0.0) TimeSlot* timeslot = graph->createtimeslot("timeslot1", 1.0, 2.0); CreateTimeSlot [1.0, 2.0]
22 3 DiMP TimeSlot void Set(real t ts, real t te) void Lock(bool on = true) void SetStartRange( real t ts min, real t ts max) void SetEndRange( real t te min, real t te max) void SetDurationRange( real t T min, real t T max) CreateTimeSlot Set timeslot->lock(); Lock(false) Set[Start End Duration]Range DiMP MatchingTask* CreateMatchingTask( string t name, Object* obj0, Object* obj1, TimeSlot* time = 0) AvoidTask* CreateAvoidTask( string t name, Object* obj0, Object* obj1, TimeSlot* time = 0) name obj0 obj1 time
3.10 23 time 0 (null) MatchingTask* task; task = graph->creatematchingtask("task1", hand, box, timeslot); hand box Object* 3.10 3.1 3.10.1 void Init() Init
24 3 DiMP 3.1 ObjectTP vec3 t ObjectRP quat t ObjectTV vec3 t ObjectRV vec3 t JointP real t JointV real t ForceT vec3 t ForceR vec3 t TimeStart real t TimeEnd real t Init 3.10.2 DiMP 3 ID ID VarTag ConTag 3.1 3.2 ID ID ID ID(int tag, Node* node = 0, Tick* tick = 0) tag node tick node
3.10 25 3.2 ObjectC1T vec3 t C 1 ( ) ObjectC1R quat t C 1 ( ) JointC1 real t C 1 JointRangeP real t JointRangeV real t JointRangeF real t JointTP vec3 t ( ) JointRP quat t ( ) JointTV vec3 t ( ) JointRV vec3 t ( ) ForceT real t ( ) ForceR real t ( ) TimeStartRange real t TimeEndRange real t TimeDurationRange real t MatchingTP vec3 t MatchingRP quat t MatchingTV vec3 t MatchingRV vec3 t AvoidP vec3 t AvoidV vec3 t tick 0 ID id(vartag::objecttp); ID
26 3 DiMP void Lock(ID id, bool lock = true) id ID lock void Enable(ID id, bool enable = true) id ID enable true id enable false void SetPriority(ID id, int level) id ID level 0 0, 1, 2 0, 3, 10 void SetNumIteration(int n) ::Step DiMP Gauss-Seidel SetNumIteration Gauss-Seidel Step
3.11 27 Step 3.10.3 DiMP ::Step void Step() DiMP Step Step Step real t CalcError(ID mask, bool sum or max) real t CalcVariable(ID mask, bool ave or max) CalcError ID ID sum or max true false 0 CalcVariable ID ID ave or max true false 3.11 3.11.1
28 3 DiMP 3.3 Constant 0 LinearDiff LinearInt Quadratic Cubic SlerpDiff (quat t ) SlerpInt (quat t ) Object vec3 t Pos(real t t, int type) vec3 t Vel(real t t, int type) vec3 t Acc(real t t, int type) quat t Ori(real t t, int type) vec3 t Angvel(real t t, int type) vec3 t Angacc(real t t, int type) t type DiMP type Interpolate 3.3 quat t type quat t SlerpDiff Quadratic Joint real t Pos(uint i, real t t, int type) real t Vel(uint i, real t t, int type) real t Acc(uint i, real t t, int type)
3.11 29 i 1 0 3.11.2 DiMP Springhead ics Springhead T.B.D.
30 Balljoint, 15 Box, 13 CreateBalljoint, 15 CreateBox, 13 CreateCylinder, 14 CreateHinge, 15 CreatePlanejoint, 16 CreateSlider, 15 CreateSphere, 14 Cylinder, 14, 17, 10, 8, 22, 15, 10, 16, 22 DiMP2, 8 Enable, 24, 9 Hinge, 15 ID, 22 Lock, 23 Object, 10 Planejoint, 16 real t, 9 SetNumIteration, 24 SetPriority, 24 Slider, 15 Sphere, 14, 10, 14, 9, 12, 12, 10, 10, 21, 17, 15, 19, 19
31 [1],, :,, Vol.31, No.5.