Skip to content

Commit 3fb0922

Browse files
committed
added ref_position_offset to ssr_client; added single ref_orientation shift and continous ref_position_offset shift to lwfs second instance;
1 parent 41376e6 commit 3fb0922

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

opti_ssr/bridges.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ def __init__(self, optitrack, ssr, ssr_virt_repr, N, R, rb_id=0, *args, **kwargs
175175

176176
# second ssr instance feat. virtual sources as reproduction setup
177177
self._ssr_virt_repr = ssr_virt_repr
178+
# reference orientation of this instance has to be changed once
179+
# in order to compensate for the SSRs standard reference orientation shift
180+
self._ssr_virt_repr.set_ref_orientation(0)
178181

179182
# self._create_virtual_sources()
180183

@@ -212,4 +215,5 @@ def _send(self, center):
212215
# sending position data to SSR; number of source id depends on number of existing sources
213216
for src_id in range(1, self._N+1):
214217
self._ssr.set_src_position(src_id, src_pos[src_id-1, 0], src_pos[src_id-1, 1])
215-
self._ssr_virt_repr.set_ref_position(center[0], center[1])
218+
self._ssr.set_ref_offset_position(center[0], center[1])
219+
self._ssr_virt_repr.set_ref_position(center[0], center[1])

opti_ssr/ssr_client.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ def set_ref_position(self, x, y):
4646
ref_position = '<request><reference><position x="{0}" y="{1}"/></reference></request>'.format(x, y)+self._end_message
4747
self._s.send(ref_position.encode())
4848

49+
def set_ref_offset_position(self, x, y):
50+
"""
51+
Set reference offset position in meters.
52+
"""
53+
ref_offset_position = '<request><reference_offset><position x="{0}" y="{1}"/></reference_offset></request>'.format(x, y)+self._end_message
54+
self._s.send(ref_offset_position.encode())
55+
4956
def set_ref_orientation(self, alpha):
5057
"""
5158
Set reference orientation in degrees (zero in positive x-direction).

0 commit comments

Comments
 (0)