From 190526de1c57359ca434b7cd62979e9f1fda619e Mon Sep 17 00:00:00 2001 From: Shi Xiang <794392187@qq.com> Date: Fri, 18 Oct 2024 18:17:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git commit -m 修改代码“ --- .idea/.gitignore | 3 +++ .idea/.name | 1 + .idea/LightHouse.iml | 8 ++++++++ .idea/inspectionProfiles/Project_Default.xml | 13 +++++++++++++ .idea/inspectionProfiles/profiles_settings.xml | 6 ++++++ .idea/misc.xml | 4 ++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ Code/triad_openvr/tracker_test.py | 18 +++++++++++------- 9 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/.name create mode 100644 .idea/LightHouse.iml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..3288925 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +tracker_test.py \ No newline at end of file diff --git a/.idea/LightHouse.iml b/.idea/LightHouse.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/LightHouse.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..a296dd2 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..3005a7b --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..97b75ca --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Code/triad_openvr/tracker_test.py b/Code/triad_openvr/tracker_test.py index bac3d50..0d3b2ff 100644 --- a/Code/triad_openvr/tracker_test.py +++ b/Code/triad_openvr/tracker_test.py @@ -17,10 +17,14 @@ if interval: while(True): start = time.time() txt = "" - for each in v.devices["hmd_1"].get_pose_euler(): - txt += "%.4f" % each - txt += " " - print("\r" + txt, end="") - sleep_time = interval-(time.time()-start) - if sleep_time>0: - time.sleep(sleep_time) \ No newline at end of file + pose_euler = v.devices["hmd_1"].get_pose_euler() + if pose_euler is not None: + for each in pose_euler: + txt += "%.4f" % each + txt += " " + print("\r" + txt, end="") + sleep_time = interval - (time.time() - start) + if sleep_time > 0: + time.sleep(sleep_time) + else: + print("定位器超出基站扫描视野范围!") \ No newline at end of file