|
From: <hsu...@us...> - 2008-08-25 19:20:17
|
Revision: 3561
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=3561&view=rev
Author: hsujohnhsu
Date: 2008-08-25 19:20:21 +0000 (Mon, 25 Aug 2008)
Log Message:
-----------
update laser plugin to read in sigma for artificial noise via xml tags in gazebo <gaussianNoise>.
Modified Paths:
--------------
pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Laser.hh
pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Laser.cc
pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2_test.xml
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Laser.hh
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Laser.hh 2008-08-25 19:15:39 UTC (rev 3560)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/Ros_Laser.hh 2008-08-25 19:20:21 UTC (rev 3561)
@@ -121,6 +121,8 @@
// FIXME: extract link name directly?
private: std::string frameName;
+ private: double gaussianNoise;
+
private: double GaussianKernel(double mu,double sigma);
// A mutex to lock access to fields that are used in message callbacks
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Laser.cc
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Laser.cc 2008-08-25 19:15:39 UTC (rev 3560)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Laser.cc 2008-08-25 19:20:21 UTC (rev 3561)
@@ -98,6 +98,7 @@
std::cout << "================= " << this->topicName << std::endl;
rosnode->advertise<std_msgs::LaserScan>(this->topicName);
this->frameName = node->GetString("frameName","default_ros_laser",0); //read from xml file
+ this->gaussianNoise = node->GetDouble("gaussianNoise",0.0,0); //read from xml file
}
////////////////////////////////////////////////////////////////////////////////
@@ -221,12 +222,11 @@
/* point scan from laser */
/* */
/***************************************************************/
- double sigma = 0.002; // 2 milimeter noise
if (r == maxRange)
this->laserMsg.ranges[i] = r; // no noise if at max range
else
- this->laserMsg.ranges[i] = r + this->GaussianKernel(0,sigma) ;
- this->laserMsg.intensities[i] = v + this->GaussianKernel(0,sigma) ;
+ this->laserMsg.ranges[i] = r + this->GaussianKernel(0,this->gaussianNoise) ;
+ this->laserMsg.intensities[i] = v + this->GaussianKernel(0,this->gaussianNoise) ;
}
// iface writing can be skipped if iface is not used.
Modified: pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2.xml
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2.xml 2008-08-25 19:15:39 UTC (rev 3560)
+++ pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2.xml 2008-08-25 19:20:21 UTC (rev 3561)
@@ -1675,6 +1675,7 @@
<map name="sensor" flag="gazebo">
<verbatim key="sensor_ray">
<sensor:ray name="tilt_laser">
+ <gaussianNoise>0.05</gaussianNoise>
<rayCount>683</rayCount>
<rangeCount>683</rangeCount>
<laserCount>1</laserCount>
@@ -1736,6 +1737,7 @@
<map name="sensor" flag="gazebo">
<verbatim key="sensor_ray">
<sensor:ray name="base_laser">
+ <gaussianNoise>0.05</gaussianNoise>
<rayCount>683</rayCount>
<rangeCount>683</rangeCount>
<laserCount>1</laserCount>
Modified: pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2_test.xml
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2_test.xml 2008-08-25 19:15:39 UTC (rev 3560)
+++ pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2_test.xml 2008-08-25 19:20:21 UTC (rev 3561)
@@ -1672,6 +1672,7 @@
<map name="sensor" flag="gazebo">
<verbatim key="sensor_ray">
<sensor:ray name="tilt_laser">
+ <gaussianNoise>0.05</gaussianNoise>
<rayCount>683</rayCount>
<rangeCount>683</rangeCount>
<laserCount>1</laserCount>
@@ -1733,6 +1734,7 @@
<map name="sensor" flag="gazebo">
<verbatim key="sensor_ray">
<sensor:ray name="base_laser">
+ <gaussianNoise>0.05</gaussianNoise>
<rayCount>683</rayCount>
<rangeCount>683</rangeCount>
<laserCount>1</laserCount>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|