Revision: 7593 http://playerstage.svn.sourceforge.net/playerstage/?rev=7593&view=rev Author: natepak Date: 2009-04-10 14:58:25 +0000 (Fri, 10 Apr 2009)
Log Message: ----------- Added range resolution to ray sensor Modified Paths: -------------- code/gazebo/trunk/player/LaserInterface.cc code/gazebo/trunk/server/controllers/laser/sicklms200/SickLMS200_Laser.cc code/gazebo/trunk/server/physics/ContactParams.cc code/gazebo/trunk/server/sensors/ray/RaySensor.cc code/gazebo/trunk/server/sensors/ray/RaySensor.hh code/gazebo/trunk/worlds/models/sicklms200.model Modified: code/gazebo/trunk/player/LaserInterface.cc =================================================================== --- code/gazebo/trunk/player/LaserInterface.cc 2009-04-10 14:55:29 UTC (rev 7592) +++ code/gazebo/trunk/player/LaserInterface.cc 2009-04-10 14:58:25 UTC (rev 7593) @@ -182,19 +182,9 @@ ts.tv_sec = (int) (this->iface->data->head.time); ts.tv_usec = (int) (fmod(this->iface->data->head.time, 1) * 1e6); - - // Pick the rage resolution to use (1, 10, 100) - if (this->iface->data->max_range <= 8.192) - rangeRes = 1.0; - else if (this->iface->data->max_range <= 81.92) - rangeRes = 10.0; - else - rangeRes = 100.0; - + rangeRes = this->iface->data->res_range; angleRes = this->iface->data->res_angle; - //printf("range res = %f %f\n", rangeRes, this->iface->data->max_range); - double oldCount = this->data.ranges_count; this->data.min_angle = this->iface->data->min_angle; Modified: code/gazebo/trunk/server/controllers/laser/sicklms200/SickLMS200_Laser.cc =================================================================== --- code/gazebo/trunk/server/controllers/laser/sicklms200/SickLMS200_Laser.cc 2009-04-10 14:55:29 UTC (rev 7592) +++ code/gazebo/trunk/server/controllers/laser/sicklms200/SickLMS200_Laser.cc 2009-04-10 14:58:25 UTC (rev 7593) @@ -184,7 +184,9 @@ double minRange = this->myParent->GetMinRange(); int rayCount = this->myParent->GetRayCount(); int rangeCount = this->myParent->GetRangeCount(); + float resRange = this->myParent->GetResRange(); + if (this->laserIface->Lock(1)) { // Data timestamp @@ -194,7 +196,7 @@ this->laserIface->data->min_angle = minAngle.GetAsRadian(); this->laserIface->data->max_angle = maxAngle.GetAsRadian(); this->laserIface->data->res_angle = (maxAngle.GetAsRadian() - minAngle.GetAsRadian()) / (rangeCount - 1); - this->laserIface->data->res_range = 0.1; + this->laserIface->data->res_range = resRange; this->laserIface->data->max_range = maxRange; this->laserIface->data->range_count = rangeCount; Modified: code/gazebo/trunk/server/physics/ContactParams.cc =================================================================== --- code/gazebo/trunk/server/physics/ContactParams.cc 2009-04-10 14:55:29 UTC (rev 7592) +++ code/gazebo/trunk/server/physics/ContactParams.cc 2009-04-10 14:58:25 UTC (rev 7593) @@ -43,8 +43,8 @@ this->mu1 = dInfinity; this->mu2 = dInfinity; - this->slip1 = 0.1; - this->slip2 = 0.1; + this->slip1 = 0.01; + this->slip2 = 0.01; } ////////////////////////////////////////////////////////////////////////////// Modified: code/gazebo/trunk/server/sensors/ray/RaySensor.cc =================================================================== --- code/gazebo/trunk/server/sensors/ray/RaySensor.cc 2009-04-10 14:55:29 UTC (rev 7592) +++ code/gazebo/trunk/server/sensors/ray/RaySensor.cc 2009-04-10 14:58:25 UTC (rev 7593) @@ -72,6 +72,7 @@ this->maxAngleP = new ParamT<Angle>("maxAngle",DTOR(-90),1); this->minRangeP = new ParamT<double>("minRange",0,1); this->maxRangeP = new ParamT<double>("maxRange",0,1); + this->resRangeP = new ParamT<double>("resRange",0.1,1); this->originP = new ParamT<Vector3>("origin", Vector3(0,0,0), 0); this->displayRaysP = new ParamT<std::string>("displayRays", "off", 0); Param::End(); @@ -94,6 +95,7 @@ delete this->maxAngleP; delete this->minRangeP; delete this->maxRangeP; + delete this->resRangeP; delete this->originP; delete this->displayRaysP; } @@ -113,6 +115,7 @@ this->maxAngleP->Load(node); this->minRangeP->Load(node); this->maxRangeP->Load(node); + this->resRangeP->Load(node); this->originP->Load(node); this->displayRaysP->Load(node); @@ -138,6 +141,7 @@ stream << prefix << " " << *(this->maxAngleP) << "\n"; stream << prefix << " " << *(this->minRangeP) << "\n"; stream << prefix << " " << *(this->maxRangeP) << "\n"; + stream << prefix << " " << *(this->resRangeP) << "\n"; stream << prefix << " " << *(this->originP) << "\n"; stream << prefix << " " << *(this->rayCountP) << "\n"; stream << prefix << " " << *(this->rangeCountP) << "\n"; @@ -242,6 +246,13 @@ } ////////////////////////////////////////////////////////////////////////////// +/// Get the range resolution +double RaySensor::GetResRange() const +{ + return this->resRangeP->GetValue(); +} + +////////////////////////////////////////////////////////////////////////////// /// Get the ray count int RaySensor::GetRayCount() const { Modified: code/gazebo/trunk/server/sensors/ray/RaySensor.hh =================================================================== --- code/gazebo/trunk/server/sensors/ray/RaySensor.hh 2009-04-10 14:55:29 UTC (rev 7592) +++ code/gazebo/trunk/server/sensors/ray/RaySensor.hh 2009-04-10 14:58:25 UTC (rev 7593) @@ -94,6 +94,9 @@ /// \return The maximum range public: double GetMaxRange() const; + /// \brief Get the range resolution + public: double GetResRange() const; + /// \brief Get the ray count /// \return The number of rays public: int GetRayCount() const; @@ -134,7 +137,7 @@ private: std::vector<RayGeom*> rays; private: ParamT<Angle> *minAngleP, *maxAngleP; - private: ParamT<double> *minRangeP, *maxRangeP; + private: ParamT<double> *minRangeP, *maxRangeP, *resRangeP; private: ParamT<Vector3> *originP; private: Pose3d prevPose; Modified: code/gazebo/trunk/worlds/models/sicklms200.model =================================================================== --- code/gazebo/trunk/worlds/models/sicklms200.model 2009-04-10 14:55:29 UTC (rev 7592) +++ code/gazebo/trunk/worlds/models/sicklms200.model 2009-04-10 14:58:25 UTC (rev 7593) @@ -44,13 +44,14 @@ <rangeCount>361</rangeCount> <origin>0.05 0.0 0</origin> - <displayRays>false</displayRays> + <displayRays>fan</displayRays> <minAngle>-90</minAngle> <maxAngle>90</maxAngle> <minRange>0.1</minRange> <maxRange>8</maxRange> + <resRange>.1</resRange> <controller:sicklms200_laser name="laser_controller_1"> <interface:laser name="laser_iface_0"/> 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: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com _______________________________________________ Playerstage-commit mailing list Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit