Skip to content

Commit 8906010

Browse files
authored
feat: 469 pathfinder probes should directly assign position (#470)
* Reload addressable assets, test pathway set pos * Split EchoPosition for pathfinder * Get angles and display position * Hide all manipulator options on connect * Create new blank probe * Copy pos and angles to probes * Bump minimum Ephys Link version * Change probes to be a new color
1 parent 8824f3b commit 8906010

17 files changed

Lines changed: 151 additions & 1451 deletions

Assets/AddressableAssets/Probes/neuropixels_2_1shank.csv

Lines changed: 0 additions & 1281 deletions
This file was deleted.

Assets/AddressableAssets/Probes/neuropixels_2_1shank.csv.meta

Lines changed: 0 additions & 7 deletions
This file was deleted.

Assets/AddressableAssets/Probes/pipette.csv

Lines changed: 0 additions & 51 deletions
This file was deleted.

Assets/AddressableAssets/Probes/pipette.csv.meta

Lines changed: 0 additions & 7 deletions
This file was deleted.

Assets/AddressableAssetsData/AssetGroups/ChannelMaps.asset

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,6 @@ MonoBehaviour:
3333
m_Address: Assets/AddressableAssets/Probes/ucla_256f.csv
3434
m_ReadOnly: 0
3535
m_SerializedLabels: []
36-
- m_GUID: f1ddfb9f17fe7ac4bb5bb3feedfd1a20
37-
m_Address: Assets/AddressableAssets/Probes/pipette.csv
38-
m_ReadOnly: 0
39-
m_SerializedLabels: []
40-
- m_GUID: 64c963c2ae3683240948c96550cd9a30
41-
m_Address: Assets/AddressableAssets/Probes/neuropixels_2_1shank.csv
42-
m_ReadOnly: 0
43-
m_SerializedLabels: []
4436
m_ReadOnly: 0
4537
m_Settings: {fileID: 11400000, guid: 2d938794e1ac8154b9b50ee21079a3c4, type: 2}
4638
m_SchemaSet:

Assets/AddressableAssetsData/AssetGroups/IBLCoverage.asset

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ MonoBehaviour:
1616
m_Data:
1717
m_SerializedData: []
1818
m_GUID: 60e030281a7a04e4da761d562ee4a9a1
19-
m_SerializeEntries:
20-
- m_GUID: 2124a773640cd7a4ab491730a80306a1
21-
m_Address: Assets/AddressableAssets/IBL/coverage_indexes.bytes
22-
m_ReadOnly: 0
23-
m_SerializedLabels: []
19+
m_SerializeEntries: []
2420
m_ReadOnly: 0
2521
m_Settings: {fileID: 11400000, guid: 2d938794e1ac8154b9b50ee21079a3c4, type: 2}
2622
m_SchemaSet:

Assets/AddressableAssetsData/AssetGroups/Skull.asset

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,7 @@ MonoBehaviour:
1616
m_Data:
1717
m_SerializedData: []
1818
m_GUID: aa120eec9de0cf94e95f6071b46259fe
19-
m_SerializeEntries:
20-
- m_GUID: 604a5f8d7d36f4c4c972a69cda8175bc
21-
m_Address: Assets/AddressableAssets/3D/skull.obj
22-
m_ReadOnly: 0
23-
m_SerializedLabels: []
24-
- m_GUID: 7b59397650a2ef247959f166f102568c
25-
m_Address: Assets/AddressableAssets/3D/skull.prefab
26-
m_ReadOnly: 0
27-
m_SerializedLabels: []
19+
m_SerializeEntries: []
2820
m_ReadOnly: 0
2921
m_Settings: {fileID: 11400000, guid: 2d938794e1ac8154b9b50ee21079a3c4, type: 2}
3022
m_SchemaSet:

Assets/Prefabs/UI/SettingsMenu/Menus/ManipulatorConnection.prefab

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,6 +1866,7 @@ MonoBehaviour:
18661866
_manipulatorIdText: {fileID: 8699707721372442200}
18671867
_handednessGroup: {fileID: 8999800724767590326}
18681868
_handednessDropdown: {fileID: 3448694691357484443}
1869+
_probeConnectionGroup: {fileID: 534869223622348013}
18691870
_linkedProbeDropdown: {fileID: 5200381531337403621}
18701871
_probePropertiesSection: {fileID: 5769491651499729191}
18711872
_zeroCoordinateXInputField: {fileID: 3125666136600695602}

Assets/Scripts/EphysLink/CommunicationManager.cs

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ private void Awake()
2121

2222
#region Variables
2323

24-
public static readonly int[] EPHYS_LINK_MIN_VERSION = { 0, 9, 7 };
24+
public static readonly int[] EPHYS_LINK_MIN_VERSION = { 0, 9, 9 };
2525

2626
public static readonly string EPHYS_LINK_MIN_VERSION_STRING = "≥ v" + string.Join(".", EPHYS_LINK_MIN_VERSION);
2727

@@ -262,6 +262,36 @@ public void GetPos(string manipulatorId, Action<Vector4> onSuccessCallback,
262262
}
263263
}).Emit("get_pos", manipulatorId);
264264
}
265+
266+
/// <summary>
267+
/// Request the current angles of a manipulator.
268+
/// </summary>
269+
/// <param name="manipulatorId">ID of the manipulator to get the position of</param>
270+
/// <param name="onSuccessCallback">Callback function to pass manipulator angles to</param>
271+
/// <param name="onErrorCallback">Callback function to handle errors</param>
272+
public void GetAngles(string manipulatorId, Action<Vector3> onSuccessCallback,
273+
Action<string> onErrorCallback = null)
274+
{
275+
_connectionManager.Socket.ExpectAcknowledgement<AngularCallbackParameters>(data =>
276+
{
277+
if (data.error == "")
278+
{
279+
try
280+
{
281+
onSuccessCallback?.Invoke(new Vector3(data.angles[0], data.angles[1], data.angles[2]));
282+
}
283+
catch (Exception e)
284+
{
285+
onErrorCallback?.Invoke(e.ToString());
286+
}
287+
}
288+
else
289+
{
290+
onErrorCallback?.Invoke(data.error);
291+
Debug.LogWarning(data.error);
292+
}
293+
}).Emit("get_angles", manipulatorId);
294+
}
265295

266296
/// <summary>
267297
/// Request a manipulator be moved to a specific position.

Assets/Scripts/EphysLink/DataFormats.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,15 @@ public struct PositionalCallbackParameters
123123
public string error;
124124
}
125125

126+
/// <summary>
127+
/// Returned callback data format from angular data.
128+
/// </summary>
129+
public struct AngularCallbackParameters
130+
{
131+
public float[] angles;
132+
public string error;
133+
}
134+
126135
/// <summary>
127136
/// Returned callback data format from driving to depth.
128137
/// </summary>

0 commit comments

Comments
 (0)