Viewer/RTCGLbody.cpp
Go to the documentation of this file.
1 #include <rtm/DataFlowComponentBase.h>
2 #include "RTCGLbody.h"
3 #if 0
4 #include "IrrModel.h"
5 #else
6 #include "hrpsys/util/GLbody.h"
7 #include "hrpsys/util/GLlink.h"
8 #endif
9 
11  m_body(i_body),
12  m_qIn("q", m_q),
13  m_posIn("pos", m_pos),
14  m_rpyIn("rpy", m_rpy)
15 {
16  if (m_body->numJoints() > 0) comp->addInPort("q", m_qIn);
18  comp->addInPort("pos", m_posIn);
19  comp->addInPort("rpy", m_rpyIn);
20  }
21 }
22 
24 {
25  if (m_qIn.isNew()){
26  while (m_qIn.isNew()) m_qIn.read();
27  m_body->setPosture(m_q.data.get_buffer());
28  }
29  if (m_posIn.isNew()){
30  while (m_posIn.isNew()) m_posIn.read();
31  m_body->setPosition(m_pos.data.x,
32  m_pos.data.y,
33  m_pos.data.z);
34  }
35  if (m_rpyIn.isNew()){
36  while (m_rpyIn.isNew()) m_rpyIn.read();
37  m_body->setRotation(m_rpy.data.r,
38  m_rpy.data.p,
39  m_rpy.data.y);
40  }
41 }
Link * rootLink() const
RTC::TimedOrientation3D m_rpy
unsigned int numJoints() const
void setPosition(double x, double y, double z)
Definition: GLbody.cpp:27
RTC::InPort< RTC::TimedOrientation3D > m_rpyIn
Definition: GLbody.h:11
void setRotation(const double *R)
Definition: GLbody.cpp:37
RTC::InPort< RTC::TimedPoint3D > m_posIn
RTC::TimedDoubleSeq m_q
RTC::InPort< RTC::TimedDoubleSeq > m_qIn
GLbody * m_body
void setPosture(const double *i_angles)
Definition: GLbody.cpp:21
RTC::TimedPoint3D m_pos
virtual bool isNew()
bool addInPort(const char *name, InPortBase &inport)
RTCGLbody(GLbody *i_body, RTC::DataFlowComponentBase *comp)


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Sat Dec 17 2022 03:52:21