From: Dominic L?t. <ma...@us...> - 2004-05-27 00:27:57
|
Update of /cvsroot/robotflow/RobotFlow/Player/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30362/Player/src Modified Files: Makefile.am PlayerConnect.cc PlayerGPS.cc PlayerGripper.cc PlayerLaser.cc PlayerPTZ.cc PlayerVelocity.cc Log Message: watch out, a lot of things have been modified in the installation structure, Player and librairies Index: PlayerConnect.cc =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/Player/src/PlayerConnect.cc,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PlayerConnect.cc 3 Dec 2003 14:04:31 -0000 1.15 --- PlayerConnect.cc 27 May 2004 00:27:39 -0000 1.16 *************** *** 85,88 **** --- 85,93 ---- * @parameter_description Start GPS proxy if it's true. * + * @parameter_name LASER2_PROXY + * @parameter_type bool + * @parameter_value true + * @parameter_description Start laser proxy if it's true. + * END*/ *************** *** 108,111 **** --- 113,117 ---- m_startBlobFinderProxy = dereference_cast<bool>(parameters.get("BLOB_FINDER_PROXY")); m_startGPSProxy = dereference_cast<bool>(parameters.get("GPS_PROXY")); + m_startLaser2Proxy = dereference_cast<bool>(parameters.get("LASER2_PROXY")); } *************** *** 126,130 **** { //connecting to server ! m_client = ObjectRef(new PlayerClientWrap(m_host.c_str(),m_port, m_startPositionProxy, m_startGripperProxy, --- 132,136 ---- { //connecting to server ! m_client = ObjectRef(new PlayerClientWrap(m_host.c_str(),m_port, m_startPositionProxy, m_startGripperProxy, *************** *** 133,137 **** m_startSonarProxy, m_startBlobFinderProxy, ! m_startGPSProxy)); // initialize robot if position proxy enabled --- 139,144 ---- m_startSonarProxy, m_startBlobFinderProxy, ! m_startGPSProxy, ! m_startLaser2Proxy)); // initialize robot if position proxy enabled Index: PlayerLaser.cc =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/Player/src/PlayerLaser.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PlayerLaser.cc 9 Jul 2003 14:25:14 -0000 1.5 --- PlayerLaser.cc 27 May 2004 00:27:39 -0000 1.6 *************** *** 45,48 **** --- 45,53 ---- * @output_description The Intensity of the laser beam. * + * @parameter_name LASER2_PROXY + * @parameter_type bool + * @parameter_value false + * @parameter_description Start laser proxy if it's true. + * END*/ *************** *** 53,61 **** int m_intensityID; LaserProxy *m_laserProxy; public: PlayerLaser(string nodeName, ParameterSet params) ! : BufferedNode(nodeName, params), m_laserProxy(NULL) { //inputs --- 58,67 ---- int m_intensityID; LaserProxy *m_laserProxy; + bool m_isLaser2; public: PlayerLaser(string nodeName, ParameterSet params) ! : BufferedNode(nodeName, params), m_laserProxy(NULL), m_isLaser2(false) { //inputs *************** *** 67,70 **** --- 73,77 ---- m_intensityID = addOutput("INTENSITY"); + m_isLaser2 = dereference_cast<bool>(parameters.get("LASER2_PROXY")); } *************** *** 82,87 **** ObjectRef ClientValue = getInput(m_clientID,count); ! m_laserProxy = object_cast<PlayerClientWrap>(ClientValue).getLaserProxy(); ! if (m_laserProxy == NULL) { throw new GeneralException("PlayerLaser::calculate NULL laser proxy",__FILE__,__LINE__); --- 89,101 ---- ObjectRef ClientValue = getInput(m_clientID,count); ! if (m_isLaser2 == false) ! { ! m_laserProxy = object_cast<PlayerClientWrap>(ClientValue).getLaserProxy(); ! } ! else ! { ! m_laserProxy = object_cast<PlayerClientWrap>(ClientValue).getLaser2Proxy(); ! } ! if (m_laserProxy == NULL) { throw new GeneralException("PlayerLaser::calculate NULL laser proxy",__FILE__,__LINE__); Index: PlayerGPS.cc =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/Player/src/PlayerGPS.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PlayerGPS.cc 9 Jul 2003 14:25:14 -0000 1.5 --- PlayerGPS.cc 27 May 2004 00:27:39 -0000 1.6 *************** *** 31,35 **** * @name PlayerGPS * @category RobotFlow:Player ! * @description No description available * * @input_name CLIENT --- 31,35 ---- * @name PlayerGPS * @category RobotFlow:Player ! * @description The GPS interface provides access to an absolute position system, such as GPS. * * @input_name CLIENT *************** *** 37,51 **** * @input_description The player client to read data from. * ! * @output_name X ! * @output_type int ! * @output_description GPS X position (absolute) * ! * @output_name Y * @output_type int ! * @output_description GPS Y position (absolute) * ! * @output_name HEADING * @output_type int ! * @output_description Robot heading (absolute) * END*/ --- 37,59 ---- * @input_description The player client to read data from. * ! * @output_name LATITUDE ! * @output_type float ! * @output_description Latitude, in 1/60 of an arc-second. Positive is north of equator, negarive is south of equator. * ! * @output_name LONGITUDE ! * @output_type float ! * @output_description Longitude, in 1/60 of an arc-second. Positive is east of prime meridian, negative is west of prime meridian. ! * ! * @output_name ALTITUDE ! * @output_type float ! * @output_description Altitude, in millimeters. Positive is above reference (e.g., sea-level), and negative is below. ! * ! * @output_name QUALITY * @output_type int ! * @output_description Quality of fix 0 = invalid, 1 = FPS fix, 2 = DGPS fix. * ! * @output_name NUMBER_OF_SATELLITES * @output_type int ! * @output_description Number of satellites in view. * END*/ *************** *** 54,60 **** int m_clientID; ! int m_XID; ! int m_YID; ! int m_HeadingID; GpsProxy *m_gpsProxy; --- 62,70 ---- int m_clientID; ! int m_latitudeID; ! int m_longitudeID; ! int m_altitudeID; ! int m_qualityID; ! int m_numSatsID; GpsProxy *m_gpsProxy; *************** *** 69,75 **** //outputs ! m_XID = addOutput("X"); ! m_YID = addOutput("Y"); ! m_HeadingID = addOutput("HEADING"); } --- 79,87 ---- //outputs ! m_latitudeID = addOutput("LATITUDE"); ! m_longitudeID = addOutput("LONGITUDE"); ! m_altitudeID = addOutput("ALTITUDE"); ! m_qualityID = addOutput("QUALITY"); ! m_numSatsID = addOutput("NUMBER_OF_SATELLITES"); } *************** *** 94,101 **** } ! //output current position ! (*outputs[m_XID].buffer)[count] = ObjectRef(Int::alloc(m_gpsProxy->xpos)); ! (*outputs[m_YID].buffer)[count] = ObjectRef(Int::alloc(m_gpsProxy->ypos)); ! (*outputs[m_HeadingID].buffer)[count] = ObjectRef(Int::alloc(m_gpsProxy->heading)); } --- 106,116 ---- } ! //output GPS informations ! (*outputs[m_latitudeID].buffer)[count] = ObjectRef(Float::alloc(m_gpsProxy->latitude)); ! (*outputs[m_longitudeID].buffer)[count] = ObjectRef(Float::alloc(m_gpsProxy->longitude)); ! (*outputs[m_altitudeID].buffer)[count] = ObjectRef(Float::alloc(m_gpsProxy->altitude)); ! (*outputs[m_qualityID].buffer)[count] = ObjectRef(Int::alloc(m_gpsProxy->quality)); ! (*outputs[m_numSatsID].buffer)[count] = ObjectRef(Int::alloc(m_gpsProxy->satellites)); ! } Index: PlayerPTZ.cc =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/Player/src/PlayerPTZ.cc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PlayerPTZ.cc 4 Dec 2003 18:48:40 -0000 1.7 --- PlayerPTZ.cc 27 May 2004 00:27:39 -0000 1.8 *************** *** 60,63 **** --- 60,73 ---- * @input_description The relative zoom command. 0->1023. (0 = wide, 1023 = telephoto). * + * @parameter_name PAN_SPEED + * @parameter_type int + * @parameter_value 24 + * @parameter_description Pan speed 0-24 + * + * @parameter_name TILT_SPEED + * @parameter_type int + * @parameter_value 20 + * @parameter_description Tilt speed 0-20 + * * @output_name PAN * @output_type int *************** *** 77,81 **** { ! //intputs int m_clientID; int m_relPanID; --- 87,91 ---- { ! // inputs int m_clientID; int m_relPanID; *************** *** 86,90 **** int m_absZoomID; ! //outputs int m_panOutID; int m_tiltOutID; --- 96,104 ---- int m_absZoomID; ! // parameters ! int m_panSpeed; ! int m_tiltSpeed; ! ! // outputs int m_panOutID; int m_tiltOutID; *************** *** 92,95 **** --- 106,110 ---- PtzProxy *m_ptzProxy; + bool m_isInit; *************** *** 97,101 **** PlayerPTZ(string nodeName, ParameterSet params) ! : BufferedNode(nodeName, params), m_ptzProxy(NULL) { //inputs --- 112,116 ---- PlayerPTZ(string nodeName, ParameterSet params) ! : BufferedNode(nodeName, params), m_ptzProxy(NULL), m_isInit(false) { //inputs *************** *** 110,113 **** --- 125,132 ---- m_absZoomID = addInput("ABS_ZOOM"); + // parameters + m_panSpeed = dereference_cast<int>(parameters.get("PAN_SPEED")); + m_tiltSpeed = dereference_cast<int>(parameters.get("TILT_SPEED")); + //outputs m_panOutID = addOutput("PAN"); *************** *** 144,147 **** --- 163,176 ---- } + if(!m_isInit) + { + m_ptzProxy->SetSpeed(m_panSpeed, m_tiltSpeed); + m_isInit = true; + } + + m_panSpeed = dereference_cast<int>(parameters.get("PAN_SPEED")); + m_tiltSpeed = dereference_cast<int>(parameters.get("TILT_SPEED")); + + int pan_command = m_ptzProxy->pan; int tilt_command = m_ptzProxy->tilt; Index: Makefile.am =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/Player/src/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.am 26 May 2004 18:48:54 -0000 1.5 --- Makefile.am 27 May 2004 00:27:39 -0000 1.6 *************** *** 4,12 **** #AUTOMAKE_OPTIONS = no-dependencies ! install-data-local: ! echo "Installing libPlayerDevices" ! mkdir -p $(OVERFLOW_DATA)/toolbox/$(PACKAGE) ! (perl $(OVERFLOW_BIN)/info2def.pl $(top_srcdir)/Player/src/*.cc $(top_srcdir)/Player/include/*.h > $(OVERFLOW_DATA)/toolbox/$(PACKAGE)/PlayerDevices.def) ! (rm $(OVERFLOW_DATA)/lib/PlayerDevices.tlb; ln -s $(OVERFLOW_DATA)/lib/libPlayerDevices.so $(OVERFLOW_DATA)/lib/PlayerDevices.tlb) lib_LTLIBRARIES = libPlayerDevices.la --- 4,8 ---- #AUTOMAKE_OPTIONS = no-dependencies ! #override libdir=$(OVERFLOW_DATA)/$(PACKAGE) lib_LTLIBRARIES = libPlayerDevices.la *************** *** 23,30 **** PlayerGripper.cc ! ! libPlayerDevices_la_LDFLAGS = -release $(LT_RELEASE) INCLUDES = -I../include $(OVERFLOW_INCLUDE) \ -I../../Pioneer2/include \ ! -I../../Vision/include --- 19,32 ---- PlayerGripper.cc ! libPlayerDevices_la_LDFLAGS = -release $(LT_RELEASE) $(PLAYER_LIBS) $(OVERFLOW_LIBS) INCLUDES = -I../include $(OVERFLOW_INCLUDE) \ -I../../Pioneer2/include \ ! -I../../Vision/include \ ! $(PLAYER_INCLUDES) ! ! install-data-local: ! echo "Installing libPlayerDevices" ! mkdir -p $(OVERFLOW_DATA)/$(PACKAGE) ! (perl $(OVERFLOW_BIN)/info2def.pl $(libPlayerDevices_la_SOURCES) > $(OVERFLOW_DATA)/$(PACKAGE)/PlayerDevices.def) ! (rm -f $(OVERFLOW_DATA)/$(PACKAGE)/PlayerDevices.tlb; cd $(OVERFLOW_DATA)/$(PACKAGE); ln -s lib/libPlayerDevices.so PlayerDevices.tlb) Index: PlayerVelocity.cc =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/Player/src/PlayerVelocity.cc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PlayerVelocity.cc 9 Jul 2003 17:17:18 -0000 1.7 --- PlayerVelocity.cc 27 May 2004 00:27:39 -0000 1.8 *************** *** 68,71 **** --- 68,73 ---- PositionProxy *m_positionProxy; + int m_lastVelocity; + int m_lastHeading; public: *************** *** 82,85 **** --- 84,90 ---- m_yposID = addOutput("YPOS"); m_thetaID = addOutput("THETA"); + + m_lastVelocity = 0; + m_lastHeading = 0; } *************** *** 110,118 **** //reading new data from player. ! ! if (!VelocityValue->isNil() && !HeadingValue->isNil()) { int vel = dereference_cast<int>(VelocityValue); int rot = dereference_cast<int>(HeadingValue); ! // write commands to robot m_positionProxy->SetSpeed(vel,rot); } --- 115,157 ---- //reading new data from player. ! ! if (!VelocityValue->isNil() && !HeadingValue->isNil()) { int vel = dereference_cast<int>(VelocityValue); int rot = dereference_cast<int>(HeadingValue); ! // write commands to robot ! if (m_lastVelocity != vel || m_lastHeading != rot){ ! m_positionProxy->SetSpeed(vel,rot); ! m_lastVelocity = vel; ! m_lastHeading = rot; ! } ! } ! else if (VelocityValue->isNil() && !HeadingValue->isNil()) { ! int rot = dereference_cast<int>(HeadingValue); ! // write commands to robot ! if (m_lastHeading != rot){ ! m_positionProxy->SetSpeed(0,rot); ! m_lastHeading = rot; ! } ! } ! else if (!VelocityValue->isNil() && HeadingValue->isNil()) { ! int vel = dereference_cast<int>(VelocityValue); ! // write commands to robot ! if (m_lastVelocity != vel){ ! m_positionProxy->SetSpeed(vel,0); ! m_lastVelocity = vel; ! } ! } ! else{ ! if (m_lastVelocity != 0 || m_lastHeading != 0){ ! m_positionProxy->SetSpeed(0,0); ! m_lastVelocity = 0; ! m_lastHeading = 0; ! } ! } ! /**** old ! if (!VelocityValue->isNil() && !HeadingValue->isNil()) { ! int vel = dereference_cast<int>(VelocityValue); ! int rot = dereference_cast<int>(HeadingValue); ! // write commands to robot m_positionProxy->SetSpeed(vel,rot); } *************** *** 120,132 **** else if (VelocityValue->isNil() && !HeadingValue->isNil()) { int rot = dereference_cast<int>(HeadingValue); ! // write commands to robot m_positionProxy->SetSpeed(0,rot); } else if (!VelocityValue->isNil() && HeadingValue->isNil()) { int vel = dereference_cast<int>(VelocityValue); ! // write commands to robot m_positionProxy->SetSpeed(vel,0); } ! //write output (*outputs[m_xposID].buffer)[count] = ObjectRef(Int::alloc(m_positionProxy->Xpos())); --- 159,172 ---- else if (VelocityValue->isNil() && !HeadingValue->isNil()) { int rot = dereference_cast<int>(HeadingValue); ! // write commands to robot m_positionProxy->SetSpeed(0,rot); } else if (!VelocityValue->isNil() && HeadingValue->isNil()) { int vel = dereference_cast<int>(VelocityValue); ! // write commands to robot m_positionProxy->SetSpeed(vel,0); } ! ***/ ! //write output (*outputs[m_xposID].buffer)[count] = ObjectRef(Int::alloc(m_positionProxy->Xpos())); Index: PlayerGripper.cc =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/Player/src/PlayerGripper.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PlayerGripper.cc 9 Jul 2003 14:25:14 -0000 1.5 --- PlayerGripper.cc 27 May 2004 00:27:39 -0000 1.6 *************** *** 67,70 **** --- 67,72 ---- //variables GripperProxy *m_gripperProxy; + unsigned char m_lastCmd; + public: *************** *** 82,85 **** --- 84,88 ---- m_beamsID = addOutput("BEAMS"); + m_lastCmd = 0; } *************** *** 117,123 **** } ! //send command with SetGrip ! if ((m_gripperProxy->SetGrip(cmd,arg)) < 0) { ! throw new GeneralException("Unable to send gripper commands",__FILE__,__LINE__); } } --- 120,129 ---- } ! if (m_lastCmd != cmd) ! { ! //send command with SetGrip ! if ((m_gripperProxy->SetGrip(cmd,arg)) < 0) { ! throw new GeneralException("Unable to send gripper commands",__FILE__,__LINE__); ! } } } |