Skip to content

Commit

Permalink
pointcloud subcsriber more smooth bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaqchen committed May 5, 2023
1 parent 4390975 commit b4eff1a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
24 changes: 18 additions & 6 deletions UnitySample/Assets/Scenes/PointCloudSample.unity
Original file line number Diff line number Diff line change
Expand Up @@ -637,11 +637,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1b5029f5d0d1a754f8a40677a100352f, type: 3}
m_Name:
m_EditorClassIdentifier:
maxChunkSize: 65535
pointSize: 0.001
pointCloudElem: {fileID: 7258565985952825044, guid: 0e103885be9aa884ebc9d16411d8b804,
type: 3}
pointCloudMaterial: {fileID: 2100000, guid: 410bd770d3b6d8943be1474daa7e822c, type: 2}
visTopicsTabGameObject: {fileID: 0}
configReader: {fileID: 0}
--- !u!1 &177338861
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -5192,7 +5189,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
FinishedReader: 0
ip: 192.168.1.24
ip: 192.168.1.114
port: 9090
--- !u!4 &1119771596
Transform:
Expand Down Expand Up @@ -5758,6 +5755,7 @@ GameObject:
- component: {fileID: 1404162259}
- component: {fileID: 1404162258}
- component: {fileID: 1404162257}
- component: {fileID: 1404162260}
m_Layer: 0
m_Name: VisualizationSuite
m_TagString: Untagged
Expand Down Expand Up @@ -5806,6 +5804,20 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1404162260
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1404162256}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1b5029f5d0d1a754f8a40677a100352f, type: 3}
m_Name:
m_EditorClassIdentifier:
visTopicsTabGameObject: {fileID: 1404162256}
configReader: {fileID: 1119771595}
--- !u!1 &1473865778
GameObject:
m_ObjectHideFlags: 0
Expand Down
2 changes: 1 addition & 1 deletion UnitySample/Assets/Scipts/PointCloudRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class PointCloudRenderer : MonoBehaviour

IEnumerator Start()
{
yield return new WaitForSeconds(5f);
yield return new WaitUntil(() => configReader.FinishedReader);

ros = ROSConnection.GetOrCreateInstance();
VisualizationTopicsTab vistab = visTopicsTabGameObject.GetComponent<VisualizationTopicsTab>();
Expand Down
6 changes: 3 additions & 3 deletions UnitySample/Assets/Scipts/ResearchModeVideoStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ enum DepthSensorMode

public GameObject pointCloudRendererGo;
public Color pointColor = Color.white;
private PointCloudRenderer pointCloudRenderer;
// private PointCloudRenderer pointCloudRenderer;
#if ENABLE_WINMD_SUPPORT
Windows.Perception.Spatial.SpatialCoordinateSystem unityWorldOrigin;
#endif
Expand Down Expand Up @@ -203,7 +203,7 @@ IEnumerator Start()

if (pointCloudRendererGo != null)
{
pointCloudRenderer = pointCloudRendererGo.GetComponent<PointCloudRenderer>();
// pointCloudRenderer = pointCloudRendererGo.GetComponent<PointCloudRenderer>();
}

tcpClient = GetComponent<TCPClient>();
Expand Down Expand Up @@ -579,7 +579,7 @@ private void UpdatePointCloud()
pointCloudVector3[i] = new Vector3(pointCloud[3 * i], pointCloud[3 * i + 1], pointCloud[3 * i + 2]);
}
text.text = "Point Cloud Length: " + pointCloudVector3.Length.ToString();
pointCloudRenderer.Render(pointCloudVector3, pointColor);
// pointCloudRenderer.Render(pointCloudVector3, pointColor);

// JULIA: Send the Vector3[] of point cloud to ROS
// Convert to byte[]
Expand Down
4 changes: 4 additions & 0 deletions UnitySample/ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ PlayerSettings:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 2420876100349834260, guid: 93290558a36e1bf479f221bb2102f8da, type: 2}
- {fileID: -1027307087885609928, guid: 88b27548eb377ad429d9f99648ed4213, type: 2}
- {fileID: 0}
metroInputSource: 0
wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1
Expand Down

0 comments on commit b4eff1a

Please sign in to comment.