Ejemplo n.º 1
0
    public void Enable(bool enabled)
    {
        isEnabled = enabled;
        objId     = 0;

        if (isEnabled && isFirstEnabled)
        {
            isFirstEnabled = false;
            AgentSetup agentSetup = GetComponentInParent <AgentSetup>();
            if (agentSetup != null && agentSetup.NeedsBridge != null)
            {
                agentSetup.AddToNeedsBridge(this);
            }
        }

        if (detectedObjects != null)
        {
            detectedObjects.Clear();
        }

        if (lidarDetectedColliders != null)
        {
            lidarDetectedColliders.Clear();
        }
    }
Ejemplo n.º 2
0
    public void Enable(bool enabled)
    {
        isEnabled = enabled;
        objId     = 0;

        if (isEnabled && isFirstEnabled)
        {
            isFirstEnabled = false;
            AgentSetup agentSetup = GetComponentInParent <AgentSetup>();
            if (agentSetup != null && agentSetup.NeedsBridge != null)
            {
                agentSetup.AddToNeedsBridge(this);
            }
        }

        groundTruthCamera.enabled = enabled;
        cameraPreview.gameObject.SetActive(enabled);

        if (detectedObjects != null)
        {
            detectedObjects.Clear();
        }

        if (cameraDetectedColliders != null)
        {
            cameraDetectedColliders.Clear();
        }
    }
Ejemplo n.º 3
0
    private void SetLEDColor(LEDColorTypes colorIndex)
    {
        if (isFirstEnabled)
        {
            isFirstEnabled = false;
            AgentSetup agentSetup = GetComponentInParent <AgentSetup>();
            if (agentSetup != null && agentSetup.NeedsBridge != null)
            {
                agentSetup.AddToNeedsBridge(this);
            }
        }

        currentLEDColor = colorIndex;
    }
Ejemplo n.º 4
0
    public void EnableLidarPrediction(bool enabled)
    {
        isLidarPredictionEnabled = enabled;

        if (isLidarPredictionEnabled && isFirstEnabled)
        {
            isFirstEnabled = false;
            AgentSetup agentSetup = GetComponentInParent <AgentSetup>();
            if (agentSetup != null && agentSetup.NeedsBridge != null)
            {
                agentSetup.AddToNeedsBridge(this);
            }
        }

        if (lidarPredictedVisuals != null)
        {
            lidarPredictedVisuals.Clear();
        }

        if (lidarPredictedObjects != null)
        {
            lidarPredictedObjects.Clear();
        }
    }
Ejemplo n.º 5
0
    private void SetTopLightMode(bool enabled)
    {
        isEnabled = enabled;
        if (isFirstEnabled)
        {
            isFirstEnabled = false;
            AgentSetup agentSetup = GetComponentInParent <AgentSetup>();
            if (agentSetup != null && agentSetup.NeedsBridge != null)
            {
                agentSetup.AddToNeedsBridge(this);
            }
        }

        if (enabled == false)
        {
            StopAllCoroutines();
            ToggleTopLight(enabled);
            lightRenderer.material.color = offColor;
        }
        else
        {
            StartCoroutine(BlinkTopLight());
        }
    }