Revision: 6677
          http://playerstage.svn.sourceforge.net/playerstage/?rev=6677&view=rev
Author:   natepak
Date:     2008-06-24 09:02:24 -0700 (Tue, 24 Jun 2008)

Log Message:
-----------
Fixed the fiducial-laser interface.

Modified Paths:
--------------
    code/gazebo/trunk/player/FiducialInterface.cc
    code/gazebo/trunk/player/gazebo.cfg
    code/gazebo/trunk/server/controllers/laser/sicklms200/SickLMS200_Laser.cc
    code/gazebo/trunk/server/sensors/ray/RaySensor.cc
    code/gazebo/trunk/worlds/test.world

Modified: code/gazebo/trunk/player/FiducialInterface.cc
===================================================================
--- code/gazebo/trunk/player/FiducialInterface.cc       2008-06-24 15:09:10 UTC 
(rev 6676)
+++ code/gazebo/trunk/player/FiducialInterface.cc       2008-06-24 16:02:24 UTC 
(rev 6677)
@@ -174,9 +174,9 @@
     ts.tv_sec = (int) (this->iface->data->head.time);
     ts.tv_usec = (int) (fmod(this->iface->data->head.time, 1) * 1e6);
 
-    unsigned int oldCount = data.fiducials_count;
+    unsigned int oldCount = this->data.fiducials_count;
 
-    data.fiducials_count = i;
+    this->data.fiducials_count = this->iface->data->count;
 
     if (oldCount != this->data.fiducials_count)
     {

Modified: code/gazebo/trunk/player/gazebo.cfg
===================================================================
--- code/gazebo/trunk/player/gazebo.cfg 2008-06-24 15:09:10 UTC (rev 6676)
+++ code/gazebo/trunk/player/gazebo.cfg 2008-06-24 16:02:24 UTC (rev 6677)
@@ -25,12 +25,12 @@
   gz_id "laser_iface_0"
 )
 
-#driver
-#(
-#  name "gazebo"
-#  provides ["fiducial:0"]
-#  gz_id "sicklms_fid_iface_1"
-#)
+driver
+(
+  name "gazebo"
+  provides ["fiducial:0"]
+  gz_id "fiducial_iface_0"
+)
 
 #driver
 #(

Modified: 
code/gazebo/trunk/server/controllers/laser/sicklms200/SickLMS200_Laser.cc
===================================================================
--- code/gazebo/trunk/server/controllers/laser/sicklms200/SickLMS200_Laser.cc   
2008-06-24 15:09:10 UTC (rev 6676)
+++ code/gazebo/trunk/server/controllers/laser/sicklms200/SickLMS200_Laser.cc   
2008-06-24 16:02:24 UTC (rev 6677)
@@ -92,23 +92,30 @@
 // Update the controller
 void SickLMS200_Laser::UpdateChild()
 {
-  bool opened = false;
+  bool laserOpened = false;
+  bool fidOpened = false;
 
   if (this->laserIface->Lock(1))
   {
-    opened = this->laserIface->GetOpenCount() > 0;
+    laserOpened = this->laserIface->GetOpenCount() > 0;
+    fidOpened = this->fiducialIface->GetOpenCount() > 0;
     this->laserIface->Unlock();
   }
 
-  if (opened)
+  if (laserOpened)
   {
     this->myParent->SetActive(true);
-
     this->PutLaserData();
-    //this->PutFiducialData();
   }
-  else
+
+  if (fidOpened)
   {
+    this->myParent->SetActive(true);
+    this->PutFiducialData();
+  }
+
+  if (!laserOpened && !fidOpened)
+  {
     this->myParent->SetActive(false);
   }
 }
@@ -173,7 +180,7 @@
       // Intensity is either-or
       v = (int) this->myParent->GetRetro(ja) || (int) 
this->myParent->GetRetro(jb);
 
-      this->laserIface->data->ranges[rangeCount-i-1] =  r + minRange;
+      this->laserIface->data->ranges[i] =  r + minRange;
       this->laserIface->data->intensity[i] = v;
     }
 
@@ -196,15 +203,13 @@
   double maxAngle = this->myParent->GetMaxAngle();
   double minAngle = this->myParent->GetMinAngle();
 
-//TODO: implement max range and rangeCount
-//  double maxRange = this->myParent->GetMaxRange();
+  double maxRange = this->myParent->GetMaxRange();
   double minRange = this->myParent->GetMinRange();
   int rayCount = this->myParent->GetRayCount();
-//  int rangeCount = this->myParent->GetRangeCount();
+  int rangeCount = this->myParent->GetRangeCount();
 
   if (this->fiducialIface->Lock(1))
   {
-
     // Data timestamp
     this->fiducialIface->data->head.time = Simulator::Instance()->GetSimTime();
     this->fiducialIface->data->count = 0;

Modified: code/gazebo/trunk/server/sensors/ray/RaySensor.cc
===================================================================
--- code/gazebo/trunk/server/sensors/ray/RaySensor.cc   2008-06-24 15:09:10 UTC 
(rev 6676)
+++ code/gazebo/trunk/server/sensors/ray/RaySensor.cc   2008-06-24 16:02:24 UTC 
(rev 6677)
@@ -109,8 +109,8 @@
   this->prevPose = bodyPose;
 
   // Create and array of ray geoms
-  //for (int i = 0; i < this->rayCount; i++)
-  for (int i = this->rayCount-1; i >= 0; i--)
+  for (int i = 0; i < this->rayCount; i++)
+  //for (int i = this->rayCount-1; i >= 0; i--)
   {
     angle = i * (this->maxAngle - this->minAngle) / (rayCount - 1) + 
this->minAngle;
 

Modified: code/gazebo/trunk/worlds/test.world
===================================================================
--- code/gazebo/trunk/worlds/test.world 2008-06-24 15:09:10 UTC (rev 6676)
+++ code/gazebo/trunk/worlds/test.world 2008-06-24 16:02:24 UTC (rev 6677)
@@ -5,57 +5,50 @@
   xmlns:gazebo="http://playerstage.sourceforge.net/gazebo/xmlschema/#gz"; 
   xmlns:model="http://playerstage.sourceforge.net/gazebo/xmlschema/#model"; 
   xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"; 
+  xmlns:window="http://playerstage.sourceforge.net/gazebo/xmlschema/#window"; 
+  xmlns:param="http://playerstage.sourceforge.net/gazebo/xmlschema/#param"; 
   xmlns:body="http://playerstage.sourceforge.net/gazebo/xmlschema/#body"; 
   xmlns:geom="http://playerstage.sourceforge.net/gazebo/xmlschema/#geom"; 
   xmlns:joint="http://playerstage.sourceforge.net/gazebo/xmlschema/#joint"; 
   
xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface";
 
+  xmlns:ui="http://playerstage.sourceforge.net/gazebo/xmlschema/#ui";
   
xmlns:rendering="http://playerstage.sourceforge.net/gazebo/xmlschema/#rendering";
 
-  
xmlns:renderable="http://playerstage.sourceforge.net/gazebo/xmlschema/#renderable";
 
   
xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller";
   xmlns:physics="http://playerstage.sourceforge.net/gazebo/xmlschema/#physics"; 
>
 
   <verbosity>5</verbosity>
 
   <physics:ode>
-    <stepTime>0.02</stepTime>
-    <gravity>0 0 -9.80665</gravity>
+    <stepTime>0.03</stepTime>
+    <gravity>0 0 -9.8</gravity>
     <cfm>10e-5</cfm>
-    <erp>0.3</erp>
+    <erp>0.8</erp>
+    <maxUpdateRate>0</maxUpdateRate>
   </physics:ode>
 
   <rendering:gui>
     <type>fltk</type>
-    <size>640 480</size>
+    <size>800 600</size>
     <pos>0 0</pos>
   </rendering:gui>
 
   <rendering:ogre>
-    <ambient>1.0 1.0 1.0 1.0</ambient>
+    <ambient>0.5 0.5 0.5 1.0</ambient>
     <sky>
       <material>Gazebo/CloudySky</material>
     </sky>
 
+    <fog>
+      <color>1.0 1.0 1.0</color>
+      <linearStart>10</linearStart>
+      <linearEnd>100</linearEnd>
+    </fog>
   </rendering:ogre>
 
-  <model:physical name="sphere1_model">
-    <xyz>0 0 0.1</xyz>
-    <static>false</static>
-    <body:sphere name="sphere1_body">
-      <geom:sphere name="sphere1_geom">
-        <size>0.2</size>
-        <mass>1.0</mass>
-
-        <visual>
-          <scale>0.2 0.2 0.2</scale>
-          <material>Gazebo/Rocky</material>
-          <mesh>unit_sphere</mesh>
-        </visual>
-      </geom:sphere>
-    </body:sphere>
-  </model:physical>
-
+   <!-- Ground Plane -->
   <model:physical name="plane1_model">
     <xyz>0 0 0</xyz>
+    <rpy>0 0 0</rpy>
     <static>true</static>
 
     <body:plane name="plane1_body">
@@ -64,27 +57,84 @@
         <size>2000 2000</size>
         <segments>10 10</segments>
         <uvTile>100 100</uvTile>
-        <material>Gazebo/GrassFloor</material>
+        <material>Gazebo/Grey</material>
       </geom:plane>
     </body:plane>
   </model:physical>
 
-  <model:physical name="cam2_model">
-    <xyz>-3.0 0 2.59</xyz>
-    <rpy>0 28 -2</rpy>
-    <static>true</static>
+  <model:physical name="cylinder1_model">
+    <xyz>1 -1.5 0.5</xyz>
+    <rpy>0.0 0.0 0.0</rpy>
 
-    <body:empty name="cam2_body">
-      <sensor:camera name="cam2_sensor">
-        <imageSize>800 600</imageSize>
-        <hfov>60</hfov>
-        <nearClip>0.1</nearClip>
-        <farClip>100</farClip>
+    <body:cylinder name="cylinder1_body">
+      <geom:cylinder name="cylinder1_geom">
+        <size>0.5 1</size>
+        <mass>1.0</mass>
+        <visual>
+          <mesh>unit_cylinder</mesh>
+          <material>Gazebo/RustyBarrel</material>
+        </visual>
 
-        <saveFrames>false</saveFrames>
-        <saveFramePath>frames</saveFramePath>
-      </sensor:camera>
-    </body:empty>
+        <laserFiducialId>1</laserFiducialId>
+      </geom:cylinder>
+    </body:cylinder>
   </model:physical>
 
+
+  <!-- 
+  Include the complete model described in the .model file
+  This assumes the root node is a <model:...>
+  -->
+  <!--  <include embedded="false">
+    <xi:include href="pioneer2dx.model" />
+  </include>
+  -->
+
+  <model:physical name="pioneer2dx_model1">
+    <xyz>0 0 0.145</xyz>
+    <rpy>0.0 0.0 0.0</rpy>
+
+    <controller:differential_position2d name="controller1">
+      <leftJoint>left_wheel_hinge</leftJoint>
+      <rightJoint>right_wheel_hinge</rightJoint>
+      <wheelSeparation>0.34</wheelSeparation>
+      <wheelDiameter>0.15</wheelDiameter>
+      <torque>5</torque>
+      <interface:position name="position_iface_0"/>
+    </controller:differential_position2d>
+
+    <model:physical name="laser">
+      <xyz>0.15 0 0.18</xyz>
+
+      <attach>
+        <parentBody>chassis_body</parentBody>
+        <myBody>laser_body</myBody>
+      </attach>
+
+      <include embedded="true">
+        <xi:include href="models/sicklms200.model" />
+      </include>
+    </model:physical>
+
+    <!-- 
+    The include should be last within a model. All previous statements
+    will override those in the included file 
+    -->
+    <include embedded="true">
+      <xi:include href="models/pioneer2dx.model" />
+    </include>
+  </model:physical>
+
+  <!-- White Directional light -->
+  <model:renderable name="directional_white">
+    <light>
+      <type>directional</type>
+      <direction>0 -0.6 -0.4</direction>
+      <diffuseColor>1.0 1.0 1.0</diffuseColor>
+      <specularColor>0.2 0.2 0.2</specularColor>
+      <attenuation>1000 1.0 0.0 0</attenuation>
+    </light>
+  </model:renderable>
+
+
 </gazebo:world>


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to