24 template <
typename TSrc>
25 void copyDblArraySeqToTimedDoubleSeq(
const TSrc& src,
int arraySize, TimedDoubleSeq& dest)
27 CORBA::ULong
n = src.length();
28 CORBA::ULong m = n * arraySize;
30 CORBA::ULong destPos = 0;
31 for(CORBA::ULong
i=0;
i <
n; ++
i){
32 for(
int j=0;
j < arraySize; ++
j){
33 dest.data[destPos++] = src[
i][
j];
38 template <
typename TSrcSeq,
typename TDestSeq>
42 DynamicsSimulator::LinkDataType toDynamicsSimulatorLinkDataType(
DataTypeId id)
68 outPort(info.portName.c_str(), values)
90 copyDblArraySeqToTimedDoubleSeq(state.force, 6,
values);
93 copyDblArraySeqToTimedDoubleSeq(state.rateGyro, 3,
values);
96 copyDblArraySeqToTimedDoubleSeq(state.accel, 3,
values);
114 linkName(info.dataOwnerName)
126 for(
size_t i=0, k=0;
i<
n;
i++){
130 value.data.length(n*m);
132 for(CORBA::ULong
j=0;
j < m;
j++)
133 value.data[k++] = data[
j];
157 value.data.position.x = data[0];
158 value.data.position.y = data[1];
159 value.data.position.z = data[2];
161 R << data[3], data[4], data[5],
162 data[6], data[7], data[8],
163 data[9], data[10], data[11];
165 value.data.orientation.r = rpy[0];
166 value.data.orientation.p = rpy[1];
167 value.data.orientation.y = rpy[2];
181 sensorName(info.dataOwnerName)
192 for(
size_t i=0, k=0;
i<
n;
i++){
196 value.data.length(n*m);
198 for(CORBA::ULong
j=0;
j < m;
j++)
199 value.data[k++] = data[
j];
224 for(
size_t i=0;
i<
n;
i++){
226 value.data.avx = data[0];
227 value.data.avy = data[1];
228 value.data.avz = data[2];
253 for(
size_t i=0;
i<
n;
i++){
255 value.data.ax = data[0];
256 value.data.ay = data[1];
257 value.data.az = data[2];
272 cameraId(info.dataOwnerId)
281 image.data = imageInput->longData;
304 image.data = imageInput->octetData;
327 image.data = imageInput->floatData;
340 inPort(info.
portName.c_str(), values)
363 CORBA::ULong n =
values.data.length();
365 for(CORBA::ULong
i=0;
i <
n; ++
i){
373 linkName(info.dataOwnerName)
384 CORBA::ULong m=
data.length()/
n;
385 for(
size_t i=0, k=0;
i<
n;
i++){
388 for(CORBA::ULong
j=0;
j<m;
j++)
389 data0[
j] =
data[k++];
403 CORBA::ULong n =
values.data.length();
405 for(CORBA::ULong
i=0;
i <
n; ++
i){
439 values.data.orientation.p,
440 values.data.orientation.y);
441 for (
int i=0;
i<3;
i++){
442 for (
int j=0;
j<3;
j++){
GyroSensorOutPortHandler(PortInfo &info)
AccelerationSensorOutPortHandler(PortInfo &info)
RTC::InPort< RTC::TimedDoubleSeq > inPort
virtual void inputDataFromSimulator(Controller_impl *controller)
RTC::InPort< RTC::TimedDoubleSeq > inPort
virtual void inputDataFromSimulator(Controller_impl *controller)
ColorImageOutPortHandler(PortInfo &info)
std::vector< std::string > sensorName
virtual void outputDataToSimulator(Controller_impl *controller)
std::vector< std::string > sensorName
DynamicsSimulator::LinkDataType linkDataType
RTC::OutPort< RTC::TimedDoubleSeq > outPort
virtual void inputDataFromSimulator(Controller_impl *controller)
ImageData * getCameraImageFromSimulator(int cameraId)
virtual void inputDataFromSimulator(Controller_impl *controller)
virtual void inputDataFromSimulator(Controller_impl *controller)
DblSequence & getJointDataSeqRef(DynamicsSimulator::LinkDataType linkDataType)
virtual void writeDataToPort()
LinkDataOutPortHandler(PortInfo &info)
RTC::OutPort< RTC::TimedAngularVelocity3D > outPort
Matrix33 rotFromRpy(const Vector3 &rpy)
std::vector< std::string > sensorName
void setTime(T &value, double _time)
LinkDataInPortHandler(PortInfo &info)
SensorState & getCurrentSensorState()
virtual void readDataFromPort(Controller_impl *controller)
RTC::TimedAcceleration3D value
RTC::TimedDoubleSeq values
void flushJointDataSeqToSimulator(DynamicsSimulator::LinkDataType linkDataType)
def j(str, encoding="cp932")
void flushLinkDataToSimulator(const std::string &linkName, DynamicsSimulator::LinkDataType linkDataType, const DblSequence &linkData)
virtual void inputDataFromSimulator(Controller_impl *controller)
RTC::TimedDoubleSeq value
RTC::OutPort< RTC::TimedFloatSeq > outPort
virtual void inputDataFromSimulator(Controller_impl *controller)
RTC::TimedAngularVelocity3D value
virtual void writeDataToPort()
virtual void writeDataToPort()
HRP_UTIL_EXPORT Vector3 rpyFromRot(const Matrix33 &m)
RTC::TimedDoubleSeq values
SensorStateOutPortHandler(PortInfo &info)
DblSequence * getLinkDataFromSimulator(const std::string &linkName, DynamicsSimulator::LinkDataType linkDataType)
RTC::TimedDoubleSeq values
DynamicsSimulator::LinkDataType linkDataType
virtual void readDataFromPort(Controller_impl *controller)
virtual void outputDataToSimulator(Controller_impl *controller)
RTC::TimedDoubleSeq value
RTC::OutPort< RTC::TimedDoubleSeq > outPort
GrayScaleImageOutPortHandler(PortInfo &info)
virtual bool write(DataType &value)
DynamicsSimulator::LinkDataType linkDataType
JointDataSeqInPortHandler(PortInfo &info)
DepthImageOutPortHandler(PortInfo &info)
virtual void writeDataToPort()
virtual void writeDataToPort()
SensorDataOutPortHandler(PortInfo &info)
std::vector< std::string > linkName
DblSequence * getSensorDataFromSimulator(const std::string &sensorName)
virtual void writeDataToPort()
RTC::OutPort< RTC::TimedLongSeq > outPort
std::vector< std::string > linkName
RTC::OutPort< RTC::TimedDoubleSeq > outPort
RTC::OutPort< RTC::TimedOctetSeq > outPort
virtual void writeDataToPort()
virtual void inputDataFromSimulator(Controller_impl *controller)
virtual void writeDataToPort()
RTC::OutPort< RTC::TimedAcceleration3D > outPort