33 BCAPService_Ptr service = boost::make_shared<bcap_service::BCAPService>();
34 service->parseParams();
37 service->put_Type(
"udp");
40 service->put_Type(
"tcp");
64 ret = xmlDoc.
LoadFile(filename.c_str());
71 if(xmlCtrl == NULL)
return E_FAIL;
77 if(xmlRob == NULL)
return E_FAIL;
83 if(xmlTsk == NULL)
return E_FAIL;
92 DensoRobot_Vec::iterator itRob;
97 (*itRob)->StartService(node);
100 DensoTask_Vec::iterator itTsk;
105 (*itTsk)->StartService(node);
108 DensoVariable_Vec::iterator itVar;
113 (*itVar)->StartService(node);
127 DensoRobot_Vec::iterator itRob;
132 (*itRob)->StopService();
135 DensoTask_Vec::iterator itTsk;
140 (*itTsk)->StopService();
143 DensoVariable_Vec::iterator itVar;
148 (*itVar)->StopService();
156 boost::mutex::scoped_lock lockSrv(
m_mtxSrv);
159 DensoRobot_Vec::iterator itRob;
167 DensoTask_Vec::iterator itTsk;
175 DensoVariable_Vec::iterator itVar;
198 *robot = boost::dynamic_pointer_cast<
DensoRobot>(pBase);
216 *task = boost::dynamic_pointer_cast<
DensoTask>(pBase);
248 for(objs = 0; objs < vecName.size(); objs++) {
257 hr = tsk->InitializeBCAP(xmlElem);
virtual HRESULT AddRobot(XMLElement *xmlElem)=0
const XMLElement * FirstChildElement(const char *name=0) const
virtual HRESULT InitializeBCAP()
XMLError LoadFile(const char *filename)
HRESULT AddVariable(int32_t get_id, const std::string &name, std::vector< boost::shared_ptr< class DensoVariable > > &vecVar, int16_t vt=VT_EMPTY, bool bRead=false, bool bWrite=false, bool bID=false, int iDuration=BCAP_VAR_DEFAULT_DURATION)
const XMLElement * NextSiblingElement(const char *name=0) const
Get the next (right) sibling element of this node, with an optionally supplied name.
virtual HRESULT StartService(ros::NodeHandle &node)
DensoRobot_Vec m_vecRobot
std::vector< uint32_t > Handle_Vec
HRESULT GetObjectNames(int32_t func_id, Name_Vec &vecName)
DensoVariable_Vec m_vecVar
HRESULT get_Robot(int index, DensoRobot_Ptr *robot)
virtual HRESULT StopService()
virtual HRESULT AddTask(XMLElement *xmlElem)
HRESULT get_Object(const std::vector< boost::shared_ptr< DensoBase > > &vecBase, int index, boost::shared_ptr< DensoBase > *obj)
#define ID_CONTROLLER_GETTASKNAMES
HRESULT get_Task(const std::string &name, DensoTask_Ptr *task)
std::vector< std::string > Name_Vec
virtual HRESULT AddController()=0
#define XML_VARIABLE_NAME
#define ID_CONTROLLER_GETTASK
virtual ~DensoController()
std::vector< DensoBase_Ptr > DensoBase_Vec
HRESULT get_Variable(const std::string &name, DensoVariable_Ptr *var)
HRESULT AddObject(int32_t get_id, const std::string &name, Handle_Vec &vecHandle)
HRESULT AddVariable(const std::string &name)
DensoController(const std::string &name, const int *mode)
#define ID_CONTROLLER_GETVARIABLE