[openrtm-commit:00859] r326 - in trunk/rtmtools/jp.go.aist.rtm.rtcbuilder: resource/100/CXX resource/100/CXX/Manip src/jp/go/aist/rtm/rtcbuilder src/jp/go/aist/rtm/rtcbuilder/generator src/jp/go/aist/rtm/rtcbuilder/generator/param/idl src/jp/go/aist/rtm/rtcbuilder/manager test/jp/go/aist/rtm/rtcbuilder/_test/_100
openrtm @ openrtm.org
openrtm @ openrtm.org
2012年 6月 30日 (土) 03:12:00 JST
Author: sakamoto
Date: 2012-06-30 03:11:59 +0900 (Sat, 30 Jun 2012)
New Revision: 326
Added:
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/BasicDataType.idl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ManipulatorCommonInterface_DataTypes.idl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ManipulatorCommonInterface_MiddleLevel.idl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ManipulatorCommonInterface_MiddleLevelSVC_impl.cpp
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ManipulatorCommonInterface_MiddleLevelSVC_impl.h
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ModuleName.cpp
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ModuleName.h
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ModuleNameComp.cpp
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/CXXManipTest.java
Modified:
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/Generator.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/IDLParamConverter.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/ServiceArgumentParam.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/TypeDefParam.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/manager/CXXConverter.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/AllTestsCXX.java
Log:
Modified IDLConverter for Standard Manip IDL
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/BasicDataType.idl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/BasicDataType.idl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/BasicDataType.idl 2012-06-29 18:11:59 UTC (rev 326)
@@ -0,0 +1,189 @@
+// -*- IDL -*-
+/*!
+ * @file DataType.idl
+ * @brief Basic Data Type definition
+ * @date $Date: 2007-01-09 15:36:29 $
+ * @author Noriaki Ando <n-ando at aist.go.jp>
+ *
+ * Copyright (C) 2003-2006
+ * Task-intelligence Research Group,
+ * Intelligent Systems Research Institute,
+ * National Institute of
+ * Advanced Industrial Science and Technology (AIST), Japan
+ * All rights reserved.
+ *
+ * $Id: BasicDataType.idl 1580 2009-12-07 08:54:10Z kurihara $
+ *
+ */
+
+#ifndef BasicDataType_idl
+#define BasicDataType_idl
+
+module RTC {
+ //------------------------------------------------------------
+ // Basic data type definition
+ //------------------------------------------------------------
+ struct Time
+ {
+ unsigned long sec; // sec
+ unsigned long nsec; // nano sec
+ };
+
+ struct TimedState
+ {
+ Time tm;
+ short data;
+ };
+
+ struct TimedShort
+ {
+ Time tm;
+ short data;
+ };
+
+ struct TimedLong
+ {
+ Time tm;
+ long data;
+ };
+
+ struct TimedUShort
+ {
+ Time tm;
+ unsigned short data;
+ };
+
+ struct TimedULong
+ {
+ Time tm;
+ unsigned long data;
+ };
+
+ struct TimedFloat
+ {
+ Time tm;
+ float data;
+ };
+
+ struct TimedDouble
+ {
+ Time tm;
+ double data;
+ };
+
+ struct TimedChar
+ {
+ Time tm;
+ char data;
+ };
+
+ struct TimedWChar
+ {
+ Time tm;
+ wchar data;
+ };
+
+ struct TimedBoolean
+ {
+ Time tm;
+ boolean data;
+ };
+
+ struct TimedOctet
+ {
+ Time tm;
+ octet data;
+ };
+
+ struct TimedString
+ {
+ Time tm;
+ string data;
+ };
+
+
+ struct TimedWString
+ {
+ Time tm;
+ wstring data;
+ };
+
+
+ /*!
+ * Sequence data type
+ */
+ struct TimedShortSeq
+ {
+ Time tm;
+ sequence<short> data;
+ };
+
+ struct TimedLongSeq
+ {
+ Time tm;
+ sequence<long> data;
+ };
+
+ struct TimedUShortSeq
+ {
+ Time tm;
+ sequence<unsigned short> data;
+ };
+
+ struct TimedULongSeq
+ {
+ Time tm;
+ sequence<unsigned long> data;
+ };
+
+ struct TimedFloatSeq
+ {
+ Time tm;
+ sequence<float> data;
+ };
+
+ struct TimedDoubleSeq
+ {
+ Time tm;
+ sequence<double> data;
+ };
+
+ struct TimedCharSeq
+ {
+ Time tm;
+ sequence<char> data;
+ };
+
+ struct TimedWCharSeq
+ {
+ Time tm;
+ sequence<wchar> data;
+ };
+
+ struct TimedBooleanSeq
+ {
+ Time tm;
+ sequence<boolean> data;
+ };
+
+ struct TimedOctetSeq
+ {
+ Time tm;
+ sequence<octet> data;
+ };
+
+ struct TimedStringSeq
+ {
+ Time tm;
+ sequence<string> data;
+ };
+
+ struct TimedWStringSeq
+ {
+ Time tm;
+ sequence<wstring> data;
+ };
+
+};
+
+#endif // end of BasicDataType_idl
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ManipulatorCommonInterface_DataTypes.idl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ManipulatorCommonInterface_DataTypes.idl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ManipulatorCommonInterface_DataTypes.idl 2012-06-29 18:11:59 UTC (rev 326)
@@ -0,0 +1,41 @@
+
+/*
+Manipulator Common Interface (Data type defenition)
+ - This IDL is used as service port on RTC
+ - This command specification is provided by Intelligent RT Software
+ Project of NEDO.
+rev. 20100502
+*/
+
+#ifndef MANIPULATORCOMMONINTERFACE_DATATYPES_IDL
+#define MANIPULATORCOMMONINTERFACE_DATATYPES_IDL
+
+#include "BasicDataType.idl"
+
+module RTC
+{
+
+ typedef sequence<double> DoubleSeq;
+
+ typedef sequence<double> JointPos;
+
+ struct LimitValue {
+ double upper;
+ double lower;
+ };
+
+ struct RETURN_ID
+ {
+ long id; /**< エラーID */ string comment; /**< エラーコト */
+ };
+
+ struct TimedJointPos {
+ Time tm;
+ JointPos pos;
+ };
+
+ typedef unsigned long ULONG;
+
+};
+
+#endif // MANIPULATORCOMMONINTERFACE_DATATYPES_IDL
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ManipulatorCommonInterface_MiddleLevel.idl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ManipulatorCommonInterface_MiddleLevel.idl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ManipulatorCommonInterface_MiddleLevel.idl 2012-06-29 18:11:59 UTC (rev 326)
@@ -0,0 +1,102 @@
+
+/*
+Manipulator Common Interface (Middle Level Commands)
+ - This IDL is used as service port on RTC
+ - This command specification is provided by Intelligent RT Software
+ Project of NEDO.
+rev. 20100318
+*/
+
+#ifndef MANIPULATORCOMMONINTERFACE_MIDDLE_IDL
+#define MANIPULATORCOMMONINTERFACE_MIDDLE_IDL
+
+#include "ManipulatorCommonInterface_DataTypes.idl"
+
+module RTC
+{
+
+ typedef double HgMatrix [3][4];
+
+ struct CarPosWithElbow {
+ HgMatrix carPos;
+ double elbow;
+ ULONG structFlag;
+ };
+
+ struct CartesianSpeed {
+ double translation;
+ double rotation;
+ };
+
+};
+
+interface ManipulatorCommonInterface_Middle
+{
+
+ RTC::RETURN_ID closeGripper();
+
+ RTC::RETURN_ID getBaseOffset(out RTC::HgMatrix offset);
+
+ RTC::RETURN_ID getFeedbackPosCartesian(out RTC::CarPosWithElbow pos);
+
+ RTC::RETURN_ID getMaxSpeedCartesian(out RTC::CartesianSpeed speed);
+
+ RTC::RETURN_ID getMaxSpeedJoint(out RTC::DoubleSeq speed);
+
+ RTC::RETURN_ID getMinAccelTimeCartesian(out double aclTime);
+
+ RTC::RETURN_ID getMinAccelTimeJoint(out double aclTime);
+
+ RTC::RETURN_ID getSoftLimitCartesian(out RTC::LimitValue xLimit,
+ out RTC::LimitValue yLimit,
+ out RTC::LimitValue zLimit );
+
+ RTC::RETURN_ID moveGripper(in RTC::ULONG angleRatio);
+
+ RTC::RETURN_ID moveLinearCartesianAbs(in RTC::CarPosWithElbow carPoint);
+
+ RTC::RETURN_ID moveLinearCartesianRel(in RTC::CarPosWithElbow carPoint);
+
+ RTC::RETURN_ID movePTPCartesianAbs(in RTC::CarPosWithElbow carPoint);
+
+ RTC::RETURN_ID movePTPCartesianRel(in RTC::CarPosWithElbow carPoint);
+
+ RTC::RETURN_ID movePTPJointAbs(in RTC::JointPos jointPoints);
+
+ RTC::RETURN_ID movePTPJointRel(in RTC::JointPos jointPoints);
+
+ RTC::RETURN_ID openGripper();
+
+ RTC::RETURN_ID pause();
+
+ RTC::RETURN_ID resume();
+
+ RTC::RETURN_ID stop();
+
+ RTC::RETURN_ID setAccelTimeCartesian(in double aclTime);
+
+ RTC::RETURN_ID setAccelTimeJoint(in double aclTime);
+
+ RTC::RETURN_ID setBaseOffset(in RTC::HgMatrix offset);
+
+ RTC::RETURN_ID setControlPointOffset(in RTC::HgMatrix offset);
+
+ RTC::RETURN_ID setMaxSpeedCartesian(in RTC::CartesianSpeed speed);
+
+ RTC::RETURN_ID setMaxSpeedJoint(in RTC::DoubleSeq speed);
+
+ RTC::RETURN_ID setMinAccelTimeCartesian(in double aclTime);
+
+ RTC::RETURN_ID setMinAccelTimeJoint(in double aclTime);
+
+ RTC::RETURN_ID setSoftLimitCartesian(in RTC::LimitValue xLimit,
+ in RTC::LimitValue yLimit,
+ in RTC::LimitValue zLimit);
+
+ RTC::RETURN_ID setSpeedCartesian(in RTC::ULONG spdRatio);
+
+ RTC::RETURN_ID setSpeedJoint(in RTC::ULONG spdRatio);
+
+};
+
+#endif // MANIPULATORCOMMONINTERFACE_MIDDLE_IDL
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ManipulatorCommonInterface_MiddleLevelSVC_impl.cpp
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ManipulatorCommonInterface_MiddleLevelSVC_impl.cpp (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ManipulatorCommonInterface_MiddleLevelSVC_impl.cpp 2012-06-29 18:11:59 UTC (rev 326)
@@ -0,0 +1,333 @@
+// -*-C++-*-
+/*!
+ * @file ManipulatorCommonInterface_MiddleLevelSVC_impl.cpp
+ * @brief Service implementation code of ManipulatorCommonInterface_MiddleLevel.idl
+ *
+ */
+
+#include "ManipulatorCommonInterface_MiddleLevelSVC_impl.h"
+
+/*
+ * Example implementational code for IDL interface ManipulatorCommonInterface_Middle
+ */
+ManipulatorCommonInterface_MiddleSVC_impl::ManipulatorCommonInterface_MiddleSVC_impl()
+{
+ // Please add extra constructor code here.
+}
+
+
+ManipulatorCommonInterface_MiddleSVC_impl::~ManipulatorCommonInterface_MiddleSVC_impl()
+{
+ // Please add extra destructor code here.
+}
+
+
+/*
+ * Methods corresponding to IDL attributes and operations
+ */
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::closeGripper()
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::closeGripper()>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::getBaseOffset(RTC::HgMatrix offset)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::getBaseOffset(RTC::HgMatrix offset)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::getFeedbackPosCartesian(RTC::CarPosWithElbow& pos)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::getFeedbackPosCartesian(RTC::CarPosWithElbow& pos)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::getMaxSpeedCartesian(RTC::CartesianSpeed& speed)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::getMaxSpeedCartesian(RTC::CartesianSpeed& speed)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::getMaxSpeedJoint(RTC::DoubleSeq_out speed)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::getMaxSpeedJoint(RTC::DoubleSeq_out speed)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::getMinAccelTimeCartesian(CORBA::Double& aclTime)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::getMinAccelTimeCartesian(CORBA::Double& aclTime)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::getMinAccelTimeJoint(CORBA::Double& aclTime)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::getMinAccelTimeJoint(CORBA::Double& aclTime)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::getSoftLimitCartesian(RTC::LimitValue& xLimit, RTC::LimitValue& yLimit, RTC::LimitValue& zLimit)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::getSoftLimitCartesian(RTC::LimitValue& xLimit, RTC::LimitValue& yLimit, RTC::LimitValue& zLimit)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::moveGripper(RTC::ULONG angleRatio)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::moveGripper(RTC::ULONG angleRatio)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::moveLinearCartesianAbs(const RTC::CarPosWithElbow& carPoint)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::moveLinearCartesianAbs(const RTC::CarPosWithElbow& carPoint)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::moveLinearCartesianRel(const RTC::CarPosWithElbow& carPoint)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::moveLinearCartesianRel(const RTC::CarPosWithElbow& carPoint)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::movePTPCartesianAbs(const RTC::CarPosWithElbow& carPoint)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::movePTPCartesianAbs(const RTC::CarPosWithElbow& carPoint)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::movePTPCartesianRel(const RTC::CarPosWithElbow& carPoint)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::movePTPCartesianRel(const RTC::CarPosWithElbow& carPoint)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::movePTPJointAbs(const RTC::JointPos& jointPoints)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::movePTPJointAbs(const RTC::JointPos& jointPoints)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::movePTPJointRel(const RTC::JointPos& jointPoints)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::movePTPJointRel(const RTC::JointPos& jointPoints)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::openGripper()
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::openGripper()>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::pause()
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::pause()>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::resume()
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::resume()>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::stop()
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::stop()>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setAccelTimeCartesian(CORBA::Double aclTime)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setAccelTimeCartesian(CORBA::Double aclTime)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setAccelTimeJoint(CORBA::Double aclTime)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setAccelTimeJoint(CORBA::Double aclTime)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setBaseOffset(const RTC::HgMatrix offset)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setBaseOffset(const RTC::HgMatrix offset)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setControlPointOffset(const RTC::HgMatrix offset)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setControlPointOffset(const RTC::HgMatrix offset)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setMaxSpeedCartesian(const RTC::CartesianSpeed& speed)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setMaxSpeedCartesian(const RTC::CartesianSpeed& speed)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setMaxSpeedJoint(const RTC::DoubleSeq& speed)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setMaxSpeedJoint(const RTC::DoubleSeq& speed)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setMinAccelTimeCartesian(CORBA::Double aclTime)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setMinAccelTimeCartesian(CORBA::Double aclTime)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setMinAccelTimeJoint(CORBA::Double aclTime)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setMinAccelTimeJoint(CORBA::Double aclTime)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setSoftLimitCartesian(const RTC::LimitValue& xLimit, const RTC::LimitValue& yLimit, const RTC::LimitValue& zLimit)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setSoftLimitCartesian(const RTC::LimitValue& xLimit, const RTC::LimitValue& yLimit, const RTC::LimitValue& zLimit)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setSpeedCartesian(RTC::ULONG spdRatio)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setSpeedCartesian(RTC::ULONG spdRatio)>"
+#endif
+ return result;
+}
+
+RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setSpeedJoint(RTC::ULONG spdRatio)
+{
+ RTC::RETURN_ID* result;
+ // Please insert your code here and remove the following warning pragma
+#ifndef WIN32
+ #warning "Code missing in function <RTC::RETURN_ID* ManipulatorCommonInterface_MiddleSVC_impl::setSpeedJoint(RTC::ULONG spdRatio)>"
+#endif
+ return result;
+}
+
+
+
+// End of example implementational code
+
+
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ManipulatorCommonInterface_MiddleLevelSVC_impl.h
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ManipulatorCommonInterface_MiddleLevelSVC_impl.h (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ManipulatorCommonInterface_MiddleLevelSVC_impl.h 2012-06-29 18:11:59 UTC (rev 326)
@@ -0,0 +1,77 @@
+// -*-C++-*-
+/*!
+ * @file ManipulatorCommonInterface_MiddleLevelSVC_impl.h
+ * @brief Service implementation header of ManipulatorCommonInterface_MiddleLevel.idl
+ *
+ */
+
+#include "ManipulatorCommonInterface_DataTypesSkel.h"
+#include "BasicDataTypeSkel.h"
+
+#include "ManipulatorCommonInterface_MiddleLevelSkel.h"
+
+#ifndef MANIPULATORCOMMONINTERFACE_MIDDLELEVELSVC_IMPL_H
+#define MANIPULATORCOMMONINTERFACE_MIDDLELEVELSVC_IMPL_H
+
+/*!
+ * @class ManipulatorCommonInterface_MiddleSVC_impl
+ * Example class implementing IDL interface ManipulatorCommonInterface_Middle
+ */
+class ManipulatorCommonInterface_MiddleSVC_impl
+ : public virtual POA_ManipulatorCommonInterface_Middle,
+ public virtual PortableServer::RefCountServantBase
+{
+ private:
+ // Make sure all instances are built on the heap by making the
+ // destructor non-public
+ //virtual ~ManipulatorCommonInterface_MiddleSVC_impl();
+
+ public:
+ /*!
+ * @brief standard constructor
+ */
+ ManipulatorCommonInterface_MiddleSVC_impl();
+ /*!
+ * @brief destructor
+ */
+ virtual ~ManipulatorCommonInterface_MiddleSVC_impl();
+
+ // attributes and operations
+ RTC::RETURN_ID* closeGripper();
+ RTC::RETURN_ID* getBaseOffset(RTC::HgMatrix offset);
+ RTC::RETURN_ID* getFeedbackPosCartesian(RTC::CarPosWithElbow& pos);
+ RTC::RETURN_ID* getMaxSpeedCartesian(RTC::CartesianSpeed& speed);
+ RTC::RETURN_ID* getMaxSpeedJoint(RTC::DoubleSeq_out speed);
+ RTC::RETURN_ID* getMinAccelTimeCartesian(CORBA::Double& aclTime);
+ RTC::RETURN_ID* getMinAccelTimeJoint(CORBA::Double& aclTime);
+ RTC::RETURN_ID* getSoftLimitCartesian(RTC::LimitValue& xLimit, RTC::LimitValue& yLimit, RTC::LimitValue& zLimit);
+ RTC::RETURN_ID* moveGripper(RTC::ULONG angleRatio);
+ RTC::RETURN_ID* moveLinearCartesianAbs(const RTC::CarPosWithElbow& carPoint);
+ RTC::RETURN_ID* moveLinearCartesianRel(const RTC::CarPosWithElbow& carPoint);
+ RTC::RETURN_ID* movePTPCartesianAbs(const RTC::CarPosWithElbow& carPoint);
+ RTC::RETURN_ID* movePTPCartesianRel(const RTC::CarPosWithElbow& carPoint);
+ RTC::RETURN_ID* movePTPJointAbs(const RTC::JointPos& jointPoints);
+ RTC::RETURN_ID* movePTPJointRel(const RTC::JointPos& jointPoints);
+ RTC::RETURN_ID* openGripper();
+ RTC::RETURN_ID* pause();
+ RTC::RETURN_ID* resume();
+ RTC::RETURN_ID* stop();
+ RTC::RETURN_ID* setAccelTimeCartesian(CORBA::Double aclTime);
+ RTC::RETURN_ID* setAccelTimeJoint(CORBA::Double aclTime);
+ RTC::RETURN_ID* setBaseOffset(const RTC::HgMatrix offset);
+ RTC::RETURN_ID* setControlPointOffset(const RTC::HgMatrix offset);
+ RTC::RETURN_ID* setMaxSpeedCartesian(const RTC::CartesianSpeed& speed);
+ RTC::RETURN_ID* setMaxSpeedJoint(const RTC::DoubleSeq& speed);
+ RTC::RETURN_ID* setMinAccelTimeCartesian(CORBA::Double aclTime);
+ RTC::RETURN_ID* setMinAccelTimeJoint(CORBA::Double aclTime);
+ RTC::RETURN_ID* setSoftLimitCartesian(const RTC::LimitValue& xLimit, const RTC::LimitValue& yLimit, const RTC::LimitValue& zLimit);
+ RTC::RETURN_ID* setSpeedCartesian(RTC::ULONG spdRatio);
+ RTC::RETURN_ID* setSpeedJoint(RTC::ULONG spdRatio);
+
+};
+
+
+
+#endif // MANIPULATORCOMMONINTERFACE_MIDDLELEVELSVC_IMPL_H
+
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ModuleName.cpp
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ModuleName.cpp (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ModuleName.cpp 2012-06-29 18:11:59 UTC (rev 326)
@@ -0,0 +1,166 @@
+// -*- C++ -*-
+/*!
+ * @file ModuleName.cpp
+ * @brief ModuleDescription
+ * @date $Date$
+ *
+ * $Id$
+ */
+
+#include "ModuleName.h"
+
+// Module specification
+// <rtc-template block="module_spec">
+static const char* modulename_spec[] =
+ {
+ "implementation_id", "ModuleName",
+ "type_name", "ModuleName",
+ "description", "ModuleDescription",
+ "version", "1.0.0",
+ "vendor", "VenderName",
+ "category", "Category",
+ "activity_type", "PERIODIC",
+ "kind", "DataFlowComponent",
+ "max_instance", "1",
+ "language", "C++",
+ "lang_type", "compile",
+ ""
+ };
+// </rtc-template>
+
+/*!
+ * @brief constructor
+ * @param manager Maneger Object
+ */
+ModuleName::ModuleName(RTC::Manager* manager)
+ // <rtc-template block="initializer">
+ : RTC::DataFlowComponentBase(manager),
+ m_sv_namePort("sv_name")
+
+ // </rtc-template>
+{
+}
+
+/*!
+ * @brief destructor
+ */
+ModuleName::~ModuleName()
+{
+}
+
+
+
+RTC::ReturnCode_t ModuleName::onInitialize()
+{
+ // Registration: InPort/OutPort/Service
+ // <rtc-template block="registration">
+ // Set InPort buffers
+
+ // Set OutPort buffer
+
+ // Set service provider to Ports
+ m_sv_namePort.registerProvider("if_name", "ManipulatorCommonInterface_Middle", m_if_variable_name);
+
+ // Set service consumers to Ports
+
+ // Set CORBA Service Ports
+ addPort(m_sv_namePort);
+
+ // </rtc-template>
+
+ return RTC::RTC_OK;
+}
+
+/*
+RTC::ReturnCode_t ModuleName::onFinalize()
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t ModuleName::onStartup(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t ModuleName::onShutdown(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t ModuleName::onActivated(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t ModuleName::onDeactivated(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t ModuleName::onExecute(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t ModuleName::onAborting(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t ModuleName::onError(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t ModuleName::onReset(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t ModuleName::onStateUpdate(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t ModuleName::onRateChanged(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+
+
+extern "C"
+{
+
+ void ModuleNameInit(RTC::Manager* manager)
+ {
+ coil::Properties profile(modulename_spec);
+ manager->registerFactory(profile,
+ RTC::Create<ModuleName>,
+ RTC::Delete<ModuleName>);
+ }
+
+};
+
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ModuleName.h
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ModuleName.h (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ModuleName.h 2012-06-29 18:11:59 UTC (rev 326)
@@ -0,0 +1,274 @@
+// -*- C++ -*-
+/*!
+ * @file ModuleName.h
+ * @brief ModuleDescription
+ * @date $Date$
+ *
+ * $Id$
+ */
+
+#ifndef MODULENAME_H
+#define MODULENAME_H
+
+#include <rtm/Manager.h>
+#include <rtm/DataFlowComponentBase.h>
+#include <rtm/CorbaPort.h>
+#include <rtm/DataInPort.h>
+#include <rtm/DataOutPort.h>
+#include <rtm/idl/BasicDataTypeSkel.h>
+#include <rtm/idl/ExtendedDataTypesSkel.h>
+#include <rtm/idl/InterfaceDataTypesSkel.h>
+
+// Service implementation headers
+// <rtc-template block="service_impl_h">
+#include "ManipulatorCommonInterface_MiddleLevelSVC_impl.h"
+
+// </rtc-template>
+
+// Service Consumer stub headers
+// <rtc-template block="consumer_stub_h">
+
+// </rtc-template>
+
+using namespace RTC;
+
+/*!
+ * @class ModuleName
+ * @brief ModuleDescription
+ *
+ */
+class ModuleName
+ : public RTC::DataFlowComponentBase
+{
+ public:
+ /*!
+ * @brief constructor
+ * @param manager Maneger Object
+ */
+ ModuleName(RTC::Manager* manager);
+
+ /*!
+ * @brief destructor
+ */
+ ~ModuleName();
+
+ // <rtc-template block="public_attribute">
+
+ // </rtc-template>
+
+ // <rtc-template block="public_operation">
+
+ // </rtc-template>
+
+ /***
+ *
+ * The initialize action (on CREATED->ALIVE transition)
+ * formaer rtc_init_entry()
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ virtual RTC::ReturnCode_t onInitialize();
+
+ /***
+ *
+ * The finalize action (on ALIVE->END transition)
+ * formaer rtc_exiting_entry()
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onFinalize();
+
+ /***
+ *
+ * The startup action when ExecutionContext startup
+ * former rtc_starting_entry()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The shutdown action when ExecutionContext stop
+ * former rtc_stopping_entry()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The activated action (Active state entry action)
+ * former rtc_active_entry()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The deactivated action (Active state exit action)
+ * former rtc_active_exit()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The execution action that is invoked periodically
+ * former rtc_active_do()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The aborting action when main logic error occurred.
+ * former rtc_aborting_entry()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The error action in ERROR state
+ * former rtc_error_do()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The reset action that is invoked resetting
+ * This is same but different the former rtc_init_entry()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The state update action that is invoked after onExecute() action
+ * no corresponding operation exists in OpenRTm-aist-0.2.0
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The action that is invoked when execution context's rate is changed
+ * no corresponding operation exists in OpenRTm-aist-0.2.0
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
+
+
+ protected:
+ // <rtc-template block="protected_attribute">
+
+ // </rtc-template>
+
+ // <rtc-template block="protected_operation">
+
+ // </rtc-template>
+
+ // DataInPort declaration
+ // <rtc-template block="inport_declare">
+
+ // </rtc-template>
+
+
+ // DataOutPort declaration
+ // <rtc-template block="outport_declare">
+
+ // </rtc-template>
+
+ // CORBA Port declaration
+ // <rtc-template block="corbaport_declare">
+ /*!
+ */
+ RTC::CorbaPort m_sv_namePort;
+
+ // </rtc-template>
+
+ // Service declaration
+ // <rtc-template block="service_declare">
+ /*!
+ */
+ ManipulatorCommonInterface_MiddleSVC_impl m_if_variable_name;
+
+ // </rtc-template>
+
+ // Consumer declaration
+ // <rtc-template block="consumer_declare">
+
+ // </rtc-template>
+
+ private:
+ // <rtc-template block="private_attribute">
+
+ // </rtc-template>
+
+ // <rtc-template block="private_operation">
+
+ // </rtc-template>
+
+};
+
+
+extern "C"
+{
+ DLL_EXPORT void ModuleNameInit(RTC::Manager* manager);
+};
+
+#endif // MODULENAME_H
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ModuleNameComp.cpp
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ModuleNameComp.cpp (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Manip/ModuleNameComp.cpp 2012-06-29 18:11:59 UTC (rev 326)
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+/*!
+ * @file ModuleNameComp.cpp
+ * @brief Standalone component
+ * @date $Date$
+ *
+ * $Id$
+ */
+
+#include <rtm/Manager.h>
+#include <iostream>
+#include <string>
+#include <stdlib.h>
+#include "ModuleName.h"
+
+
+void MyModuleInit(RTC::Manager* manager)
+{
+ ModuleNameInit(manager);
+ RTC::RtcBase* comp;
+
+ // Create a component
+ comp = manager->createComponent("ModuleName");
+
+ if (comp==NULL)
+ {
+ std::cerr << "Component create failed." << std::endl;
+ abort();
+ }
+
+ // Example
+ // The following procedure is examples how handle RT-Components.
+ // These should not be in this function.
+
+ // Get the component's object reference
+// RTC::RTObject_var rtobj;
+// rtobj = RTC::RTObject::_narrow(manager->getPOA()->servant_to_reference(comp));
+
+ // Get the port list of the component
+// PortServiceList* portlist;
+// portlist = rtobj->get_ports();
+
+ // getting port profiles
+// std::cout << "Number of Ports: ";
+// std::cout << portlist->length() << std::endl << std::endl;
+// for (CORBA::ULong i(0), n(portlist->length()); i < n; ++i)
+// {
+// PortService_ptr port;
+// port = (*portlist)[i];
+// std::cout << "Port" << i << " (name): ";
+// std::cout << port->get_port_profile()->name << std::endl;
+//
+// RTC::PortInterfaceProfileList iflist;
+// iflist = port->get_port_profile()->interfaces;
+// std::cout << "---interfaces---" << std::endl;
+// for (CORBA::ULong i(0), n(iflist.length()); i < n; ++i)
+// {
+// std::cout << "I/F name: ";
+// std::cout << iflist[i].instance_name << std::endl;
+// std::cout << "I/F type: ";
+// std::cout << iflist[i].type_name << std::endl;
+// const char* pol;
+// pol = iflist[i].polarity == 0 ? "PROVIDED" : "REQUIRED";
+// std::cout << "Polarity: " << pol << std::endl;
+// }
+// std::cout << "---properties---" << std::endl;
+// NVUtil::dump(port->get_port_profile()->properties);
+// std::cout << "----------------" << std::endl << std::endl;
+// }
+
+ return;
+}
+
+int main (int argc, char** argv)
+{
+ RTC::Manager* manager;
+ manager = RTC::Manager::init(argc, argv);
+
+ // Initialize manager
+ manager->init(argc, argv);
+
+ // Set module initialization proceduer
+ // This procedure will be invoked in activateManager() function.
+ manager->setModuleInitProc(MyModuleInit);
+
+ // Activate manager and register to naming service
+ manager->activateManager();
+
+ // run the manager in blocking mode
+ // runManager(false) is the default.
+ manager->runManager();
+
+ // If you want to run the manager in non-blocking mode, do like this
+ // manager->runManager(true);
+
+ return 0;
+}
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/Generator.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/Generator.java 2012-06-28 13:21:36 UTC (rev 325)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/Generator.java 2012-06-29 18:11:59 UTC (rev 326)
@@ -280,10 +280,8 @@
specification spec = parser.specification();
- List<ServiceClassParam> serviceClassParams = IDLParamConverter
- .convert(spec, sv.getName());
- List<TypeDefParam> typedefParams = IDLParamConverter
- .convert_typedef(spec, sv.getName());
+ List<ServiceClassParam> serviceClassParams = IDLParamConverter.convert(spec, sv.getName());
+ List<TypeDefParam> typedefParams = IDLParamConverter.convert_typedef(spec, sv.getName());
if (typedefParams.size() > 0) {
serviceClassParams = convertType(serviceClassParams, typedefParams);
}
@@ -358,8 +356,17 @@
}
}
private void checkMethodType(ServiceMethodParam target, List<TypeDefParam> types) {
+ String targetFull = target.getModule() + target.getType();
+ //
for(TypeDefParam tdparam : types) {
- if(target.getType().equals(tdparam.getTargetDef())) {
+ String defFull = "";
+ if( 0<tdparam.getModuleName().length() ) {
+ defFull = tdparam.getModuleName() + "::" + tdparam.getTargetDef();
+ } else {
+ defFull = tdparam.getTargetDef();
+ }
+// if(target.getType().equals(tdparam.getTargetDef())) {
+ if(targetFull.equals(defFull)) {
target.setSequence(tdparam.isSequence());
target.setString(tdparam.isString());
target.setChildString(tdparam.isChildString());
@@ -371,13 +378,22 @@
target.setType(checkType(target.getType(), types));
}
private void checkArgumentType(ServiceArgumentParam target, List<TypeDefParam> types) {
+ String targetFull = target.getModule() + target.getType();
for(TypeDefParam tdparam : types) {
- if(target.getType().equals(tdparam.getTargetDef())) {
+ String defFull = "";
+ if( 0<tdparam.getModuleName().length() ) {
+ defFull = tdparam.getModuleName() + "::" + tdparam.getTargetDef();
+ } else {
+ defFull = tdparam.getTargetDef();
+ }
+ if(targetFull.equals(defFull)) {
target.setOriginalType(target.getType());
target.setUnbounded(tdparam.isSequence() || tdparam.isString());
target.setArray(tdparam.isArray());
+ target.setInnerArray(tdparam.isInnerArray());
target.setStruct(tdparam.isStruct());
target.setEnum(tdparam.isEnum());
+ target.setChildDouble(tdparam.isChildDouble());
target.setType(checkType(target.getType(), types));
return;
}
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/IDLParamConverter.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/IDLParamConverter.java 2012-06-28 13:21:36 UTC (rev 325)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/IDLParamConverter.java 2012-06-29 18:11:59 UTC (rev 326)
@@ -12,13 +12,16 @@
import jp.go.aist.rtm.rtcbuilder.corba.idl.parser.syntaxtree.array_declarator;
import jp.go.aist.rtm.rtcbuilder.corba.idl.parser.syntaxtree.base_type_spec;
import jp.go.aist.rtm.rtcbuilder.corba.idl.parser.syntaxtree.enum_type;
+import jp.go.aist.rtm.rtcbuilder.corba.idl.parser.syntaxtree.fixed_array_size;
import jp.go.aist.rtm.rtcbuilder.corba.idl.parser.syntaxtree.identifier;
import jp.go.aist.rtm.rtcbuilder.corba.idl.parser.syntaxtree.interface_dcl;
import jp.go.aist.rtm.rtcbuilder.corba.idl.parser.syntaxtree.interface_header;
import jp.go.aist.rtm.rtcbuilder.corba.idl.parser.syntaxtree.module;
import jp.go.aist.rtm.rtcbuilder.corba.idl.parser.syntaxtree.op_dcl;
import jp.go.aist.rtm.rtcbuilder.corba.idl.parser.syntaxtree.param_dcl;
+import jp.go.aist.rtm.rtcbuilder.corba.idl.parser.syntaxtree.primary_expr;
import jp.go.aist.rtm.rtcbuilder.corba.idl.parser.syntaxtree.scoped_name;
+import jp.go.aist.rtm.rtcbuilder.corba.idl.parser.syntaxtree.sequence_type;
import jp.go.aist.rtm.rtcbuilder.corba.idl.parser.syntaxtree.simple_type_spec;
import jp.go.aist.rtm.rtcbuilder.corba.idl.parser.syntaxtree.specification;
import jp.go.aist.rtm.rtcbuilder.corba.idl.parser.syntaxtree.string_type;
@@ -38,6 +41,8 @@
* <p>
*/
public class IDLParamConverter {
+
+ static private List<String> moduleName;
/**
* IDLの構文解析木から、ジェネレータのインプットとなるServiceParamに変換する
@@ -78,8 +83,7 @@
@Override
public void visit(op_dcl n, Object argu) {
final ServiceMethodParam serviceMethodParam = new ServiceMethodParam();
- serviceMethodParam
- .setName(n.identifier.nodeToken.tokenImage);
+ serviceMethodParam.setName(n.identifier.nodeToken.tokenImage);
serviceMethodParam.setType(node2String(n.op_type_spec));
serviceMethodParam.setModule(service.getModule());
@@ -137,15 +141,32 @@
public static List<TypeDefParam> convert_typedef(specification spec,
final String idlPath) {
final List<TypeDefParam> result = new ArrayList<TypeDefParam>();
-
+ moduleName = new ArrayList<String>();
+
spec.accept(new GJVoidDepthFirst<String>() {
+
@Override
+ public void visit(module n, String argu) {
+ moduleName.add(node2String(n.identifier.nodeToken));
+ super.visit(n, argu);
+ }
+
+ @Override
+ public void visit(NodeToken n, String argu) {
+ if( node2String(n).equals("}")) {
+ moduleName.remove(moduleName.size()-1);
+ }
+ super.visit(n, argu);
+ }
+
+ @Override
public void visit(interface_dcl n, String argu) {
final String ifname = n.interface_header.identifier.nodeToken.tokenImage;
n.interface_body.accept(new GJVoidDepthFirst<String>() {
@Override
public void visit(type_declarator n, String argu) {
final TypeDefParam tdparam = new TypeDefParam();
+ tdparam.setModuleName(getModuleNames());
n.declarators.accept(new DepthFirstVisitor(){
@Override
public void visit(identifier n) {
@@ -181,6 +202,7 @@
@Override
public void visit(struct_type n, String argu) {
final TypeDefParam tdparam = new TypeDefParam();
+ tdparam.setModuleName(getModuleNames());
tdparam.setStruct(true);
n.identifier.accept(new DepthFirstVisitor(){
@Override
@@ -194,14 +216,21 @@
tdparam.getChildType().add(node2String(n));
if(node2String(n).toLowerCase().equals("string") ) {
tdparam.setChildString(true);
+ } else if(node2String(n).toLowerCase().equals("double") ) {
+ tdparam.setChildDouble(true);
}
}
+ @Override
+ public void visit(array_declarator n) {
+ tdparam.setInnerArray(true);
+ }
});
result.add(tdparam);
}
@Override
public void visit(enum_type n, String argu) {
final TypeDefParam tdparam = new TypeDefParam();
+ tdparam.setModuleName(getModuleNames());
tdparam.setEnum(true);
n.identifier.accept(new DepthFirstVisitor(){
@Override
@@ -214,6 +243,7 @@
@Override
public void visit(type_declarator n, String argu) {
final TypeDefParam tdparam = new TypeDefParam();
+ tdparam.setModuleName(getModuleNames());
n.declarators.accept(new DepthFirstVisitor(){
@Override
public void visit(identifier n) {
@@ -272,6 +302,15 @@
return result;
}
+ private static String getModuleNames() {
+ StringBuilder builder = new StringBuilder();
+ for(int index=0;index<moduleName.size();index++) {
+ builder.append(moduleName.get(index));
+ if(index!=moduleName.size()-1) builder.append("::");
+ }
+ return builder.toString();
+ }
+
public static List<String> extractTypeDef(List<DataTypeParam> sources) {
List<String> result = new ArrayList<String>();
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/ServiceArgumentParam.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/ServiceArgumentParam.java 2012-06-28 13:21:36 UTC (rev 325)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/ServiceArgumentParam.java 2012-06-29 18:11:59 UTC (rev 326)
@@ -15,8 +15,10 @@
private String direction;
private boolean isUnbounded;
private boolean isArray;
+ private boolean isInnerArray;
private boolean isStruct;
private boolean isEnum;
+ private boolean isChildDouble;
public String getName() {
return name;
@@ -67,6 +69,20 @@
this.isArray = isArray;
}
+ public boolean isInnerArray() {
+ return isInnerArray;
+ }
+ public void setInnerArray(boolean isInnerArray) {
+ this.isInnerArray = isInnerArray;
+ }
+
+ public boolean isChildDouble() {
+ return isChildDouble;
+ }
+ public void setChildDouble(boolean isChildDouble) {
+ this.isChildDouble = isChildDouble;
+ }
+
public boolean isStruct() {
return isStruct;
}
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/TypeDefParam.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/TypeDefParam.java 2012-06-28 13:21:36 UTC (rev 325)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/idl/TypeDefParam.java 2012-06-29 18:11:59 UTC (rev 326)
@@ -11,26 +11,32 @@
private static final long serialVersionUID = -5166319784409856148L;
private String originalDef;
+ private String moduleName;
private String targetDef;
private String scopedName;
private boolean isSequence;
private boolean isString;
private boolean isArray;
+ private boolean isInnerArray;
private boolean isStruct;
private boolean isEnum;
private boolean isChildString;
+ private boolean isChildDouble;
private List<String> childType;
public TypeDefParam() {
originalDef = "";
+ moduleName = "";
targetDef = "";
scopedName = "";
isSequence = false;
isString = false;
isArray = false;
+ isInnerArray = false;
isStruct = false;
isEnum = false;
isChildString = false;
+ isChildDouble = false;
childType = new ArrayList<String>();
}
@@ -41,6 +47,13 @@
this.originalDef = originalDef;
}
+ public String getModuleName() {
+ return moduleName;
+ }
+ public void setModuleName(String moduleName) {
+ this.moduleName = moduleName;
+ }
+
public String getTargetDef() {
return this.targetDef;
}
@@ -76,6 +89,13 @@
this.isArray = isArray;
}
+ public boolean isInnerArray() {
+ return isInnerArray;
+ }
+ public void setInnerArray(boolean isInnerArray) {
+ this.isInnerArray = isInnerArray;
+ }
+
public boolean isStruct() {
return isStruct;
}
@@ -97,6 +117,13 @@
this.isChildString = isChildString;
}
+ public boolean isChildDouble() {
+ return isChildDouble;
+ }
+ public void setChildDouble(boolean isChildDouble) {
+ this.isChildDouble = isChildDouble;
+ }
+
public List<String> getChildType() {
return childType;
}
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/manager/CXXConverter.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/manager/CXXConverter.java 2012-06-28 13:21:36 UTC (rev 325)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/manager/CXXConverter.java 2012-06-29 18:11:59 UTC (rev 326)
@@ -148,11 +148,16 @@
if( result == null ) {
result = typeDef.getType();
if( !typeDef.getType().contains("::") ) {
+// if(typeDef.isArray() && !typeDef.isStruct()) {
if(typeDef.isArray()) {
result = result + "_slice*";
} else if(typeDef.isSequence() || typeDef.isString() || typeDef.isChildString()) {
result = result + "*";
}
+ } else {
+ if(typeDef.isStruct()) {
+ result = result + "*";
+ }
}
if(typeDef.getModule()!=null && typeDef.getModule().length()>0) {
result = typeDef.getModule() + result;
@@ -240,8 +245,13 @@
}
if(typeDef.getDirection().equals("in"))
result = "const " + result + "&";
- else if(typeDef.getDirection().equals("out"))
- result = result + "_out";
+ else if(typeDef.getDirection().equals("out")) {
+ if(typeDef.isInnerArray()==false && typeDef.isChildDouble()) {
+ result = result + "&";
+ } else {
+ result = result + "_out";
+ }
+ }
else if(typeDef.getDirection().equals("inout"))
result = result + "&";
} else {
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/AllTestsCXX.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/AllTestsCXX.java 2012-06-28 13:21:36 UTC (rev 325)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/AllTestsCXX.java 2012-06-29 18:11:59 UTC (rev 326)
@@ -30,6 +30,7 @@
suite.addTestSuite(CXXLibraryTest.class);
suite.addTestSuite(CXXConfigSetTest.class);
suite.addTestSuite(CXXIDLStructTest.class);
+ suite.addTestSuite(CXXManipTest.class);
//$JUnit-END$
return suite;
}
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/CXXManipTest.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/CXXManipTest.java (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/CXXManipTest.java 2012-06-29 18:11:59 UTC (rev 326)
@@ -0,0 +1,138 @@
+package jp.go.aist.rtm.rtcbuilder._test._100;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import jp.go.aist.rtm.rtcbuilder.Generator;
+import jp.go.aist.rtm.rtcbuilder.IRtcBuilderConstants;
+import jp.go.aist.rtm.rtcbuilder._test.TestBase;
+import jp.go.aist.rtm.rtcbuilder.generator.GeneratedResult;
+import jp.go.aist.rtm.rtcbuilder.generator.param.GeneratorParam;
+import jp.go.aist.rtm.rtcbuilder.generator.param.RtcParam;
+import jp.go.aist.rtm.rtcbuilder.generator.param.ServicePortInterfaceParam;
+import jp.go.aist.rtm.rtcbuilder.generator.param.ServicePortParam;
+
+public class CXXManipTest extends TestBase {
+
+ RtcParam rtcParam;
+ GeneratorParam genParam;
+
+ protected void setUp() throws Exception {
+ genParam = new GeneratorParam();
+ rtcParam = new RtcParam(genParam, true);
+ rtcParam.setOutputProject(rootPath + "/resource/work");
+ rtcParam.setLanguage(IRtcBuilderConstants.LANG_CPP);
+ rtcParam.setLanguageArg(IRtcBuilderConstants.LANG_CPP_ARG);
+ rtcParam.setRtmVersion("1.0.0");
+ rtcParam.setIsTest(true);
+ rtcParam.setEnableOldBuildEnv(true);
+ genParam.getRtcParams().add(rtcParam);
+ }
+
+ public void testArgStructModule() throws Exception {
+ rtcParam.setName("foo");
+ rtcParam.setDescription("ModuleDescription");
+ rtcParam.setVersion("1.0.0");
+ rtcParam.setVender("VenderName");
+ rtcParam.setCategory("Category");
+ rtcParam.setComponentType("UNIQUE");
+ rtcParam.setActivityType("EVENTDRIVEN");
+ rtcParam.setMaxInstance(0);
+ rtcParam.setComponentKind("DataFlowComponent");
+
+ ServicePortParam service1 = new ServicePortParam("sv_name", 0);
+ List<ServicePortInterfaceParam> srvinterts = new ArrayList<ServicePortInterfaceParam>();
+ ServicePortInterfaceParam int1 = new ServicePortInterfaceParam(service1, "if_name", "", "",
+ rootPath + "/resource/100/CXX/idlmodule/serviceArgStruct/MyServiceModuleTypeDef.idl", "MyService", "", 0);
+ srvinterts.add(int1);
+ service1.getServicePortInterfaces().addAll(srvinterts);
+ List<ServicePortParam> srvports = new ArrayList<ServicePortParam>();
+ srvports.add(service1);
+ rtcParam.getServicePorts().addAll(srvports);
+
+ Generator generator = new Generator();
+ List<GeneratedResult> result = generator.generateTemplateCode(genParam);
+
+ String resourceDir = rootPath + "/resource/100/CXX/idlmodule/serviceArgStruct/";
+
+ assertEquals(17, result.size());
+ checkCode(result, resourceDir, "fooComp.cpp");
+ checkCode(result, resourceDir, "foo.h");
+ checkCode(result, resourceDir, "foo.cpp");
+ checkCode(result, resourceDir, "MyServiceModuleTypeDefSVC_impl.h");
+ checkCode(result, resourceDir, "MyServiceModuleTypeDefSVC_impl.cpp");
+ }
+
+ public void testIDLType() throws Exception {
+ rtcParam.setName("ModuleName");
+ rtcParam.setDescription("ModuleDescription");
+ rtcParam.setVersion("1.0.0");
+ rtcParam.setVender("VenderName");
+ rtcParam.setCategory("Category");
+ rtcParam.setComponentType("STATIC");
+ rtcParam.setComponentKind("DataFlowComponent");
+ rtcParam.setActivityType("PERIODIC");
+ rtcParam.setExecutionRate(1.0);
+ rtcParam.setMaxInstance(1);
+
+ ServicePortParam service1 = new ServicePortParam("sV1",0);
+ List<ServicePortInterfaceParam> srvinterts = new ArrayList<ServicePortInterfaceParam>();
+ ServicePortInterfaceParam int1 = new ServicePortInterfaceParam(service1, "sIF1", "", "sIFv",
+ rootPath + "resource/100/CXX/idltype/IDLType1/TestIDL.idl", "ComFk", "", 0);
+ srvinterts.add(int1);
+ service1.getServicePortInterfaces().addAll(srvinterts);
+ List<ServicePortParam> srvports = new ArrayList<ServicePortParam>();
+ srvports.add(service1);
+
+ rtcParam.getServicePorts().addAll(srvports);
+ genParam.getRtcParams().add(rtcParam);
+
+ Generator generator = new Generator();
+ List<GeneratedResult> result = generator.generateTemplateCode(genParam);
+
+ String resourceDir = rootPath + "/resource/100/CXX/idltype/IDLType1/";
+
+ assertEquals(34, result.size());
+ checkCode(result, resourceDir, "ModuleNameComp.cpp");
+ checkCode(result, resourceDir, "ModuleName.h");
+ checkCode(result, resourceDir, "ModuleName.cpp");
+ checkCode(result, resourceDir, "TestIDLSVC_impl.h");
+ checkCode(result, resourceDir, "TestIDLSVC_impl.cpp");
+ }
+
+ public void testManip() throws Exception{
+ rtcParam.setName("ModuleName");
+ rtcParam.setDescription("ModuleDescription");
+ rtcParam.setVersion("1.0.0");
+ rtcParam.setVender("VenderName");
+ rtcParam.setCategory("Category");
+ rtcParam.setComponentType("STATIC");
+ rtcParam.setActivityType("PERIODIC");
+ rtcParam.setMaxInstance(1);
+ rtcParam.setExecutionRate(1000.0);;
+ rtcParam.setComponentKind("DataFlowComponent");
+
+ ServicePortParam service1 = new ServicePortParam("sv_name", 0);
+ List<ServicePortInterfaceParam> srvinterts = new ArrayList<ServicePortInterfaceParam>();
+ ServicePortInterfaceParam int1 = new ServicePortInterfaceParam(
+ service1, "if_name", "", "if_variable_name", rootPath + "/resource/100/CXX/Manip/ManipulatorCommonInterface_MiddleLevel.idl",
+ "ManipulatorCommonInterface_Middle", rootPath + "/resource/100/CXX/Manip", 0);
+ srvinterts.add(int1);
+ service1.getServicePortInterfaces().addAll(srvinterts);
+ List<ServicePortParam> srvports = new ArrayList<ServicePortParam>();
+ srvports.add(service1);
+ rtcParam.getServicePorts().addAll(srvports);
+
+ Generator generator = new Generator();
+ List<GeneratedResult> result = generator.generateTemplateCode(genParam);
+
+ String resourceDir = rootPath + "/resource/100/CXX/Manip/";
+
+ assertEquals(17, result.size());
+ checkCode(result, resourceDir, "ModuleNameComp.cpp");
+ checkCode(result, resourceDir, "ModuleName.h");
+ checkCode(result, resourceDir, "ModuleName.cpp");
+ checkCode(result, resourceDir, "ManipulatorCommonInterface_MiddleLevelSVC_impl.h");
+ checkCode(result, resourceDir, "ManipulatorCommonInterface_MiddleLevelSVC_impl.cpp");
+ }
+}
More information about the openrtm-commit
mailing list