This commit is contained in:
Hartmut Seichter 2025-07-01 22:38:23 +02:00
parent 5eed33260a
commit 1cc6380a57
3 changed files with 78 additions and 43 deletions

View file

@ -12,7 +12,7 @@ size = Vector2(6, 2)
[node name="Node3D" type="Node3D"] [node name="Node3D" type="Node3D"]
[node name="Camera3D" type="Camera3D" parent="."] [node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0, 0.663209, -0.79419) transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0, 0.355791, -1.59348)
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] [node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.878275, 0.266876, -0.396749, -7.71365e-11, 0.829749, 0.558137, 0.478155, 0.490197, -0.728748, 0, 0.631436, 0) transform = Transform3D(-0.878275, 0.266876, -0.396749, -7.71365e-11, 0.829749, 0.558137, 0.478155, 0.490197, -0.728748, 0, 0.631436, 0)
@ -22,8 +22,7 @@ shadow_enabled = true
[node name="VRPN" type="Node3D" parent="Root" node_paths=PackedStringArray("tracker_receivers")] [node name="VRPN" type="Node3D" parent="Root" node_paths=PackedStringArray("tracker_receivers")]
script = ExtResource("2_24d08") script = ExtResource("2_24d08")
tracker_receivers = [NodePath("RB1"), NodePath("RB2")] tracker_receivers = [NodePath("RB1"), NodePath("RB2"), NodePath("../SpinTracker/Offset0/Tracker0"), NodePath("../SpinTracker/Tracker1"), NodePath("../SpinTracker/Offset2/Tracker2")]
vrpn_server = "212.201.64.122"
[node name="RB1" type="Node3D" parent="Root/VRPN"] [node name="RB1" type="Node3D" parent="Root/VRPN"]
script = ExtResource("2_170dk") script = ExtResource("2_170dk")
@ -46,3 +45,37 @@ mesh = SubResource("PlaneMesh_24d08")
[node name="Wall" type="MeshInstance3D" parent="Root"] [node name="Wall" type="MeshInstance3D" parent="Root"]
transform = Transform3D(-1, 8.74228e-08, -3.82137e-15, 0, -4.37114e-08, -1, -8.74228e-08, -1, 4.37114e-08, 0, 0.93633, 1.06259) transform = Transform3D(-1, 8.74228e-08, -3.82137e-15, 0, -4.37114e-08, -1, -8.74228e-08, -1, 4.37114e-08, 0, 0.93633, 1.06259)
mesh = SubResource("PlaneMesh_24d08") mesh = SubResource("PlaneMesh_24d08")
[node name="SpinTracker" type="Node3D" parent="Root"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.764802, 0)
[node name="Tracker1" type="Node3D" parent="Root/SpinTracker"]
script = ExtResource("2_170dk")
tracker_name = "Tracker1"
[node name="Box2" type="MeshInstance3D" parent="Root/SpinTracker/Tracker1"]
mesh = SubResource("BoxMesh_24d08")
skeleton = NodePath("../../RB1")
[node name="Offset2" type="Node3D" parent="Root/SpinTracker"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.40838, 0, 0)
[node name="Tracker2" type="Node3D" parent="Root/SpinTracker/Offset2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.40838, 0, 0)
script = ExtResource("2_170dk")
tracker_name = "Tracker2"
[node name="Box2" type="MeshInstance3D" parent="Root/SpinTracker/Offset2/Tracker2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.40838, 0, 0)
mesh = SubResource("BoxMesh_24d08")
skeleton = NodePath("../../RB1")
[node name="Offset0" type="Node3D" parent="Root/SpinTracker"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0)
[node name="Tracker0" type="Node3D" parent="Root/SpinTracker/Offset0"]
script = ExtResource("2_170dk")
[node name="Box2" type="MeshInstance3D" parent="Root/SpinTracker/Offset0/Tracker0"]
mesh = SubResource("BoxMesh_24d08")
skeleton = NodePath("../../RB1")

View file

@ -8,7 +8,7 @@ class_name VRPN_Receiver
func _on_pos_quat(tracker_data : Dictionary): func _on_pos_quat(tracker_data : Dictionary):
if tracker_data['tracker'] == tracker_name and tracker_data['sensor'] == tracker_sensor: if tracker_data['tracker'] == tracker_name and tracker_data['sensor'] == tracker_sensor:
self.global_position = tracker_data['position'] #self.global_position = tracker_data['position']
var rotation := tracker_data['rotation'] as Quaternion var rotation := tracker_data['rotation'] as Quaternion
self.global_basis = Basis(rotation) self.global_basis = Basis(rotation)

View file

@ -40,7 +40,9 @@
# float z_of_axis_to_spin_around # float z_of_axis_to_spin_around
# float rotation_rate_around_axis_in_Hz # float rotation_rate_around_axis_in_Hz
vrpn_Tracker_Spin Tracker0 1 200.0 0.0 1.0 0.0 0.1 vrpn_Tracker_Spin Tracker0 1 200.0 1.0 0.0 0.0 0.1
vrpn_Tracker_Spin Tracker1 1 200.0 0.0 1.0 0.0 0.2
vrpn_Tracker_Spin Tracker2 1 200.0 0.0 0.0 1.0 0.3
################################################################################ ################################################################################
# WintrackerIII from VR SPace # WintrackerIII from VR SPace
@ -1533,19 +1535,19 @@ vrpn_Tracker_Spin Tracker0 1 200.0 0.0 1.0 0.0 0.1
############################################################################## ##############################################################################
# PhaseSpace Impulse system. This device type is not compiled by default, since # PhaseSpace Impulse system. This device type is not compiled by default, since
# it uses a proprietary library. However, you can get it to compile by # it uses a proprietary library. However, you can get it to compile by
# defining VRPN_INCLUDE_PHASESPACE and including the appropriate libraries # defining VRPN_INCLUDE_PHASESPACE and including the appropriate libraries
# and headers when compiling (See vrpn_Configure.h). # and headers when compiling (See vrpn_Configure.h).
# #
# Arguments: # Arguments:
# char tracker_name[] # Tracker0, Tracker1, ... etc # char tracker_name[] # Tracker0, Tracker1, ... etc
# [Additional lines specifying tracker configuration] # [Additional lines specifying tracker configuration]
# #
# The section following the Tracker declaration is a tag delimited set of # The section following the Tracker declaration is a tag delimited set of
# lines which specify system configuration and vrpn sensors. The section begins # lines which specify system configuration and vrpn sensors. The section begins
# with an <owl> tag and ends with a </owl> tag. Each tag must be on a separate # with an <owl> tag and ends with a </owl> tag. Each tag must be on a separate
# line. (see below) # line. (see below)
# #
# Each line in the specification section is a white-space separated set of # Each line in the specification section is a white-space separated set of
# key-value pairs. At most one sensor is defined per line. The sensor and type # key-value pairs. At most one sensor is defined per line. The sensor and type
# keys are mandatory. Other keys are are required based on the type. # keys are mandatory. Other keys are are required based on the type.
@ -1553,8 +1555,8 @@ vrpn_Tracker_Spin Tracker0 1 200.0 0.0 1.0 0.0 0.1
# Comments can be embedded with the '#' character. # Comments can be embedded with the '#' character.
# #
# Example: # Example:
# #
# vrpn_Tracker_PhaseSpace Tracker0 # vrpn_Tracker_PhaseSpace Tracker0
# <owl> # <owl>
# device="192.168.1.1" # device="192.168.1.1"
# frequency=960 # frequency=960
@ -1577,7 +1579,7 @@ vrpn_Tracker_Spin Tracker0 1 200.0 0.0 1.0 0.0 0.1
# ====================== # ======================
# #
# device # device
# A string specifying the IP address of the Impulse server to connect to. # A string specifying the IP address of the Impulse server to connect to.
# #
# frequency # frequency
# A floating-point number specifying the system streaming frequency. # A floating-point number specifying the system streaming frequency.
@ -1592,7 +1594,7 @@ vrpn_Tracker_Spin Tracker0 1 200.0 0.0 1.0 0.0 0.1
# An integer. Set to zero to disable. Specifying 1 for drop_frames will # An integer. Set to zero to disable. Specifying 1 for drop_frames will
# cause the server to drop frames in order to get the most recent data on # cause the server to drop frames in order to get the most recent data on
# every run through the mainloop. This may be desirable for most VR # every run through the mainloop. This may be desirable for most VR
# applications and for slower machines. # applications and for slower machines.
# #
# debug # debug
# An integer. Zero to disable. Specifying 1 for debug will cause the server # An integer. Zero to disable. Specifying 1 for debug will cause the server
@ -1607,7 +1609,7 @@ vrpn_Tracker_Spin Tracker0 1 200.0 0.0 1.0 0.0 0.1
# #
# type # type
# A string which specifies what type the sensor is. Required if sensor is # A string which specifies what type the sensor is. Required if sensor is
# specified. The following types are supported: # specified. The following types are supported:
# point # point
# rigid # rigid
# rigid_body (deprecated) # rigid_body (deprecated)
@ -1619,23 +1621,23 @@ vrpn_Tracker_Spin Tracker0 1 200.0 0.0 1.0 0.0 0.1
# led # led
# An integer which specifies the led id of a sensor. # An integer which specifies the led id of a sensor.
# Required if type is "point". # Required if type is "point".
# #
# pos # pos
# An optional comma-separated list of three floating-point numbers specifying # An optional comma-separated list of three floating-point numbers specifying
# the 3D position of a marker on a rigid body. No spaces. Valid if type is # the 3D position of a marker on a rigid body. No spaces. Valid if type is
# "point". Specifying positions is only valid if the tracker number is set # "point". Specifying positions is only valid if the tracker number is set
# to a rigid body. The units MUST be in millimeters, regardless of scale # to a rigid body. The units MUST be in millimeters, regardless of scale
# setting. # setting.
# #
# init # init
# An optional comma-separated list of four floating-point numbers specifying # An optional comma-separated list of four floating-point numbers specifying
# kalman parameters for a rigid body. Valid if type is "rigid_body". # kalman parameters for a rigid body. Valid if type is "rigid_body".
# #
# #
# For support, questions, comments, or bug reports please send emails # For support, questions, comments, or bug reports please send emails
# to: support@phasespace.com # to: support@phasespace.com
# #
#vrpn_Tracker_PhaseSpace Tracker0 #vrpn_Tracker_PhaseSpace Tracker0
#<owl> #<owl>
#device="192.168.1.230" #device="192.168.1.230"
#frequency=480 #frequency=480
@ -2454,8 +2456,8 @@ vrpn_Tracker_Spin Tracker0 1 200.0 0.0 1.0 0.0 0.1
#vrpn_Tracker_FilterOneEuro Filter0 *Tracker0 2 1.15 1.0 1.2 1.5 5.0 1.2 #vrpn_Tracker_FilterOneEuro Filter0 *Tracker0 2 1.15 1.0 1.2 1.5 5.0 1.2
################################################################################ ################################################################################
# Sensics zSight HMD with built-in tracker. This is an inertial tracker that # Sensics zSight HMD with built-in tracker. This is an inertial tracker that
# gives orientation information, but no position (the tracker reports # gives orientation information, but no position (the tracker reports
# (0, 0, 0) for position). # (0, 0, 0) for position).
# #
# Arguments: # Arguments:
@ -2531,19 +2533,19 @@ vrpn_Tracker_Spin Tracker0 1 200.0 0.0 1.0 0.0 0.1
# To access Polhemus G4 on Windows using the Polhemus PDI library, # To access Polhemus G4 on Windows using the Polhemus PDI library,
# use vrpn_Tracker_G4. # use vrpn_Tracker_G4.
# #
# The vrpn_Tracker_G4 tracker definition requires the tracker name and # The vrpn_Tracker_G4 tracker definition requires the tracker name and
# the vrpn server name for the tracker, followed by an optional Server Poll rate, # the vrpn server name for the tracker, followed by an optional Server Poll rate,
# and on the next line, the file path to the .g4c configuration file: # and on the next line, the file path to the .g4c configuration file:
# #
# vrpn_Tracker_G4 G4 \ # vrpn_Tracker_G4 G4 \
# C:\filepath\source_config_file.g4c # C:\filepath\source_config_file.g4c
# #
# The Server Poll Rate is optional. # The Server Poll Rate is optional.
# If it is not specified, the VRPN server will poll for new data at a rate of 120 frames per second. # If it is not specified, the VRPN server will poll for new data at a rate of 120 frames per second.
# (120 frames per second is the default output rate of G4 hardware.) # (120 frames per second is the default output rate of G4 hardware.)
# #
# If you wish to poll at a slower rate than the tracker, you may specify any number. For example, if # If you wish to poll at a slower rate than the tracker, you may specify any number. For example, if
# you wish to poll 20 times per second, then specify a poll rate of 20. # you wish to poll 20 times per second, then specify a poll rate of 20.
# #
# The '\' at the end of the first line, after the server name, is optional and # The '\' at the end of the first line, after the server name, is optional and
# will be disregarded. A '\' on a subsequent line means that further commands # will be disregarded. A '\' on a subsequent line means that further commands
@ -2774,30 +2776,30 @@ vrpn_Tracker_Spin Tracker0 1 200.0 0.0 1.0 0.0 0.1
# To access Polhemus FasTrak on Windows using the Polhemus PDI library, # To access Polhemus FasTrak on Windows using the Polhemus PDI library,
# use vrpn_Tracker_FastrakPDI. # use vrpn_Tracker_FastrakPDI.
# #
# The vrpn_Tracker_FastrakPDI tracker definition requires the tracker name and # The vrpn_Tracker_FastrakPDI tracker definition requires the tracker name and
# the vrpn server name for the tracker, followed by an optional Server Poll rate: # the vrpn server name for the tracker, followed by an optional Server Poll rate:
# #
# vrpn_Tracker_FastrakPDI myFastrak4 30\ <-valid # vrpn_Tracker_FastrakPDI myFastrak4 30\ <-valid
# vrpn_Tracker_FastrakPDI myFastrak2 60\ <-valid # vrpn_Tracker_FastrakPDI myFastrak2 60\ <-valid
# vrpn_Tracker_FastrakPDI myFastrak1 \ <-valid # vrpn_Tracker_FastrakPDI myFastrak1 \ <-valid
# #
# The Server Poll Rate is optional. # The Server Poll Rate is optional.
# If it is not specified, the VRPN server will poll for new data at a rate of 120 frames per second. # If it is not specified, the VRPN server will poll for new data at a rate of 120 frames per second.
# (120 frames per second is the default output rate of FasTrak hardware with ONE sensor connected.) # (120 frames per second is the default output rate of FasTrak hardware with ONE sensor connected.)
# #
# For FasTrak trackers the update rate depends on the number of sensors connected to the device: # For FasTrak trackers the update rate depends on the number of sensors connected to the device:
# Number of Sensors Update Rate # Number of Sensors Update Rate
# ----------------- ----------- # ----------------- -----------
# 1 120 frames/sec # 1 120 frames/sec
# 2 60 frames/sec # 2 60 frames/sec
# 3 40 frames/sec # 3 40 frames/sec
# 4 30 frames/sec # 4 30 frames/sec
# #
# If you wish to poll at the same rate as the tracker output, then you must specify the poll rate # If you wish to poll at the same rate as the tracker output, then you must specify the poll rate
# to match the update rate in the table above. # to match the update rate in the table above.
# #
# If you wish to poll at a slower rate than the tracker, you may specify any number. For example, if # If you wish to poll at a slower rate than the tracker, you may specify any number. For example, if
# you wish to poll 20 times per second, then specify and update rate of 20. # you wish to poll 20 times per second, then specify and update rate of 20.
# #
# The '\' at the end of the first line, after the server name, is optional and will be disregarded. # The '\' at the end of the first line, after the server name, is optional and will be disregarded.
# a '\' on a subsequent line means that further commands are to be input. The format is to have # a '\' on a subsequent line means that further commands are to be input. The format is to have
@ -2870,7 +2872,7 @@ vrpn_Tracker_Spin Tracker0 1 200.0 0.0 1.0 0.0 0.1
# -collects a second single pno to confirm this removal (P) and # -collects a second single pno to confirm this removal (P) and
# -finally returns to binary mode before passing control to VRPN (F1<>). # -finally returns to binary mode before passing control to VRPN (F1<>).
# The trackers name is TrackerJoe. # The trackers name is TrackerJoe.
# The server poll rate is 120 Hz. # The server poll rate is 120 Hz.
# vrpn_Tracker_FastrakPDI TrackerJoe 120\ # vrpn_Tracker_FastrakPDI TrackerJoe 120\
# PDIStylus 1\ # PDIStylus 1\
@ -2892,7 +2894,7 @@ vrpn_Tracker_Spin Tracker0 1 200.0 0.0 1.0 0.0 0.1
# To access Polhemus Liberty or Patriot on Windows using the Polhemus PDI library, # To access Polhemus Liberty or Patriot on Windows using the Polhemus PDI library,
# use vrpn_Tracker_LibertyPDI. # use vrpn_Tracker_LibertyPDI.
# #
# The vrpn_Tracker_LibertyPDI tracker definition requires the tracker name and # The vrpn_Tracker_LibertyPDI tracker definition requires the tracker name and
# the vrpn server name for the tracker, followed by an optional Server Poll rate: # the vrpn server name for the tracker, followed by an optional Server Poll rate:
# #
# vrpn_Tracker_LibertyPDI MyLiberty 240\ <-valid # vrpn_Tracker_LibertyPDI MyLiberty 240\ <-valid
@ -2901,16 +2903,16 @@ vrpn_Tracker_Spin Tracker0 1 200.0 0.0 1.0 0.0 0.1
# #
# Note that "Tracker_LibertyPDI" is used for both Polhemus Patriot and Liberty tracker hardware! # Note that "Tracker_LibertyPDI" is used for both Polhemus Patriot and Liberty tracker hardware!
# #
# The Server Poll Rate is optional. # The Server Poll Rate is optional.
# If it is not specified, the VRPN server will poll for new data at a rate of 60 frames per second. # If it is not specified, the VRPN server will poll for new data at a rate of 60 frames per second.
# (60 frames per second is the default output rate of Patriot tracker hardware.) # (60 frames per second is the default output rate of Patriot tracker hardware.)
# #
# For Liberty trackers, the default rate is 240 frames per second. If you wish for the server to poll # For Liberty trackers, the default rate is 240 frames per second. If you wish for the server to poll
# at this rate, then you must specify 240! # at this rate, then you must specify 240!
# #
# If you wish to poll at a slower rate than the tracker, you may specify any number. For example, if # If you wish to poll at a slower rate than the tracker, you may specify any number. For example, if
# you wish to poll 20 times per second, then specify and update rate of 20. # you wish to poll 20 times per second, then specify and update rate of 20.
# #
# The '\' at the end of the first line, after the server name, is optional and will be disregarded. # The '\' at the end of the first line, after the server name, is optional and will be disregarded.
# a '\' on a subsequent line means that further commands are to be input. The format is to have # a '\' on a subsequent line means that further commands are to be input. The format is to have
# one command per line. Each line that isn't the final line must end in a '\'. The final line should not # one command per line. Each line that isn't the final line must end in a '\'. The final line should not
@ -2929,7 +2931,7 @@ vrpn_Tracker_Spin Tracker0 1 200.0 0.0 1.0 0.0 0.1
# #
# Note: The R command is used to set the Liberty tracker update rate. This command has no effect on Patriot. # Note: The R command is used to set the Liberty tracker update rate. This command has no effect on Patriot.
# For Liberty, if you use the R command to change the update rate, remember to change the Server Poll Rate # For Liberty, if you use the R command to change the update rate, remember to change the Server Poll Rate
# specification in the tracker definition (like "MyPolhemus" example above). # specification in the tracker definition (like "MyPolhemus" example above).
# Command Syntax: # Command Syntax:
# Every command, except P (gather single pno frame), requires a carriage return on the end. Carriage # Every command, except P (gather single pno frame), requires a carriage return on the end. Carriage
@ -3003,7 +3005,7 @@ vrpn_Tracker_Spin Tracker0 1 200.0 0.0 1.0 0.0 0.1
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Finally the default config below: # Finally the default config below:
# -May be used for a Liberty or a Patriot tracker # -May be used for a Liberty or a Patriot tracker
# -Polls the tracker 60 times per second # -Polls the tracker 60 times per second
# -Sets tracker output to ASCII # -Sets tracker output to ASCII
# -Queries the tracker for WhoAmI information # -Queries the tracker for WhoAmI information
# -Sets the output back to Binary # -Sets the output back to Binary
@ -3159,7 +3161,7 @@ vrpn_Tracker_Spin Tracker0 1 200.0 0.0 1.0 0.0 0.1
#vrpn_Tracker_DeadReckoning_Rotation Tracker1 *Tracker0 2 0.0333 #vrpn_Tracker_DeadReckoning_Rotation Tracker1 *Tracker0 2 0.0333
################################################################################ ################################################################################
# OSVR Hacker Dev Kit inertial measurement unit. This is an inertial tracker that # OSVR Hacker Dev Kit inertial measurement unit. This is an inertial tracker that
# gives orientation information, but no position. Position values are always # gives orientation information, but no position. Position values are always
# 0. Version 1 of this device sends only poses. Version 2 also sends velocity # 0. Version 1 of this device sends only poses. Version 2 also sends velocity
# reports. # reports.
@ -3170,7 +3172,7 @@ vrpn_Tracker_Spin Tracker0 1 200.0 0.0 1.0 0.0 0.1
#vrpn_Tracker_OSVRHackerDevKit Tracker0 #vrpn_Tracker_OSVRHackerDevKit Tracker0
################################################################################ ################################################################################
# Oculus Rift DK1 and DK2. There are two versions of the DK2 driver, which use the # Oculus Rift DK1 and DK2. There are two versions of the DK2 driver, which use the
# same hardware but in two different modes. # same hardware but in two different modes.
# #
# vrpn_Oculus_DK2_inertial: Oculus DK2 inertial measurement unit only. This # vrpn_Oculus_DK2_inertial: Oculus DK2 inertial measurement unit only. This