Revision: 9042
          http://playerstage.svn.sourceforge.net/playerstage/?rev=9042&view=rev
Author:   hsujohnhsu
Date:     2011-04-11 22:16:54 +0000 (Mon, 11 Apr 2011)

Log Message:
-----------
patches per ticket by Peter Nordin
https://sourceforge.net/tracker/?func=detail&aid=3195458&group_id=42445&atid=433166

Modified Paths:
--------------
    code/gazebo/trunk/libgazebo/gz.h
    code/gazebo/trunk/player/CMakeLists.txt
    code/gazebo/trunk/player/GazeboDriver.cc
    code/gazebo/trunk/server/controllers/imu/Generic_Imu.cc
    code/gazebo/trunk/server/physics/CMakeLists.txt
    code/gazebo/trunk/server/physics/bullet/BulletGeom.cc
    code/gazebo/trunk/server/physics/bullet/BulletGeom.hh
    code/gazebo/trunk/server/sensors/imu/ImuSensor.cc
    code/gazebo/trunk/server/sensors/imu/ImuSensor.hh

Modified: code/gazebo/trunk/libgazebo/gz.h
===================================================================
--- code/gazebo/trunk/libgazebo/gz.h    2011-03-29 09:42:13 UTC (rev 9041)
+++ code/gazebo/trunk/libgazebo/gz.h    2011-04-11 22:16:54 UTC (rev 9042)
@@ -1052,6 +1052,7 @@
 {
   public: GazeboData head;
   public: Pose velocity;
+  public: Vec3 eulerAngles;
 };
 
 class ImuIface : public Iface

Modified: code/gazebo/trunk/player/CMakeLists.txt
===================================================================
--- code/gazebo/trunk/player/CMakeLists.txt     2011-03-29 09:42:13 UTC (rev 
9041)
+++ code/gazebo/trunk/player/CMakeLists.txt     2011-04-11 22:16:54 UTC (rev 
9042)
@@ -15,6 +15,7 @@
              GripperInterface.cc
              BumperInterface.cc
              IRInterface.cc
+             ImuInterface.cc
 )
 
 include_directories( 

Modified: code/gazebo/trunk/player/GazeboDriver.cc
===================================================================
--- code/gazebo/trunk/player/GazeboDriver.cc    2011-03-29 09:42:13 UTC (rev 
9041)
+++ code/gazebo/trunk/player/GazeboDriver.cc    2011-04-11 22:16:54 UTC (rev 
9042)
@@ -41,6 +41,7 @@
 #include "BumperInterface.hh"
 #include "GripperInterface.hh"
 #include "IRInterface.hh"
+#include "ImuInterface.hh"
 
 /*
 #include "PowerInterface.hh"
@@ -311,6 +312,10 @@
         ifsrc = new IRInterface( playerAddr,  this, cf, section );
         break;
 
+      case PLAYER_IMU_CODE:
+        if (!player_quiet_startup) printf(" an imu interface.\n");
+        ifsrc = new ImuInterface( playerAddr,  this, cf, section );
+        break;
 
         /*      case PLAYER_POWER_CODE:
                 if (!player_quiet_startup) printf(" a power interface.\n");

Modified: code/gazebo/trunk/server/controllers/imu/Generic_Imu.cc
===================================================================
--- code/gazebo/trunk/server/controllers/imu/Generic_Imu.cc     2011-03-29 
09:42:13 UTC (rev 9041)
+++ code/gazebo/trunk/server/controllers/imu/Generic_Imu.cc     2011-04-11 
22:16:54 UTC (rev 9042)
@@ -35,6 +35,7 @@
 #include "ControllerFactory.hh"
 #include "Generic_Imu.hh"
 #include "ImuSensor.hh"
+#include "Simulator.hh"
 
 using namespace gazebo;
 
@@ -108,13 +109,19 @@
 {
 
   Pose3d velocity;
+  Vector3 eulerAngles;
   velocity = this->myParent->GetVelocity();
+  eulerAngles = this->myParent->GetEulerAngles();
 
   if (this->imuIface->Lock(1))
   {
     // Data timestamp
-    //this->imuIface->data->head.time = Simulator::Instance()->GetSimTime();
+    this->imuIface->data->head.time = 
Simulator::Instance()->GetSimTime().Double();
     
+    this->imuIface->data->eulerAngles.x = eulerAngles[0];
+    this->imuIface->data->eulerAngles.y = eulerAngles[1];
+    this->imuIface->data->eulerAngles.z = eulerAngles[2];
+
     this->imuIface->data->velocity.pos.x = velocity.pos.x;
     this->imuIface->data->velocity.pos.y = velocity.pos.y;
     this->imuIface->data->velocity.pos.z = velocity.pos.z;

Modified: code/gazebo/trunk/server/physics/CMakeLists.txt
===================================================================
--- code/gazebo/trunk/server/physics/CMakeLists.txt     2011-03-29 09:42:13 UTC 
(rev 9041)
+++ code/gazebo/trunk/server/physics/CMakeLists.txt     2011-04-11 22:16:54 UTC 
(rev 9042)
@@ -55,6 +55,7 @@
 )
 
 add_library(gazebo_physics SHARED ${sources})
+target_link_libraries(gazebo_physics ${LINK_LIBS} )
 
 if (CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE})
   set_source_files_properties(${sources} PROPERTIES LINK_FLAGS 

Modified: code/gazebo/trunk/server/physics/bullet/BulletGeom.cc
===================================================================
--- code/gazebo/trunk/server/physics/bullet/BulletGeom.cc       2011-03-29 
09:42:13 UTC (rev 9041)
+++ code/gazebo/trunk/server/physics/bullet/BulletGeom.cc       2011-04-11 
22:16:54 UTC (rev 9042)
@@ -76,13 +76,6 @@
 }
 
 
////////////////////////////////////////////////////////////////////////////////
-// Update
-void BulletGeom::Update()
-{
-  Geom::Update();
-}
-
-////////////////////////////////////////////////////////////////////////////////
 // On pose change
 void BulletGeom::OnPoseChange()
 {

Modified: code/gazebo/trunk/server/physics/bullet/BulletGeom.hh
===================================================================
--- code/gazebo/trunk/server/physics/bullet/BulletGeom.hh       2011-03-29 
09:42:13 UTC (rev 9041)
+++ code/gazebo/trunk/server/physics/bullet/BulletGeom.hh       2011-04-11 
22:16:54 UTC (rev 9042)
@@ -62,9 +62,6 @@
     /// \brief Load the geom
     public: virtual void Save(std::string &prefix, std::ostream &stream);
 
-    /// \brief Update function for geoms
-    public: virtual void Update();
-
     /// \brief On pose change
     public: virtual void OnPoseChange();
 

Modified: code/gazebo/trunk/server/sensors/imu/ImuSensor.cc
===================================================================
--- code/gazebo/trunk/server/sensors/imu/ImuSensor.cc   2011-03-29 09:42:13 UTC 
(rev 9041)
+++ code/gazebo/trunk/server/sensors/imu/ImuSensor.cc   2011-04-11 22:16:54 UTC 
(rev 9042)
@@ -96,6 +96,11 @@
   return this->imuVel;
 }
 
+Vector3 ImuSensor::GetEulerAngles()
+{
+  return this->eulerAngles;
+}
+
 //////////////////////////////////////////////////////////////////////////////
 // Update the sensor information
 void ImuSensor::UpdateChild()
@@ -138,5 +143,6 @@
     this->imuVel.rot.y = velocity.y;
     this->imuVel.rot.z = velocity.z;
 
+    this->eulerAngles = rot;
   }
 }

Modified: code/gazebo/trunk/server/sensors/imu/ImuSensor.hh
===================================================================
--- code/gazebo/trunk/server/sensors/imu/ImuSensor.hh   2011-03-29 09:42:13 UTC 
(rev 9041)
+++ code/gazebo/trunk/server/sensors/imu/ImuSensor.hh   2011-04-11 22:16:54 UTC 
(rev 9042)
@@ -56,9 +56,11 @@
     protected: virtual void FiniChild();
   
     public: Pose3d GetVelocity();
+    public: Vector3 GetEulerAngles();
   
     private: Pose3d prevPose;
     private: Pose3d imuVel;
+    private: Vector3 eulerAngles;
   
   };
 }


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

------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now!  http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to