Skip to content

Commit

Permalink
バージョン番号の変更、互換モード時にアイコンを変えるように変更、コントローラとして優先されるように優先度機能を実装、画面振動機能(スリープ…
Browse files Browse the repository at this point in the history
…防止)を追加
  • Loading branch information
gpsnmeajp committed Jan 15, 2023
1 parent 43ac8be commit b68d224
Show file tree
Hide file tree
Showing 25 changed files with 45 additions and 7 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/logo.pptx
Binary file not shown.
2 changes: 1 addition & 1 deletion setup/vmtsetup_script.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Virtual Motion Tracker"
#define MyAppVersion "0.14e"
#define MyAppVersion "0.14f"
#define MyAppPublisher "gpsnmeajp"
#define MyAppURL "https://github.com/gpsnmeajp/VirtualMotionTracker"
#define MyAppExeName "vmt_manager.exe"
Expand Down
5 changes: 3 additions & 2 deletions vmt_driver/CommunicationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,9 @@ namespace VMTDriver {
const char* name = nullptr;
const char* value = nullptr;

std::string adr = "";
try {
string adr = m.AddressPattern();
adr = m.AddressPattern();
osc::ReceivedMessageArgumentStream args = m.ArgumentStream();

//姿勢情報の受信
Expand Down Expand Up @@ -533,7 +534,7 @@ namespace VMTDriver {
}
catch (osc::Exception& e)
{
LogError("Exp: %s\n", e.what());
LogError("Exp: %s : %s\n", adr.c_str(), e.what());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion vmt_driver/CommunicationManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SOFTWARE.

//通信系の処理の管理、OSC情報の送受信を行う
namespace VMTDriver {
const string Version{ "VMT_014e" };
const string Version{ "VMT_014f" };

class OSCReceiver : public osc::OscPacketListener {
private:
Expand Down
14 changes: 14 additions & 0 deletions vmt_driver/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ namespace VMTDriver {
{
j["DiagLogOnStartup"] = false;
}
if (!j.contains("Priority"))
{
j["Priority"] = 10;
}
return j;
}

Expand Down Expand Up @@ -201,6 +205,10 @@ namespace VMTDriver {
{
m_DiagLogOnStartup = j["DiagLogOnStartup"];
}
if (j.contains("Priority"))
{
m_Priority = j["Priority"];
}
SaveJson(j);
}
catch (...) {
Expand Down Expand Up @@ -345,4 +353,10 @@ namespace VMTDriver {
{
return m_DiagLogOnStartup;
}

//プライオリティを取得する
int Config::GetPriority()
{
return m_Priority;
}
}
2 changes: 2 additions & 0 deletions vmt_driver/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ namespace VMTDriver {
bool m_AddControllerOnStartup{ false };
bool m_AddCompatibleControllerOnStartup{ false };
bool m_DiagLogOnStartup{ false };
int m_Priority{ 10 };

json LoadJson();
void SaveJson(json j);
Expand Down Expand Up @@ -72,5 +73,6 @@ namespace VMTDriver {
bool GetAddControllerOnStartup();
bool GetAddCompatibleControllerOnStartup();
bool GetDiagLogOnStartup();
int GetPriority();
};
}
12 changes: 11 additions & 1 deletion vmt_driver/TrackedDeviceServerDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ namespace VMTDriver {
LogIfETrackedPropertyError(VRProperties()->SetBoolProperty(m_propertyContainer, Prop_HasVirtualDisplayComponent_Bool, false));

//LogIfETrackedPropertyError(VRProperties()->SetStringProperty(m_propertyContainer, vmt_profile.json, "NO_SETTING")); //設定不可
LogIfETrackedPropertyError(VRProperties()->SetInt32Property(m_propertyContainer, Prop_ControllerHandSelectionPriority_Int32, 0));
LogIfETrackedPropertyError(VRProperties()->SetInt32Property(m_propertyContainer, Prop_ControllerHandSelectionPriority_Int32, Config::GetInstance()->GetPriority()));

//コントローラロール登録
if (m_controllerRole == ControllerRole::Left) {
Expand Down Expand Up @@ -1121,6 +1121,16 @@ namespace VMTDriver {
LogIfEVRInputError(VRDriverInput()->CreateScalarComponent(m_propertyContainer, (std::string("/input/finger/middle/value")).c_str(), &TriggerComponent[4], EVRScalarType::VRScalarType_Absolute, EVRScalarUnits::VRScalarUnits_NormalizedOneSided));
LogIfEVRInputError(VRDriverInput()->CreateScalarComponent(m_propertyContainer, (std::string("/input/finger/ring/value")).c_str(), &TriggerComponent[5], EVRScalarType::VRScalarType_Absolute, EVRScalarUnits::VRScalarUnits_NormalizedOneSided));
LogIfEVRInputError(VRDriverInput()->CreateScalarComponent(m_propertyContainer, (std::string("/input/finger/pinky/value")).c_str(), &TriggerComponent[6], EVRScalarType::VRScalarType_Absolute, EVRScalarUnits::VRScalarUnits_NormalizedOneSided));

//互換アイコンにする
LogIfETrackedPropertyError(VRProperties()->SetStringProperty(m_propertyContainer, Prop_NamedIconPathDeviceSearching_String, "{vmt}/icons/Searching32x32_compatible.png"));
LogIfETrackedPropertyError(VRProperties()->SetStringProperty(m_propertyContainer, Prop_NamedIconPathDeviceSearchingAlert_String, "{vmt}/icons/SearchingAlert32x32_compatible.png"));
LogIfETrackedPropertyError(VRProperties()->SetStringProperty(m_propertyContainer, Prop_NamedIconPathDeviceReady_String, "{vmt}/icons/Ready32x32_compatible.png"));
LogIfETrackedPropertyError(VRProperties()->SetStringProperty(m_propertyContainer, Prop_NamedIconPathDeviceReadyAlert_String, "{vmt}/icons/ReadyAlert32x32_compatible.png"));
LogIfETrackedPropertyError(VRProperties()->SetStringProperty(m_propertyContainer, Prop_NamedIconPathDeviceNotReady_String, "{vmt}/icons/NotReady32x32_compatible.png"));
LogIfETrackedPropertyError(VRProperties()->SetStringProperty(m_propertyContainer, Prop_NamedIconPathDeviceStandby_String, "{vmt}/icons/Standby32x32_compatible.png"));
LogIfETrackedPropertyError(VRProperties()->SetStringProperty(m_propertyContainer, Prop_NamedIconPathDeviceStandbyAlert_String, "{vmt}/icons/StandbyAlert32x32_compatible.png"));
LogIfETrackedPropertyError(VRProperties()->SetStringProperty(m_propertyContainer, Prop_NamedIconPathDeviceAlertLow_String, "{vmt}/icons/AlertLow32x32_compatible.png"));
}

m_alreadyRegistered = true;
Expand Down
3 changes: 2 additions & 1 deletion vmt_manager/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<Image DockPanel.Dock="Bottom" Source="Resources/VMTlogo.png" Margin="20,5,20,0"/>
</DockPanel>
</TabItem>
<TabItem Header="RoomSetup">
<TabItem Header="RoomSetup" Height="22" VerticalAlignment="Bottom">
<DockPanel Name="ControlDock" IsEnabled="False">
<TextBlock TextAlignment="Center" Text="Initial setup &amp; Operation check" DockPanel.Dock="Top" Background="#EEEEEE" />
<Grid VerticalAlignment="Top">
Expand Down Expand Up @@ -130,6 +130,7 @@
<TextBlock Text="Set Hand Position (Room)&#xA;(VMT__1, VMT__2)" TextAlignment="Center"/>
</Button>
<TextBlock Text="VMT_0 Joint Serial No" DockPanel.Dock="Top" Margin="1"/>
<CheckBox Content="VMT_0 Position Vibration" Name="VMT_0_PositionVibrationCheckBox" DockPanel.Dock="Top" Margin="1"/>
<TextBox Name="JointSerialNoTextBox" Text="HMD" DockPanel.Dock="Top" Margin="1"/>
<Button DockPanel.Dock="Top" Click="CheckJointPositionButton" Margin="1">
<TextBlock Text="Check VMT__0 Position &#xA;(Try set JointPos=[0.1,0.0,-0.5] )" TextAlignment="Center"/>
Expand Down
12 changes: 11 additions & 1 deletion vmt_manager/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace vmt_manager
/// </summary>
public partial class MainWindow : Window
{
const string Version = "VMT_014e";
const string Version = "VMT_014f";
private DispatcherTimer dispatcherTimer;
Random rnd;
string title = "";
Expand Down Expand Up @@ -400,6 +400,7 @@ private void OnBundle(OscBundle bundle)
}
}

bool vibrationFlag = false;
private void GenericTimer(object sender, EventArgs e)
{
try
Expand Down Expand Up @@ -456,6 +457,15 @@ private void GenericTimer(object sender, EventArgs e)
{
CheckPositionTextBox.Background = new SolidColorBrush(Color.FromRgb(255, 100, 100));
}

if (VMT_0_PositionVibrationCheckBox.IsChecked.Value) {
float vibration = vibrationFlag ? 0.005f : -0.005f;
vibrationFlag = !vibrationFlag;
osc.Send(new OscMessage("/VMT/Room/Driver",
0, 1, 0f,
(float)t1.position.X, (float)t1.position.Y, (float)(t1.position.Z + vibration),
(float)t1.rotation.X, (float)t1.rotation.Y, (float)t1.rotation.Z, (float)t1.rotation.W));
}
}
var t2 = util.GetTransformBySerialNumberRaw("VMT_0");
if (t2 != null)
Expand Down

0 comments on commit b68d224

Please sign in to comment.