Revision: 6458
          http://playerstage.svn.sourceforge.net/playerstage/?rev=6458&view=rev
Author:   natepak
Date:     2008-05-29 07:04:32 -0700 (Thu, 29 May 2008)

Log Message:
-----------
Updates to the GUI

Modified Paths:
--------------
    code/gazebo/trunk/TODO
    code/gazebo/trunk/examples/player/camera/camera.cc
    code/gazebo/trunk/examples/player/camera/player.cfg
    code/gazebo/trunk/server/gui/GLWindow.cc
    code/gazebo/trunk/server/gui/GLWindow.hh
    code/gazebo/trunk/server/gui/Toolbar.cc
    code/gazebo/trunk/server/gui/Toolbar.hh
    code/gazebo/trunk/worlds/models/sonyvid30.model

Modified: code/gazebo/trunk/TODO
===================================================================
--- code/gazebo/trunk/TODO      2008-05-28 18:46:20 UTC (rev 6457)
+++ code/gazebo/trunk/TODO      2008-05-29 14:04:32 UTC (rev 6458)
@@ -1,5 +1,6 @@
 Open:
-- Fix the updateRate tags for rendering and phyics to be more intuitive.
+- Mouse picking
+  -Implement in CameraSensor class.
 - Shadows draw on multiple surfaces(seem to pass through walls).
 - Removing the sky results in a black screen
 - Apply Linear and Angular Damping, see OGREODE sources.
@@ -15,7 +16,6 @@
 - Implement Speech interface
 - Add in user adjustment of simple solids texture units
 - Fix sicklms200 PutFiducialData. Breaks when using large angles
-- Mouse picking
 - Paging heightmaps. 
   - Positioning the current heightmap is a big hack
 

Modified: code/gazebo/trunk/examples/player/camera/camera.cc
===================================================================
--- code/gazebo/trunk/examples/player/camera/camera.cc  2008-05-28 18:46:20 UTC 
(rev 6457)
+++ code/gazebo/trunk/examples/player/camera/camera.cc  2008-05-29 14:04:32 UTC 
(rev 6458)
@@ -1,25 +1,36 @@
 #include <libplayerc++/playerc++.h>
 #include <iostream>
 
+using namespace PlayerCc;
+using namespace std;
+
+
 int main()
 {
   // We throw exceptions on creation if we fail
   try
   {
-    using namespace PlayerCc;
-    using namespace std;
-
     // Create a player client object, using the variables assigned by the
     // call to parse_args()
     PlayerClient robot(PlayerCc::PLAYER_HOSTNAME, PlayerCc::PLAYER_PORTNUM);
 
     // Subscribe to the camera proxy
     CameraProxy cp(&robot, 0);
+    BlobfinderProxy bp (&robot, 0);
 
+    while (true)
+    {
+      robot.Read();
+
+      printf("Blobs[%d]\n",bp.GetCount());
+      usleep(10000);
+    }
+
   }
   catch (PlayerCc::PlayerError e)
   {
     std::cerr << "Error:" << e << std::endl;
     return -1;
   }
+
 }

Modified: code/gazebo/trunk/examples/player/camera/player.cfg
===================================================================
--- code/gazebo/trunk/examples/player/camera/player.cfg 2008-05-28 18:46:20 UTC 
(rev 6457)
+++ code/gazebo/trunk/examples/player/camera/player.cfg 2008-05-29 14:04:32 UTC 
(rev 6458)
@@ -10,7 +10,17 @@
 (
  name "gazebo"
  provides ["camera:0"]
- gz_id "camera_iface_1"
+ gz_id "camera_iface_0"
  alwayson 1
  save 1
 )
+
+driver
+(
+ name "cmvision"
+ provides ["blobfinder:0"]
+ requires ["camera:0"]
+
+ colorfile "colors.txt"
+)
+

Modified: code/gazebo/trunk/server/gui/GLWindow.cc
===================================================================
--- code/gazebo/trunk/server/gui/GLWindow.cc    2008-05-28 18:46:20 UTC (rev 
6457)
+++ code/gazebo/trunk/server/gui/GLWindow.cc    2008-05-29 14:04:32 UTC (rev 
6458)
@@ -37,6 +37,7 @@
 #include "GazeboMessage.hh"
 #include "MainMenu.hh"
 #include "CameraManager.hh"
+#include "World.hh"
 
 #include "OgreHUD.hh"
 
@@ -86,6 +87,8 @@
   this->colormap = fl_colormap;
   this->windowId = Fl_X::i(this)->xid;
 
+  this->mouseDrag = false;
+
   Fl_Window::show();
 
 }
@@ -214,6 +217,13 @@
       this->middleMousePressed = false;
       break;
   }
+
+  if (!this->mouseDrag)
+  {
+    //Entity *ent = World::Instance()->GetEntityAt(this->mousePos);
+  }
+
+  this->mouseDrag = false;
 }
 
 
////////////////////////////////////////////////////////////////////////////////
@@ -231,6 +241,8 @@
       camera->RotatePitch(d.y * this->rotateAmount);
     }
   }
+
+  this->mouseDrag = true;
 }
 
 
////////////////////////////////////////////////////////////////////////////////

Modified: code/gazebo/trunk/server/gui/GLWindow.hh
===================================================================
--- code/gazebo/trunk/server/gui/GLWindow.hh    2008-05-28 18:46:20 UTC (rev 
6457)
+++ code/gazebo/trunk/server/gui/GLWindow.hh    2008-05-29 14:04:32 UTC (rev 
6458)
@@ -105,6 +105,8 @@
     private: std::map<int,int> keys;
 
     private: double lastUpdateTime;
+
+    private: bool mouseDrag;
   };
 
 }

Modified: code/gazebo/trunk/server/gui/Toolbar.cc
===================================================================
--- code/gazebo/trunk/server/gui/Toolbar.cc     2008-05-28 18:46:20 UTC (rev 
6457)
+++ code/gazebo/trunk/server/gui/Toolbar.cc     2008-05-29 14:04:32 UTC (rev 
6458)
@@ -26,6 +26,8 @@
 
 #include <stdio.h>
 #include <FL/Fl_Value_Output.H>
+#include <FL/Fl_Output.H>
+#include <FL/Fl_Button.H>
 
 #include "CameraManager.hh"
 #include "CameraSensor.hh"
@@ -53,14 +55,37 @@
     sprintf(buffer,"Camera");
   }
 
-  this->cameraInfoGrp = new Fl_Group(x+10,y+20,w-20,25*3, buffer);
+  this->cameraInfoGrp = new Fl_Group(x+10,y+20,w-20,25*5, "Camera");
 
   // Camera Info Group
   this->cameraInfoGrp->box(FL_BORDER_BOX);
 
-  // Camera X output
+  // Camera name output
   x = this->cameraInfoGrp->x()+20;
   y = this->cameraInfoGrp->y()+2;
+  this->cameraName = new Fl_Output(x,y,this->cameraInfoGrp->w()-44,20);
+
+  // Prev camera button
+  x = this->cameraInfoGrp->x()+2;
+  y = this->cameraInfoGrp->y()+2;
+  this->prevCameraButton = new Fl_Button(x,y,16,20,"<");
+  this->prevCameraButton->callback( &gazebo::Toolbar::PrevCameraButtonCB, this 
);
+
+  // Next camera button
+  x = this->cameraInfoGrp->x() + this->cameraInfoGrp->w()-22;
+  y = this->cameraInfoGrp->y()+2;
+  this->nextCameraButton = new Fl_Button(x,y,16,20,">");
+  this->nextCameraButton->callback( &gazebo::Toolbar::NextCameraButtonCB, this 
);
+
+  // Camera dimensions
+  x = this->cameraInfoGrp->x() + 40;
+  y = this->cameraName->y()+this->cameraName->h()+5;
+  this->cameraDimensions = new 
Fl_Output(x,y,this->cameraName->w()-20,20,"WxH");
+
+
+  // Camera X output
+  x = this->cameraInfoGrp->x() + 20;
+  y = this->cameraDimensions->y() + this->cameraDimensions->h()+5;
   this->outputX = new Fl_Value_Output(x,y,60,20,"X");
   this->outputX->precision(2);
 
@@ -114,13 +139,19 @@
 
   if (camera != NULL)
   {
-    sprintf(buffer,"%s [%d x %d]", camera->GetName().c_str(), 
camera->GetImageWidth(), camera->GetImageHeight());
+    sprintf(buffer,"%s", camera->GetName().c_str());
+    if (strcmp(buffer,this->cameraName->value()) != 0)
+    {
+      this->cameraName->value(buffer);
+    }
 
-    if (strcmp(buffer,this->cameraInfoGrp->label()) != 0)
+    sprintf(buffer,"%d x %d", camera->GetImageWidth(), 
camera->GetImageHeight());
+    if (strcmp(buffer,this->cameraDimensions->value()) != 0)
     {
-      this->cameraInfoGrp->label(buffer);
+      this->cameraDimensions->value(buffer);
     }
 
+
     Pose3d pose = camera->GetWorldPose();
 
     this->outputX->value(pose.pos.x);
@@ -132,3 +163,12 @@
   }
 }
 
+void Toolbar::PrevCameraButtonCB(Fl_Widget * /*w*/, void *data)
+{
+  CameraManager::Instance()->DecActiveCamera();
+}
+
+void Toolbar::NextCameraButtonCB(Fl_Widget * /*w*/, void *data)
+{
+  CameraManager::Instance()->IncActiveCamera();
+}

Modified: code/gazebo/trunk/server/gui/Toolbar.hh
===================================================================
--- code/gazebo/trunk/server/gui/Toolbar.hh     2008-05-28 18:46:20 UTC (rev 
6457)
+++ code/gazebo/trunk/server/gui/Toolbar.hh     2008-05-29 14:04:32 UTC (rev 
6458)
@@ -29,6 +29,8 @@
 #include <FL/Fl_Group.H>
 
 class Fl_Value_Output;
+class Fl_Output;
+class Fl_Button;
 
 namespace gazebo
 {
@@ -45,7 +47,14 @@
     /// \brief Update the toolbar data
     public: void Update();
 
+    public: static void PrevCameraButtonCB(Fl_Widget * /*w*/, void *data);
+    public: static void NextCameraButtonCB(Fl_Widget * /*w*/, void *data);
+
     private: Fl_Group *cameraInfoGrp;
+    private: Fl_Button *prevCameraButton;
+    private: Fl_Button *nextCameraButton;
+    private: Fl_Output *cameraName;
+    private: Fl_Output *cameraDimensions;
     private: Fl_Value_Output *outputX;
     private: Fl_Value_Output *outputY;
     private: Fl_Value_Output *outputZ;

Modified: code/gazebo/trunk/worlds/models/sonyvid30.model
===================================================================
--- code/gazebo/trunk/worlds/models/sonyvid30.model     2008-05-28 18:46:20 UTC 
(rev 6457)
+++ code/gazebo/trunk/worlds/models/sonyvid30.model     2008-05-29 14:04:32 UTC 
(rev 6458)
@@ -80,6 +80,13 @@
         <material>Gazebo/White</material>
       </visual>
     </geom:cylinder>
+
+    <sensor:camera name="sonyvid30_camera_sensor">
+      <imageSize>320 240</imageSize>
+      <hfov>60</hfov>
+      <nearClip>0.1</nearClip>
+      <farClip>100</farClip>
+    </sensor:camera>
   </body:box>
 
   <joint:hinge name="pan_joint">


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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to