Update of /cvsroot/robotflow/RobotFlow/MARIE/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21308 Modified Files: Makefile.am MarieCommandBehavior.cpp MarieCommandCamera.cpp MarieCommandJoystick.cpp MarieCommandMotor.cpp MarieDataBumper.cpp MarieDataCamera.cpp MarieDataIR.cpp MarieDataLaser.cpp MarieDataMap.cpp MarieDataOdometry.cpp MarieDataRaw.cpp MarieDataSonar.cpp MarieRequestSystem.cpp newMarieCommandCamera.cpp newMarieRequestSystem.cpp Added Files: extractMarieDataBumper.cpp extractMarieDataIR.cpp extractMarieDataRaw.cpp extractMarieRequestSystem.cpp newMarieDataBumper.cpp newMarieDataIR.cpp newMarieDataRaw.cpp Log Message: finished splitting objects, deprecated old nodes --- NEW FILE: extractMarieDataIR.cpp --- /* * MARIE - Mobile and Autonomous Robotics Integration Environment * Copyright (C) 2004 Dominic Letourneau / Carle Cote * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * You can contact MARIE development team at http://marie.sourceforge.net */ #include <sstream> #include <string> #include "MarieDataIR.h" #include "MarieXMLDataFactory.h" #include "Behavior.h" #include "Vector.h" #include "MarieDataNull.h" namespace marie { //forward declaration class extractMarieDataIR; DECLARE_NODE(extractMarieDataIR) /*Node * * @name extractMarieDataIR * @category RobotFlow:MARIE:DATA * @description Extract data in the FlowDesigner format from MarieDataIR * * @input_name DATA_IR * @input_type MarieDataIR * @input_description MarieDataIR object * * @output_name RANGES * @output_description Range contained in the MarieDataIR object * @output_type Vector<int> * END*/ using namespace std; class extractMarieDataIR : public BufferedNode { private: //intputs int m_dataIRID; //outputs int m_rangesID; public: extractMarieDataIR(string nodeName, ParameterSet params) : BufferedNode(nodeName,params) { //inputs m_dataIRID = addInput("DATA_IR"); //outputs m_rangesID = addInput("RANGES"); } void calculate(int output_id, int count, Buffer &out) { try { //get input RCPtr<MarieDataIR> data = getInput(m_dataIRID,count); unsigned int size = data->getNbIR(); const unsigned int *ranges = data->getRanges(); //copy range data into a vector Vector<int> *vect = Vector<int>::alloc(size); for (unsigned int i = 0; i < size; i++) { (*vect)[i] = (int) ranges[i]; } //output vector out[count] = ObjectRef(vect); } catch (BaseException *e) { e->print(cerr); e->add(new GeneralException("Unable to process",__FILE__,__LINE__)); throw e; } } };//class extractMarieDataIR }//namespace marie --- NEW FILE: extractMarieDataBumper.cpp --- /* * MARIE - Mobile and Autonomous Robotics Integration Environment * Copyright (C) 2004 Dominic Letourneau / Carle Cote * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * You can contact MARIE development team at http://marie.sourceforge.net */ #include <sstream> #include <string> #include "MarieDataBumper.h" #include "MarieXMLDataFactory.h" #include "Behavior.h" #include "Vector.h" #include "MarieDataNull.h" namespace marie { //forward declaration class extractMarieDataBumper; DECLARE_NODE(extractMarieDataBumper) /*Node * * @name extractMarieDataBumper * @category RobotFlow:MARIE:DATA * @description Extract data in the FlowDesigner format from MarieDataBumper * * @input_name DATA_BUMPER * @input_type Input MarieDataBumper * @input_description input DataBumper, nilObject if not used * * @output_name NBBUMPERS * @output_type int * @output_description output nb buttons, nilObject if not used * * @output_name BUMPERSTATE * @output_type int * @output_description output bumper state, nilObject if not used * END*/ using namespace std; class extractMarieDataBumper : public BufferedNode { private: //inputs int m_dataBumperInID; //outputs int m_nbBumpersOutID; int m_bumperStateOutID; public: extractMarieDataBumper(string nodeName, ParameterSet params) : BufferedNode(nodeName,params) { //inputs m_dataBumperInID = addInput("DATA_BUMPER"); //outputs m_nbBumpersOutID = addOutput("NBBUMPERS"); m_bumperStateOutID = addOutput("BUMPERSTATE"); } void calculate(int output_id, int count, Buffer &out) { try { //get input RCPtr<MarieDataBumper> data = getInput(m_dataBumperInID,count); //output data (*outputs[m_nbBumpersOutID].buffer)[count] = ObjectRef(Int::alloc(data->getNbBumpers())); (*outputs[m_bumperStateOutID].buffer)[count] = ObjectRef(Int::alloc(data->getBumperState())); } catch (BaseException *e) { e->print(cerr); e->add(new GeneralException("Unable to process",__FILE__,__LINE__)); throw e; } } };//class extractMarieDataBumper }//namespace marie Index: MarieDataSonar.cpp =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/MARIE/src/MarieDataSonar.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MarieDataSonar.cpp 10 Jun 2004 20:47:53 -0000 1.3 --- MarieDataSonar.cpp 29 Oct 2004 14:07:20 -0000 1.4 *************** *** 31,35 **** * * @name MarieDataSonar ! * @category RobotFlow:MARIE:DATA * @description Save an object * --- 31,35 ---- * * @name MarieDataSonar ! * @category RobotFlow:MARIE:zdeprecated * @description Save an object * Index: MarieCommandBehavior.cpp =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/MARIE/src/MarieCommandBehavior.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MarieCommandBehavior.cpp 31 May 2004 14:10:09 -0000 1.2 --- MarieCommandBehavior.cpp 29 Oct 2004 14:07:20 -0000 1.3 *************** *** 33,37 **** * * @name MarieCommandBehavior ! * @category RobotFlow:MARIE:COMMAND * @description Save an object * --- 33,37 ---- * * @name MarieCommandBehavior ! * @category RobotFlow:MARIE:zdeprecated * @description Save an object * Index: MarieDataOdometry.cpp =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/MARIE/src/MarieDataOdometry.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MarieDataOdometry.cpp 10 Jun 2004 20:47:53 -0000 1.3 --- MarieDataOdometry.cpp 29 Oct 2004 14:07:20 -0000 1.4 *************** *** 30,34 **** * * @name MarieDataOdometry ! * @category RobotFlow:MARIE:DATA * @description Read content of MarieDataOdometry * --- 30,34 ---- * * @name MarieDataOdometry ! * @category RobotFlow:MARIE:zdeprecated * @description Read content of MarieDataOdometry * Index: MarieDataCamera.cpp =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/MARIE/src/MarieDataCamera.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MarieDataCamera.cpp 10 Jun 2004 20:47:53 -0000 1.3 --- MarieDataCamera.cpp 29 Oct 2004 14:07:20 -0000 1.4 *************** *** 31,35 **** * * @name MarieDataCamera ! * @category RobotFlow:MARIE:DATA * @description Save an object * --- 31,35 ---- * * @name MarieDataCamera ! * @category RobotFlow:MARIE:zdeprecated * @description Save an object * Index: MarieCommandJoystick.cpp =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/MARIE/src/MarieCommandJoystick.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MarieCommandJoystick.cpp 4 Aug 2004 17:49:50 -0000 1.2 --- MarieCommandJoystick.cpp 29 Oct 2004 14:07:20 -0000 1.3 *************** *** 31,35 **** * * @name MarieCommandJoystick ! * @category RobotFlow:MARIE:COMMAND * @description Read & Create MarieCommandJoystick data object * --- 31,35 ---- * * @name MarieCommandJoystick ! * @category RobotFlow:MARIE:zdeprecated * @description Read & Create MarieCommandJoystick data object * --- NEW FILE: extractMarieRequestSystem.cpp --- /* * MARIE - Mobile and Autonomous Robotics Integration Environment * Copyright (C) 2004 Dominic Letourneau * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * You can contact MARIE development team at http://marie.sourceforge.net */ #include "MarieRequestSystem.h" #include <sstream> #include <string> namespace marie { class extractMarieRequestSystem; DECLARE_NODE(extractMarieRequestSystem) /*Node * * @name extractMarieRequestSystem * @category RobotFlow:MARIE:REQUEST * @description Extract MARIE request system information * * @input_name REQUEST_SYSTEM * @input_type MarieRequestSystem * @input_description MarieRequestSystem Object * * @output_name COMMAND * @output_description Command stored in the Request System * @output_type string * * @output_name DATA * @output_description Data stored in the Request System * @output_type string * * @output_name REQUEST_ID * @output_description Request ID stored in the Request System * @output_type int * * @output_name STATE * @output_description State stored in the Request System * @output_type string * END*/ using namespace std; class extractMarieRequestSystem : public BufferedNode { private: //inputs int m_requestSystemID; //outputs int m_commandID; int m_dataID; int m_requestIDID; int m_stateID; public: extractMarieRequestSystem(string nodeName, ParameterSet params) : BufferedNode(nodeName,params) { //inputs m_requestSystemID = addInput("REQUEST_SYSTEM"); //outputs m_commandID = addOutput("COMMAND"); m_dataID = addOutput("DATA"); m_requestIDID = addOutput("REQUEST_ID"); m_stateID = addOutput("STATE"); } void calculate(int output_id, int count, Buffer &out) { try { //get input RCPtr<MarieRequestSystem> request = getInput(m_requestSystemID,count); (*outputs[m_commandID].buffer)[count] = ObjectRef(new String(request->getCommand())); (*outputs[m_dataID].buffer)[count] = ObjectRef(new String(request->getData())); (*outputs[m_requestIDID].buffer)[count] = ObjectRef(Int::alloc(request->getID())); (*outputs[m_stateID].buffer)[count] = ObjectRef(new String(request->getState())); } catch (BaseException *e) { e->print(cerr); e->add(new GeneralException("Unable to process",__FILE__,__LINE__)); throw e; } } };//class extractMarieRequestSystem }//namespace marie Index: MarieDataBumper.cpp =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/MARIE/src/MarieDataBumper.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MarieDataBumper.cpp 4 Aug 2004 17:49:50 -0000 1.1 --- MarieDataBumper.cpp 29 Oct 2004 14:07:20 -0000 1.2 *************** *** 31,35 **** * * @name MarieDataBumper ! * @category RobotFlow:MARIE:DATA * @description Read & Create MarieDataBumper data object * --- 31,35 ---- * * @name MarieDataBumper ! * @category RobotFlow:MARIE:zdeprecated * @description Read & Create MarieDataBumper data object * --- NEW FILE: newMarieDataBumper.cpp --- /* * MARIE - Mobile and Autonomous Robotics Integration Environment * Copyright (C) 2004 Dominic Letourneau / Carle Cote * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * You can contact MARIE development team at http://marie.sourceforge.net */ #include <sstream> #include <string> #include "MarieDataBumper.h" #include "MarieXMLDataFactory.h" #include "Behavior.h" #include "Vector.h" #include "MarieDataNull.h" namespace marie { //forward declaration class newMarieDataBumper; DECLARE_NODE(newMarieDataBumper) /*Node * * @name newMarieDataBumper * @category RobotFlow:MARIE:DATA * @description Create an object of type MarieDataBumper * * @input_name NBBUMPERS * @input_type int * @input_description input nb buttons, nilObject if not used * * @input_name BUMPERSTATE * @input_type int * @input_description input bumper state, nilObject if not used * * @output_name DATA_BUMPER * @output_type MarieDataBumper * @output_description Output DataBumper * END*/ using namespace std; class newMarieDataBumper : public BufferedNode { private: //inputs int m_nbBumpersInID; int m_bumperStateInID; //outputs int m_dataBumperOutID; public: newMarieDataBumper(string nodeName, ParameterSet params) : BufferedNode(nodeName,params) { //inputs m_nbBumpersInID = addInput("NBBUMPERS"); m_bumperStateInID = addInput("BUMPERSTATE"); //outputs m_dataBumperOutID = addOutput("DATA_BUMPER"); } void calculate(int output_id, int count, Buffer &out) { try { RCPtr<Int> nbBumpers = getInput(m_nbBumpersInID,count); RCPtr<Int> bumperState = getInput(m_bumperStateInID,count); MarieDataBumper *data = new MarieDataBumper(); //set the data data->setNbBumpers(*nbBumpers); data->setBumperState(*bumperState); //output object out[count] = ObjectRef(data); } catch (BaseException *e) { e->print(cerr); e->add(new GeneralException("Unable to process",__FILE__,__LINE__)); throw e; } } };//class newMarieDataBumper }//namespace marie Index: newMarieRequestSystem.cpp =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/MARIE/src/newMarieRequestSystem.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** newMarieRequestSystem.cpp 22 Sep 2004 20:45:55 -0000 1.3 --- newMarieRequestSystem.cpp 29 Oct 2004 14:07:20 -0000 1.4 *************** *** 31,35 **** * * @name newMarieRequestSystem ! * @category RobotFlow:MARIE:DATA * @description Create MARIE request system * --- 31,35 ---- * * @name newMarieRequestSystem ! * @category RobotFlow:MARIE:REQUEST * @description Create MARIE request system * *************** *** 86,122 **** void calculate(int output_id, int count, Buffer &out) { ! ! ObjectRef commandValue = getInput(m_commandID,count); ! ObjectRef dataValue = getInput(m_dataID,count); ! ObjectRef requestIDValue = getInput(m_requestIDID,count); ! ObjectRef stateValue = getInput(m_stateID,count); ! ! if (!commandValue->isNil() && ! !dataValue->isNil() && ! !requestIDValue->isNil() && ! !stateValue->isNil()) ! { ! MarieRequestSystem *request = new MarieRequestSystem(); ! ! RCPtr<String> commandString = commandValue; ! RCPtr<String> dataString = dataValue; ! RCPtr<Int> requestID = requestIDValue; ! RCPtr<String> stateString = stateValue; ! ! request->setCommand(*commandString); ! request->setData(*dataString); ! request->setID(*requestID); ! request->setState(*stateString); ! ! out[count] = ObjectRef(request); ! } ! else { ! out[count] = nilObject; } ! } ! };//class newMarieRequestSystem }//namespace marie --- 86,127 ---- void calculate(int output_id, int count, Buffer &out) { ! try { ! ObjectRef commandValue = getInput(m_commandID,count); ! ObjectRef dataValue = getInput(m_dataID,count); ! ObjectRef requestIDValue = getInput(m_requestIDID,count); ! ObjectRef stateValue = getInput(m_stateID,count); ! if (!commandValue->isNil() && ! !dataValue->isNil() && ! !requestIDValue->isNil() && ! !stateValue->isNil()) ! { ! ! MarieRequestSystem *request = new MarieRequestSystem(); ! ! RCPtr<String> commandString = commandValue; ! RCPtr<String> dataString = dataValue; ! RCPtr<Int> requestID = requestIDValue; ! RCPtr<String> stateString = stateValue; ! ! request->setCommand(*commandString); ! request->setData(*dataString); ! request->setID(*requestID); ! request->setState(*stateString); ! ! out[count] = ObjectRef(request); ! ! } ! else ! { ! out[count] = nilObject; ! } } ! catch(BaseException *e) { ! e->print(cerr); ! throw e->add(new GeneralException("",__FILE__,__LINE__)); } ! } };//class newMarieRequestSystem }//namespace marie Index: MarieDataIR.cpp =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/MARIE/src/MarieDataIR.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MarieDataIR.cpp 4 Aug 2004 17:49:50 -0000 1.1 --- MarieDataIR.cpp 29 Oct 2004 14:07:20 -0000 1.2 *************** *** 32,36 **** * * @name MarieDataIR ! * @category RobotFlow:MARIE:DATA * @description Save an object * --- 32,36 ---- * * @name MarieDataIR ! * @category RobotFlow:MARIE:zdeprecated * @description Save an object * --- NEW FILE: newMarieDataIR.cpp --- /* * MARIE - Mobile and Autonomous Robotics Integration Environment * Copyright (C) 2004 Dominic Letourneau / Carle Cote * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * You can contact MARIE development team at http://marie.sourceforge.net */ #include <sstream> #include <string> #include "MarieDataIR.h" #include "MarieXMLDataFactory.h" #include "Behavior.h" #include "Vector.h" #include "MarieDataNull.h" namespace marie { //forward declaration class newMarieDataIR; DECLARE_NODE(newMarieDataIR) /*Node * * @name newMarieDataIR * @category RobotFlow:MARIE:DATA * @description Create an object of type MarieDataIR * * @input_name RANGES * @input_description Range to be transformed into a MarieDataIR object * @input_type Vector<int> * * @output_name DATA_IR * @output_type MarieDataIR * @output_description MarieDataIR object * END*/ using namespace std; class newMarieDataIR : public BufferedNode { private: //inputs int m_rangesID; //outputs int m_dataIRID; public: newMarieDataIR(string nodeName, ParameterSet params) : BufferedNode(nodeName,params) { //inputs m_rangesID = addInput("RANGES"); //outputs m_dataIRID = addOutput("DATA_IR"); } void calculate(int output_id, int count, Buffer &out) { try { RCPtr<Vector<int> > ranges = getInput(m_rangesID,count); MarieDataIR *data = new MarieDataIR(); data->setNbIR(ranges->size()); if (ranges->size() > 0) { data->setRanges((unsigned int*) &(*ranges)[0]); } //output result out[count] = ObjectRef(data); } catch (BaseException *e) { e->print(cerr); e->add(new GeneralException("Unable to process",__FILE__,__LINE__)); throw e; } } };//class newMarieDataIR }//namespace marie Index: newMarieCommandCamera.cpp =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/MARIE/src/newMarieCommandCamera.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** newMarieCommandCamera.cpp 28 Oct 2004 15:03:30 -0000 1.1 --- newMarieCommandCamera.cpp 29 Oct 2004 14:07:20 -0000 1.2 *************** *** 32,36 **** * * @name newMarieCommandCamera ! * @category RobotFlow:MARIE:DATA * @description Create MARIE DataCamera object * --- 32,36 ---- * * @name newMarieCommandCamera ! * @category RobotFlow:MARIE:COMMAND * @description Create MARIE DataCamera object * --- NEW FILE: newMarieDataRaw.cpp --- /* * MARIE - Mobile and Autonomous Robotics Integration Environment * Copyright (C) 2004 Dominic Letourneau / Carle Cote * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * You can contact MARIE development team at http://marie.sourceforge.net */ #include <sstream> #include <string> #include "MarieDataRaw.h" #include "MarieXMLDataFactory.h" #include "Behavior.h" #include "Vector.h" #include "MarieDataNull.h" namespace marie { //forward declaration class newMarieDataRaw; DECLARE_NODE(newMarieDataRaw) /*Node * * @name newMarieDataRaw * @category RobotFlow:MARIE:DATA * @description Create an object of type MarieDataRaw * * @input_name OBJREF * @input_type MarieDataRaw * @input_description MarieDataRaw object * * @input_name CUSTOM_ID * @input_type MarieDataRaw * @input_description MarieDataRaw object * * @output_name DATA_RAW * @output_description Range contained in the MarieDataRaw object * @output_type MarieDataRaw * END*/ using namespace std; class newMarieDataRaw : public BufferedNode { private: //inputs int m_objRefInID; int m_customIDInID; //outputs int m_rawMarieOutID; public: newMarieDataRaw(string nodeName, ParameterSet params) : BufferedNode(nodeName,params) { //inputs m_objRefInID = addInput("OBJREF"); m_customIDInID = addInput("CUSTOM_ID"); //outputs m_rawMarieOutID = addOutput("DATA_RAW"); } void calculate(int output_id, int count, Buffer &out) { try { ObjectRef inputObject = getInput(m_objRefInID,count); RCPtr<String> customID = getInput(m_customIDInID,count); //output object in a temporary stream MarieDataRaw *dataRaw = new MarieDataRaw(); ostringstream tempStr; //printOn on the stream tempStr << inputObject; dataRaw->setRawData(tempStr.str()); dataRaw->setCustomID(*customID); //output result out[count] = ObjectRef(dataRaw); } catch (BaseException *e) { e->print(cerr); e->add(new GeneralException("Unable to process",__FILE__,__LINE__)); throw e; } } };//class newMarieDataRaw }//namespace marie Index: MarieCommandCamera.cpp =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/MARIE/src/MarieCommandCamera.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MarieCommandCamera.cpp 31 Aug 2004 17:30:24 -0000 1.6 --- MarieCommandCamera.cpp 29 Oct 2004 14:07:20 -0000 1.7 *************** *** 32,36 **** * * @name MarieCommandCamera ! * @category RobotFlow:MARIE:COMMAND * @description Read & Create MarieCommandCamera data object * --- 32,36 ---- * * @name MarieCommandCamera ! * @category RobotFlow:MARIE:zdeprecated * @description Read & Create MarieCommandCamera data object * --- NEW FILE: extractMarieDataRaw.cpp --- /* * MARIE - Mobile and Autonomous Robotics Integration Environment * Copyright (C) 2004 Dominic Letourneau / Carle Cote * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * You can contact MARIE development team at http://marie.sourceforge.net */ #include <sstream> #include <string> #include "MarieDataRaw.h" #include "MarieXMLDataFactory.h" #include "Behavior.h" #include "Vector.h" #include "MarieDataNull.h" namespace marie { //forward declaration class extractMarieDataRaw; DECLARE_NODE(extractMarieDataRaw) /*Node * * @name extractMarieDataRaw * @category RobotFlow:MARIE:DATA * @description Extract data in the FlowDesigner format from MarieDataRaw * * @input_name DATA_RAW * @input_type MarieDataRaw * @input_description MarieDataRaw object * * @output_name OBJREF * @output_description Range contained in the MarieDataRaw object * @output_type any * * @output_name DATA_RAW * @output_description Range contained in the MarieDataRaw object * @output_type MarieDataRaw * * @output_name CUSTOM_ID * @output_description Range contained in the MarieDataRaw object * @output_type string * END*/ using namespace std; class extractMarieDataRaw : public BufferedNode { private: //intputs int m_dataRawID; //outputs int m_objRefOutID; int m_customIDOutID; public: extractMarieDataRaw(string nodeName, ParameterSet params) : BufferedNode(nodeName,params) { //inputs m_dataRawID = addInput("DATA_RAW"); //outputs m_objRefOutID = addOutput("OBJREF"); m_customIDOutID = addOutput("CUSTOM_ID"); } void calculate(int output_id, int count, Buffer &out) { try { //get input RCPtr<MarieDataRaw> data = getInput(m_dataRawID,count); ObjectRef objRefOutValue = nilObject; //read raw data (FlowDesigner object) try { stringstream tempStr(data->getRawData()); tempStr >> objRefOutValue; } catch(BaseException *e) { e->print(cerr); delete e; objRefOutValue = nilObject; } //Output result (*outputs[m_objRefOutID].buffer)[count] = objRefOutValue; (*outputs[m_customIDOutID].buffer)[count] = ObjectRef(new String(data->getCustomID())); } catch (BaseException *e) { e->print(cerr); e->add(new GeneralException("Unable to process",__FILE__,__LINE__)); throw e; } } };//class extractMarieDataRaw }//namespace marie Index: Makefile.am =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/MARIE/src/Makefile.am,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Makefile.am 28 Oct 2004 20:30:07 -0000 1.21 --- Makefile.am 29 Oct 2004 14:07:19 -0000 1.22 *************** *** 31,34 **** --- 31,37 ---- newMarieDataCamera.cpp \ newMarieDataOdometry.cpp \ + newMarieDataRaw.cpp \ + newMarieDataIR.cpp \ + newMarieDataBumper.cpp \ newMarieDataMap.cpp \ newMarieRequestSystem.cpp \ *************** *** 37,49 **** newMarieCommandMotor.cpp \ newMarieCommandJoystick.cpp \ - extractMarieCommandBehavior.cpp \ - extractMarieCommandCamera.cpp \ - extractMarieCommandMotor.cpp \ - extractMarieCommandJoystick.cpp \ extractMarieDataLaser.cpp \ extractMarieDataSonar.cpp \ extractMarieDataCamera.cpp \ extractMarieDataOdometry.cpp \ ! extractMarieDataMap.cpp install-data-local: --- 40,56 ---- newMarieCommandMotor.cpp \ newMarieCommandJoystick.cpp \ extractMarieDataLaser.cpp \ extractMarieDataSonar.cpp \ extractMarieDataCamera.cpp \ extractMarieDataOdometry.cpp \ ! extractMarieDataRaw.cpp \ ! extractMarieDataIR.cpp \ ! extractMarieDataBumper.cpp \ ! extractMarieDataMap.cpp \ ! extractMarieRequestSystem.cpp \ ! extractMarieCommandBehavior.cpp \ ! extractMarieCommandCamera.cpp \ ! extractMarieCommandMotor.cpp \ ! extractMarieCommandJoystick.cpp install-data-local: Index: MarieCommandMotor.cpp =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/MARIE/src/MarieCommandMotor.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MarieCommandMotor.cpp 17 Jun 2004 17:37:30 -0000 1.4 --- MarieCommandMotor.cpp 29 Oct 2004 14:07:20 -0000 1.5 *************** *** 31,35 **** * * @name MarieCommandMotor ! * @category RobotFlow:MARIE:COMMAND * @description Save an object * --- 31,35 ---- * * @name MarieCommandMotor ! * @category RobotFlow:MARIE:zdeprecated * @description Save an object * Index: MarieDataMap.cpp =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/MARIE/src/MarieDataMap.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MarieDataMap.cpp 22 Sep 2004 13:55:53 -0000 1.1 --- MarieDataMap.cpp 29 Oct 2004 14:07:20 -0000 1.2 *************** *** 32,36 **** * * @name MarieDataMap ! * @category RobotFlow:MARIE:DATA * @description Read MARIE data maps * --- 32,36 ---- * * @name MarieDataMap ! * @category RobotFlow:MARIE:zdeprecated * @description Read MARIE data maps * Index: MarieDataRaw.cpp =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/MARIE/src/MarieDataRaw.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MarieDataRaw.cpp 11 Aug 2004 15:04:08 -0000 1.3 --- MarieDataRaw.cpp 29 Oct 2004 14:07:20 -0000 1.4 *************** *** 32,36 **** * * @name MarieDataRaw ! * @category RobotFlow:MARIE:DATA * @description Save an object * --- 32,36 ---- * * @name MarieDataRaw ! * @category RobotFlow:MARIE:zdeprecated * @description Save an object * Index: MarieDataLaser.cpp =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/MARIE/src/MarieDataLaser.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MarieDataLaser.cpp 10 Jun 2004 20:47:53 -0000 1.4 --- MarieDataLaser.cpp 29 Oct 2004 14:07:20 -0000 1.5 *************** *** 32,36 **** * * @name MarieDataLaser ! * @category RobotFlow:MARIE:DATA * @description Save an object * --- 32,36 ---- * * @name MarieDataLaser ! * @category RobotFlow:MARIE:zdeprecated * @description Save an object * Index: MarieRequestSystem.cpp =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/MARIE/src/MarieRequestSystem.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MarieRequestSystem.cpp 22 Sep 2004 19:47:07 -0000 1.1 --- MarieRequestSystem.cpp 29 Oct 2004 14:07:20 -0000 1.2 *************** *** 31,35 **** * * @name MarieRequestSystem ! * @category RobotFlow:MARIE:DATA * @description Load an object of RequestSystem type * --- 31,35 ---- * * @name MarieRequestSystem ! * @category RobotFlow:MARIE:zdeprecated * @description Load an object of RequestSystem type * |