Revision: 9078
          http://playerstage.svn.sourceforge.net/playerstage/?rev=9078&view=rev
Author:   jpgr87
Date:     2011-11-01 00:00:59 +0000 (Tue, 01 Nov 2011)
Log Message:
-----------
Applied patch #3420949: Adding Euler offset function to IMU interface.

Modified Paths:
--------------
    code/player/trunk/client_libs/libplayerc/dev_imu.c
    code/player/trunk/client_libs/libplayerc/playerc.h
    code/player/trunk/client_libs/libplayerc++/imuproxy.cc
    code/player/trunk/client_libs/libplayerc++/playerc++.h
    code/player/trunk/libplayerinterface/interfaces/060_imu.def

Modified: code/player/trunk/client_libs/libplayerc/dev_imu.c
===================================================================
--- code/player/trunk/client_libs/libplayerc/dev_imu.c  2011-10-16 21:13:16 UTC 
(rev 9077)
+++ code/player/trunk/client_libs/libplayerc/dev_imu.c  2011-11-01 00:00:59 UTC 
(rev 9078)
@@ -175,3 +175,19 @@
                                  PLAYER_IMU_REQ_RESET_ORIENTATION,
                                  &config, NULL));
 }
+
+// Reset euler orientation
+int
+playerc_imu_reset_euler (playerc_imu_t *device, float roll,
+        float pitch, float yaw)
+{
+    player_imu_reset_euler_config_t config;
+    config.orientation.proll = roll;
+    config.orientation.ppitch = pitch;
+    config.orientation.pyaw = yaw;
+    
+    return (playerc_client_request(device->info.client,
+                                   &device->info,
+                                   PLAYER_IMU_REQ_RESET_EULER,
+                                   &config, NULL));
+ }

Modified: code/player/trunk/client_libs/libplayerc/playerc.h
===================================================================
--- code/player/trunk/client_libs/libplayerc/playerc.h  2011-10-16 21:13:16 UTC 
(rev 9077)
+++ code/player/trunk/client_libs/libplayerc/playerc.h  2011-11-01 00:00:59 UTC 
(rev 9078)
@@ -3678,6 +3678,9 @@
 /**  Reset orientation. */
 PLAYERC_EXPORT int playerc_imu_reset_orientation (playerc_imu_t *device, int 
value);
 
+/**  Reset euler orientation. */
+PLAYERC_EXPORT int playerc_imu_reset_euler(playerc_imu_t *device, float roll, 
float pitch, float yaw);
+
 /** @} */
 /***************************************************************************/
 

Modified: code/player/trunk/client_libs/libplayerc++/imuproxy.cc
===================================================================
--- code/player/trunk/client_libs/libplayerc++/imuproxy.cc      2011-10-16 
21:13:16 UTC (rev 9077)
+++ code/player/trunk/client_libs/libplayerc++/imuproxy.cc      2011-11-01 
00:00:59 UTC (rev 9078)
@@ -154,7 +154,15 @@
     throw PlayerError("ImuProxy::ResetOrientation()", "error resetting 
orientation");
 }
 
+void
+ImuProxy::ResetEuler(float aRoll, float aPitch, float aYaw)
+{
+  boost::mutex::scoped_lock lock(mPc->mMutex);
 
+  if (0 != playerc_imu_reset_euler(mDevice, aRoll, aPitch, aYaw))
+    throw PlayerError("ImuProxy::ResetEuler()", "error resetting euler 
orientation");
+}
+
 std::ostream&
 std::operator << (std::ostream &os, const PlayerCc::ImuProxy &c)
 {

Modified: code/player/trunk/client_libs/libplayerc++/playerc++.h
===================================================================
--- code/player/trunk/client_libs/libplayerc++/playerc++.h      2011-10-16 
21:13:16 UTC (rev 9077)
+++ code/player/trunk/client_libs/libplayerc++/playerc++.h      2011-11-01 
00:00:59 UTC (rev 9078)
@@ -990,6 +990,8 @@
     /**  Reset orientation. */
     void ResetOrientation(int aValue);
 
+    /**  Reset euler orientation */
+    void ResetEuler(float aRoll, float aPitch, float aYaw);
 
 };
 

Modified: code/player/trunk/libplayerinterface/interfaces/060_imu.def
===================================================================
--- code/player/trunk/libplayerinterface/interfaces/060_imu.def 2011-10-16 
21:13:16 UTC (rev 9077)
+++ code/player/trunk/libplayerinterface/interfaces/060_imu.def 2011-11-01 
00:00:59 UTC (rev 9078)
@@ -22,6 +22,8 @@
 message { REQ, SET_DATATYPE, 1, player_imu_datatype_config_t };
 /** Request/reply subtype: reset orientation */
 message { REQ, RESET_ORIENTATION, 2, player_imu_reset_orientation_config_t };
+/** Request/reply subtype: reset euler values */
+message { REQ, RESET_EULER, 3, player_imu_reset_euler_config_t };
 
 /** @brief Data: calibrated IMU data (@ref PLAYER_IMU_DATA_STATE)
 
@@ -129,3 +131,12 @@
   /** driver-specific */
   uint32_t value;
 } player_imu_reset_orientation_config_t;
+
+/** @brief Request/reply: Reset euler orientation.
+
+To reset the IMU's euler orientation, send a @ref PLAYER_IMU_REQ_RESET_EULER
+request.  Null response */
+typedef struct player_imu_reset_euler_config
+{
+    player_pose3d_t orientation;
+} player_imu_reset_euler_config_t;

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


------------------------------------------------------------------------------
Get your Android app more play: Bring it to the BlackBerry PlayBook 
in minutes. BlackBerry App World&#153; now supports Android&#153; Apps 
for the BlackBerry&reg; PlayBook&#153;. Discover just how easy and simple 
it is! http://p.sf.net/sfu/android-dev2dev
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to