From: Fernyqc <fe...@us...> - 2005-07-04 11:21:20
|
Update of /cvsroot/robotflow/RobotFlow/Behaviors/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11892 Modified Files: AvoidPat.cc RangeFashion.cc SafeVelocityPat.cc Log Message: AvoidPat and RangeFashion -> parameters modifications SafeVelocity -> Allow backward motion Index: RangeFashion.cc =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/Behaviors/src/RangeFashion.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RangeFashion.cc 3 Jul 2005 04:35:47 -0000 1.5 --- RangeFashion.cc 4 Jul 2005 11:21:11 -0000 1.6 *************** *** 41,57 **** * @input_description Behavior activation * ! * @input_name LASERS * @input_type Vector<int> * @input_description All lasers reading. * ! * @input_name SONARS * @input_type Vector<int> * @input_description All sonars reading. * ! * @input_name IRS * @input_type Vector<int> * @input_description All IRs reading. * ! * @output_name PERCEPT * @output_type Vector<int> * @output_description Percept after fusion --- 41,57 ---- * @input_description Behavior activation * ! * @input_name LASER * @input_type Vector<int> * @input_description All lasers reading. * ! * @input_name SONAR * @input_type Vector<int> * @input_description All sonars reading. * ! * @input_name IR * @input_type Vector<int> * @input_description All IRs reading. * ! * @output_name RANGE_BELT * @output_type Vector<int> * @output_description Percept after fusion *************** *** 215,224 **** //inputs ! laserID = addInput("LASERS"); ! sonarID = addInput("SONARS"); ! irID = addInput("IRS"); //outputs ! perceptID = addOutput("PERCEPT"); // parameters --- 215,224 ---- //inputs ! laserID = addInput("LASER"); ! sonarID = addInput("SONAR"); ! irID = addInput("IR"); //outputs ! perceptID = addOutput("RANGE_BELT"); // parameters Index: SafeVelocityPat.cc =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/Behaviors/src/SafeVelocityPat.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SafeVelocityPat.cc 3 Jul 2005 23:54:19 -0000 1.5 --- SafeVelocityPat.cc 4 Jul 2005 11:21:11 -0000 1.6 *************** *** 146,153 **** // Determine the security distance int velIn = dereference_cast<int>(velInRef); float securityDist = 0; ! if(abs(velIn) < m_min_vel) securityDist = m_min_distance; ! else securityDist = m_slope*abs(velIn) + m_b; // Evaluate the security margin around the robot --- 146,156 ---- // Determine the security distance int velIn = dereference_cast<int>(velInRef); + int signVelIn = (velIn<0)?-1:1; + velIn = abs(velIn); + float securityDist = 0; ! if(velIn < m_min_vel) securityDist = m_min_distance; ! else securityDist = m_slope*velIn + m_b; // Evaluate the security margin around the robot *************** *** 213,216 **** --- 216,225 ---- if((velOut < m_min_vel) && (velIn > m_min_vel)) velOut = m_min_vel; + + // Saturate the speed output (security) + if(velOut > m_max_vel) velOut = m_max_vel; + + // Backward/Forward + velOut *= signVelIn; // Debugging purpose only Index: AvoidPat.cc =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/Behaviors/src/AvoidPat.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AvoidPat.cc 4 Jul 2005 03:36:24 -0000 1.5 --- AvoidPat.cc 4 Jul 2005 11:21:11 -0000 1.6 *************** *** 40,52 **** * @input_description Behavior activation * ! * @input_name DIST_OBSTACLE * @input_type Vector<int> ! * @input_description Distance of the obstacle to the robot * ! * @input_name VELOCITY_IN * @input_type int * @input_description Actual velocity of the robot * ! * @output_name VELOCITY_OUT * @output_type int * @output_description Velocity value --- 40,52 ---- * @input_description Behavior activation * ! * @input_name RANGE_BELT * @input_type Vector<int> ! * @input_description Range mesure around the robot * ! * @input_name ACTUAL_VELOCITY * @input_type int * @input_description Actual velocity of the robot * ! * @output_name VELOCITY * @output_type int * @output_description Velocity value *************** *** 188,196 **** //inputs ! rangeID = addInput("DIST_OBSTACLE"); ! velocityInID = addInput("VELOCITY_IN"); //outputs ! velocityOutID = addOutput("VELOCITY_OUT"); rotationID = addOutput("ROTATION"); --- 188,196 ---- //inputs ! rangeID = addInput("RANGE_BELT"); ! velocityInID = addInput("ACTUAL_VELOCITY"); //outputs ! velocityOutID = addOutput("VELOCITY"); rotationID = addOutput("ROTATION"); |