Skip to content

Commit 85cad70

Browse files
fixed stereo rendering
1 parent 26ec2dd commit 85cad70

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

Assets/Components/CameraView/Prefabs/CameraViewer.prefab

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2919,7 +2919,7 @@ MonoBehaviour:
29192919
m_FallbackScreenDPI: 96
29202920
m_DefaultSpriteDPI: 96
29212921
m_DynamicPixelsPerUnit: 5
2922-
m_PresetInfoIsWorld: 0
2922+
m_PresetInfoIsWorld: 1
29232923
--- !u!114 &4205178368271638321
29242924
MonoBehaviour:
29252925
m_ObjectHideFlags: 0

Assets/Components/StereoImage/Prefabs/StereoViewer Variant.prefab

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,22 @@ PrefabInstance:
2020
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
2121
value: StereoStreamer, Assembly-CSharp
2222
objectReference: {fileID: 0}
23+
- target: {fileID: 2406882672257423557, guid: 2a50976a1f24dd8098ca2921520cdf15, type: 3}
24+
propertyPath: m_SortingLayer
25+
value: 0
26+
objectReference: {fileID: 0}
2327
- target: {fileID: 2645893342989272051, guid: 2a50976a1f24dd8098ca2921520cdf15, type: 3}
2428
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
2529
value:
2630
objectReference: {fileID: 78685895570833187}
31+
- target: {fileID: 3303167026125507273, guid: 2a50976a1f24dd8098ca2921520cdf15, type: 3}
32+
propertyPath: m_SortingLayer
33+
value: 0
34+
objectReference: {fileID: 0}
35+
- target: {fileID: 3303167026125507273, guid: 2a50976a1f24dd8098ca2921520cdf15, type: 3}
36+
propertyPath: m_Materials.Array.data[0]
37+
value:
38+
objectReference: {fileID: 2100000, guid: ae13b1e0136c4a26f89ca873c89e8bb1, type: 2}
2739
- target: {fileID: 4244529357589432071, guid: 2a50976a1f24dd8098ca2921520cdf15, type: 3}
2840
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
2941
value:
@@ -114,7 +126,7 @@ PrefabInstance:
114126
objectReference: {fileID: 0}
115127
- target: {fileID: 4784887247087540269, guid: 2a50976a1f24dd8098ca2921520cdf15, type: 3}
116128
propertyPath: m_PresetInfoIsWorld
117-
value: 1
129+
value: 0
118130
objectReference: {fileID: 0}
119131
- target: {fileID: 5106567488347881522, guid: 2a50976a1f24dd8098ca2921520cdf15, type: 3}
120132
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target

Assets/Components/StereoImage/Scripts/StereoStreamer.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ protected override void UpdateTopics(Dictionary<string, string> topics)
4040
if (topic.Value == "sensor_msgs/Image" || topic.Value == "sensor_msgs/CompressedImage")
4141
{
4242
// issue with depth images at the moment
43-
if (topic.Key.Contains("left"))
43+
if (topic.Key.ToLowerInvariant().Contains("left"))
4444
options.Add(topic.Key);
4545
}
4646
}
@@ -53,6 +53,7 @@ protected override void UpdateTopics(Dictionary<string, string> topics)
5353
topicDropdown.ClearOptions();
5454
topicDropdown.AddOptions(options);
5555
topicDropdown.value = Mathf.Min(_lastSelected, options.Count - 1);
56+
5657
}
5758

5859
/// <summary>
@@ -88,7 +89,7 @@ public override void OnTopicChange(string topic)
8889
{
8990
nameText.text = topic;
9091

91-
if (topic == null)
92+
if (string.IsNullOrEmpty(topic))
9293
{
9394
topicName = null;
9495
// set texture to grey
@@ -103,6 +104,8 @@ public override void OnTopicChange(string topic)
103104
return;
104105
}
105106

107+
topicName = topic;
108+
106109
if (topicName.EndsWith("compressed"))
107110
{
108111
_ros.Subscribe<CompressedImageMsg>(topicName, OnCompressedLeft);

0 commit comments

Comments
 (0)