Commit 547f3bcd authored by Sam Horvath's avatar Sam Horvath
Browse files

ENH: Added keypress recalibration fo IMU

parent ca5c1ef5
......@@ -32,6 +32,7 @@ VRPNArduinoDeviceClient::initModule()
m_vrpnAnalog = std::make_shared<vrpn_Analog_Remote>(fullDeviceIp);
m_vrpnAnalog->register_change_handler(this, analogChangeHandler);
m_vrpnAnalog->shutup = true;
}
void
......@@ -43,9 +44,10 @@ VRPNArduinoDeviceClient::runModule()
void
VRPNArduinoDeviceClient::cleanUpModule()
{
m_vrpnAnalog->unregister_change_handler(this, analogChangeHandler);
//Module cleanup is causing TCP errors - seems to work fine without it
//m_vrpnAnalog->unregister_change_handler(this, analogChangeHandler);
//m_vrpnAnalog.reset();
m_vrpnAnalog.reset();
}
......
......@@ -60,6 +60,24 @@ FLSCameraController::setArduinoDevice(std::shared_ptr<VRPNArduinoDeviceClient> a
arduinoClient = aClient;
}
void
FLSCameraController::recalibrate()
{
if (arduinoActive & calibrated)
{
if (arduinoClient->getRoll() != 0)
{
m_rollOffset = arduinoClient->getRoll();
std::cout << "FLS Camera Controller: Calibration complete" << std::endl;
calibrated = true;
}
else
{
std::cout << "FLS Camera Controller: Cannot calibrate - device still warming up" << std::endl;
}
}
}
void
FLSCameraController::runModule()
{
......@@ -72,7 +90,7 @@ FLSCameraController::runModule()
{
if (arduinoClient->getRoll() != 0)
{
std::cout << "FLS Camera Controller: Calibration complete; Safe to move camera" << std::endl;
std::cout << "FLS Camera Controller: Autocalibration complete" << std::endl;
m_rollOffset = arduinoClient->getRoll();
calibrated = true;
}
......
......@@ -62,6 +62,8 @@ public:
void setArduinoDevice(std::shared_ptr<VRPNArduinoDeviceClient> aClient);
void recalibrate();
protected:
///
......
Supports Markdown
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