Commit 53c929da authored by Alexis Girault's avatar Alexis Girault

ENH: Get rid of offset on VRPN Client side

The offset should only be defined at the
controller level

Also remove useless include in VRPNDeviceServer
parent 7a1c6928
......@@ -31,8 +31,6 @@ VRPNDeviceClient::initModule()
{
auto fullDeviceIp = this->getName().c_str();
m_offsetSet = false;
m_vrpnTracker = std::make_shared<vrpn_Tracker_Remote>(fullDeviceIp);
m_vrpnAnalog = std::make_shared<vrpn_Analog_Remote>(fullDeviceIp);
m_vrpnButton = std::make_shared<vrpn_Button_Remote>(fullDeviceIp);
......@@ -100,14 +98,7 @@ VRPNDeviceClient::trackerChangeHandler(void *userData, const _vrpn_TRACKERCB t)
quat.y() = t.quat[1];
quat.z() = t.quat[2];
quat.w() = t.quat[3];
if(!deviceClient->m_offsetSet)
{
deviceClient->m_rotOffset = quat.inverse();
deviceClient->m_offsetSet = true;
return;
}
deviceClient->m_orientation = deviceClient->m_rotOffset * quat;
deviceClient->m_orientation = quat;
//LOG(DEBUG) << "tracker: position = " << t.pos[0] << " " << t.pos[1] << " " << t.pos[2];
//LOG(DEBUG) << "tracker: orientation = " << deviceClient->m_orientation.matrix();
......
......@@ -125,9 +125,6 @@ private:
std::shared_ptr<vrpn_Analog_Remote> m_vrpnAnalog; //!< VRPN position/orientation interface
std::shared_ptr<vrpn_Button_Remote> m_vrpnButton; //!< VRPN button interface
std::shared_ptr<vrpn_ForceDevice_Remote> m_vrpnForceDevice; //!< VRPN force interface
bool m_offsetSet = false;
Quatd m_rotOffset = Quatd::Identity();
};
}
......
......@@ -32,7 +32,6 @@
// imstk
#include "imstkModule.h"
#include "imstkVRPNDeviceClient.h"
namespace imstk
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment