diff --git a/vmt_driver/CommunicationManager.cpp b/vmt_driver/CommunicationManager.cpp index f583111..57e95bb 100644 --- a/vmt_driver/CommunicationManager.cpp +++ b/vmt_driver/CommunicationManager.cpp @@ -30,7 +30,7 @@ SOFTWARE. namespace VMTDriver { //�ʃX���b�h - void OSCReceiver::SetPose(bool roomToDriver,int idx, int enable, double x, double y, double z, double qx, double qy, double qz, double qw, double timeoffset, int root_sn) + void OSCReceiver::SetPose(bool roomToDriver,int idx, int enable, double x, double y, double z, double qx, double qy, double qz, double qw, double timeoffset, const char* root_sn) { DriverPose_t pose{ 0 }; pose.poseTimeOffset = timeoffset; @@ -61,7 +61,7 @@ namespace VMTDriver { pose.qRotation.z = qz; pose.qRotation.w = qw; - if (root_sn == 0) { + if (root_sn == nullptr) { //���[���h�E�h���C�o�ϊ��s���ݒ� Eigen::Translation3d pos(RoomToDriverAffin.translation()); Eigen::Quaterniond rot(RoomToDriverAffin.rotation()); @@ -91,12 +91,6 @@ namespace VMTDriver { IVRProperties* props = VRPropertiesRaw(); CVRPropertyHelpers* helper = VRProperties(); - // �f�o�C�X����肷��V���A���i���o�[ - char sn[16]; - sprintf(sn, "LHR-%8x", root_sn); - // TODO: �����̏���������͓���̃p�^�[���œ��삵�Ȃ��”\��������B�”\�ł����OSC��M���_�ŕ�����ɕς����� - - bool deviceFound = false; for (int i = 0; i < 64; i++) { @@ -106,9 +100,9 @@ namespace VMTDriver { PropertyContainerHandle_t h = props->TrackedDeviceToPropertyContainer(i); string SerialNumber = helper->GetStringProperty(h, ETrackedDeviceProperty::Prop_SerialNumber_String); - if (SerialNumber.compare(sn) != 0) continue; + if (SerialNumber.compare(root_sn) != 0) continue; - pose.result = p->eTrackingResult; + pose.result = (ETrackingResult)(p->eTrackingResult); if (p->eTrackingResult == ETrackingResult::TrackingResult_Running_OK) { float* m = (float*)p->mDeviceToAbsoluteTracking.m; @@ -238,9 +232,10 @@ namespace VMTDriver { } else if (adr == "/VMT/Joint/Unity") { - int root_sn, idx, enable; + int idx, enable; float timeoffset; float x, y, z, qx, qy, qz, qw; + const char* root_sn = nullptr; osc::ReceivedMessageArgumentStream args = m.ArgumentStream(); args >> idx >> enable >> timeoffset >> x >> y >> z >> qx >> qy >> qz >> qw >> root_sn >> osc::EndMessage; @@ -248,9 +243,10 @@ namespace VMTDriver { } else if (adr == "/VMT/Joint/Driver") { - int root_sn, idx, enable; + int idx, enable; float timeoffset; float x, y, z, qx, qy, qz, qw; + const char* root_sn = nullptr; osc::ReceivedMessageArgumentStream args = m.ArgumentStream(); args >> idx >> enable >> timeoffset >> x >> y >> z >> qx >> qy >> qz >> qw >> root_sn >> osc::EndMessage; diff --git a/vmt_driver/CommunicationManager.h b/vmt_driver/CommunicationManager.h index 56c8cc9..d8f6857 100644 --- a/vmt_driver/CommunicationManager.h +++ b/vmt_driver/CommunicationManager.h @@ -25,11 +25,11 @@ SOFTWARE. #include "dllmain.h" namespace VMTDriver { - const string Version = "VMT_003"; + const string Version = "VMT_004"; class OSCReceiver : public osc::OscPacketListener { private: - void SetPose(bool roomToDriver, int idx, int enable, double x, double y, double z, double qx, double qy, double qz, double qw, double timeoffset, int root_sn = 0); + void SetPose(bool roomToDriver, int idx, int enable, double x, double y, double z, double qx, double qy, double qz, double qw, double timeoffset, const char* root_sn = nullptr); virtual void ProcessMessage(const osc::ReceivedMessage& m, const IpEndpointName& remoteEndpoint); public: static void OSCReceiver::SendLog(int stat, string msg); diff --git a/vmt_manager/MainWindow.xaml b/vmt_manager/MainWindow.xaml index 4dec2b8..1884bc8 100644 --- a/vmt_manager/MainWindow.xaml +++ b/vmt_manager/MainWindow.xaml @@ -4,8 +4,8 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:vmt_manager" - Width="320" - Height="240" + Width="350" + Height="260" mc:Ignorable="d" Title="VMT Manager" Loaded="Window_Loaded" Closed="Window_Closed" ResizeMode="NoResize"> @@ -54,6 +54,11 @@