Revision: 7163 http://playerstage.svn.sourceforge.net/playerstage/?rev=7163&view=rev Author: natepak Date: 2008-11-21 02:31:05 +0000 (Fri, 21 Nov 2008)
Log Message: ----------- Updated the bandit & generic_actarray controllers to stop oscillations Modified Paths: -------------- code/gazebo/trunk/examples/libgazebo/bandit/bandit.cc code/gazebo/trunk/server/controllers/actarray/bandit/Bandit_Actarray.cc code/gazebo/trunk/server/controllers/actarray/generic/Generic_Actarray.cc code/gazebo/trunk/server/controllers/ptz/generic/Generic_PTZ.cc code/gazebo/trunk/worlds/models/sonyvid30.model Modified: code/gazebo/trunk/examples/libgazebo/bandit/bandit.cc =================================================================== --- code/gazebo/trunk/examples/libgazebo/bandit/bandit.cc 2008-11-21 01:34:37 UTC (rev 7162) +++ code/gazebo/trunk/examples/libgazebo/bandit/bandit.cc 2008-11-21 02:31:05 UTC (rev 7163) @@ -56,7 +56,7 @@ printf("Shoulder2[%f]\n", RTOD(actarrayIface->data->actuators[R_SHOULDER2].position)); - actarrayIface->data->cmd_pos[R_SHOULDER2] = DTOR(80); + actarrayIface->data->cmd_pos[R_SHOULDER2] = DTOR(79); actarrayIface->data->cmd_pos[R_ELBOW] = DTOR(90); usleep(1000000); actarrayIface->data->cmd_pos[R_ELBOW2] = DTOR(100); @@ -84,6 +84,7 @@ actarrayIface->Unlock(); }*/ + return 0; } Modified: code/gazebo/trunk/server/controllers/actarray/bandit/Bandit_Actarray.cc =================================================================== --- code/gazebo/trunk/server/controllers/actarray/bandit/Bandit_Actarray.cc 2008-11-21 01:34:37 UTC (rev 7162) +++ code/gazebo/trunk/server/controllers/actarray/bandit/Bandit_Actarray.cc 2008-11-21 02:31:05 UTC (rev 7163) @@ -151,11 +151,12 @@ angle = cmdAngle - joint->GetAngle(); if (fabs(angle) > 0.01) - { joint->SetParam( dParamVel, **(this->gainsP[i]) * angle); - joint->SetParam( dParamFMax, **(this->forcesP[i]) ); - } + else + joint->SetParam(dParamVel, 0); + joint->SetParam( dParamFMax, **(this->forcesP[i]) ); + } else if (this->myIface->data->joint_mode[i] == GAZEBO_ACTARRAY_JOINT_SPEED_MODE) { Modified: code/gazebo/trunk/server/controllers/actarray/generic/Generic_Actarray.cc =================================================================== --- code/gazebo/trunk/server/controllers/actarray/generic/Generic_Actarray.cc 2008-11-21 01:34:37 UTC (rev 7162) +++ code/gazebo/trunk/server/controllers/actarray/generic/Generic_Actarray.cc 2008-11-21 02:31:05 UTC (rev 7163) @@ -153,11 +153,12 @@ delta_position = target_position - actual_position; if (fabs(delta_position) > tolerances[i]) - { joint->SetParam( dParamVel, this->gains[i] * delta_position); - joint->SetParam( dParamFMax, this->forces[i] ); - } + else + joint->SetParam( dParamVel, 0); + joint->SetParam( dParamFMax, this->forces[i] ); + this->myIface->data->actuators[i].position = actual_position; this->myIface->data->actuators[i].speed = actual_speed; } Modified: code/gazebo/trunk/server/controllers/ptz/generic/Generic_PTZ.cc =================================================================== --- code/gazebo/trunk/server/controllers/ptz/generic/Generic_PTZ.cc 2008-11-21 01:34:37 UTC (rev 7162) +++ code/gazebo/trunk/server/controllers/ptz/generic/Generic_PTZ.cc 2008-11-21 02:31:05 UTC (rev 7163) @@ -166,10 +166,18 @@ float tilt = this->cmdTilt - this->tiltJoint->GetAngle(); float pan = this->cmdPan - this->panJoint->GetAngle(); - this->tiltJoint->SetParam( dParamVel, **(this->motionGainP) * tilt); + if (fabs(tilt) > 0.01) + this->tiltJoint->SetParam( dParamVel, **(this->motionGainP) * tilt); + else + this->tiltJoint->SetParam( dParamVel, 0); + this->tiltJoint->SetParam( dParamFMax, **(this->forceP) ); - this->panJoint->SetParam( dParamVel, **(this->motionGainP) * pan); + if (fabs(pan) > 0.01) + this->panJoint->SetParam( dParamVel, **(this->motionGainP) * pan); + else + this->panJoint->SetParam( dParamVel, 0); + this->panJoint->SetParam( dParamFMax, **(this->forceP) ); this->PutPTZData(); Modified: code/gazebo/trunk/worlds/models/sonyvid30.model =================================================================== --- code/gazebo/trunk/worlds/models/sonyvid30.model 2008-11-21 01:34:37 UTC (rev 7162) +++ code/gazebo/trunk/worlds/models/sonyvid30.model 2008-11-21 02:31:05 UTC (rev 7163) @@ -124,6 +124,9 @@ <controller:generic_ptz name="sonyvid30_controller"> <panJoint>pan_joint</panJoint> <tiltJoint>tilt_joint</tiltJoint> + + <motionGain>1</motionGain> + <force>0.01</force> <interface:ptz name="ptz_iface_1"/> </controller:generic_ptz> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Playerstage-commit mailing list Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit