Пример #1
0
        public override Action CreateGUI(DisparityImageMsg message, MessageMetadata meta, Texture2D tex)
        {
            if (s_Material == null)
            {
                s_Material = new Material(Shader.Find("Unlit/DisparityImage"));
            }
            Material material = new Material(s_Material);

            material.SetFloat("_MinDisparity", message.min_disparity);
            material.SetFloat("_MaxDisparity", message.max_disparity);

            return(() =>
            {
                message.image.header.GUI();
                GUILayout.Label($"f: {message.f}, T: {message.t}, delta_d:{message.delta_d}");
                GUILayout.Label($"Disparity: [{message.min_disparity}..{message.max_disparity}]");
                GUILayout.Label($"Region of interest: ");
                message.valid_window.GUI();
                tex.GUITexture(material);
            });
        }
            public virtual void AddMessage(Message message)
            {
                MessageMetadata meta = new MessageMetadata(m_Topic, Time.time, DateTime.Now);

                if (!VisualizationUtils.AssertMessageType <T>(message, m_Topic))
                {
                    return;
                }

                m_Message   = (T)message;
                m_Meta      = meta;
                m_GUIAction = null;

                // If messages are coming in faster than 1 per frame, we only update the drawing once per frame
                if (m_IsDrawingEnabled && Time.time > m_LastDrawingFrameTime)
                {
                    Redraw();
                }

                m_LastDrawingFrameTime = Time.time;
            }
 public override Action CreateGUI(WrenchStampedMsg message, MessageMetadata meta) => () =>
 {
     message.header.GUI();
     message.wrench.GUI();
 };
 public override void Draw(Drawing3d drawing, WrenchStampedMsg message, MessageMetadata meta)
 {
     drawing.SetTFTrackingSettings(m_TFTrackingSettings, message.header);
     WrenchDefaultVisualizer.Draw <FLU>(message.wrench, drawing, SelectColor(m_Color, meta), origin.transform.position, lengthScale, sphereRadius, thickness);
 }
Пример #5
0
 public override void Draw(Drawing3d drawing, PolygonStampedMsg message, MessageMetadata meta)
 {
     drawing.SetTFTrackingSettings(m_TFTrackingSettings, message.header);
     PolygonDefaultVisualizer.Draw <FLU>(message.polygon, drawing, SelectColor(m_Color, meta), m_Thickness);
 }
Пример #6
0
        public override void Draw(Drawing3d drawing, TwistWithCovarianceStampedMsg message, MessageMetadata meta)
        {
            drawing.SetTFTrackingSettings(m_TFTrackingSettings, message.header);
            var orig = origin == null ? Vector3.zero : origin.transform.position;

            TwistWithCovarianceDefaultVisualizer.Draw <FLU>(message.twist, drawing, SelectColor(m_Color, meta), orig, lengthScale, sphereRadius, thickness);
        }
Пример #7
0
 public override Action CreateGUI(GoalStatusArrayMsg message, MessageMetadata meta) => () =>
 {
     GUI(message);
 };
        public override void Draw(Drawing3d drawing, TwistMsg message, MessageMetadata meta)
        {
            var orig = origin == null ? Vector3.zero : origin.transform.position;

            Draw <FLU>(message, drawing, SelectColor(m_Color, meta), orig, lengthScale, sphereRadius, thickness);
        }
 public override void Draw(Drawing3d drawing, Vector3StampedMsg message, MessageMetadata meta)
 {
     drawing.SetTFTrackingSettings(m_TFTrackingSettings, message.header);
     Vector3DefaultVisualizer.Draw <FLU>(message.vector, drawing, SelectColor(m_Color, meta), SelectLabel(m_Label, meta), m_Radius);
 }
 public virtual Action CreateGUI(T message, MessageMetadata meta)
 {
     return(VisualizationUtils.CreateDefaultGUI(message, meta));
 }
 public virtual void Draw(Drawing3d drawing, T message, MessageMetadata meta)
 {
 }
 public virtual void Draw(DrawingVisual drawing, T message, MessageMetadata meta)
 {
     Draw(drawing.Drawing, message, meta);
 }
 public string SelectLabel(string userLabel, MessageMetadata meta)
 {
     return(VisualizationUtils.SelectLabel(userLabel, meta));
 }
 public Color SelectColor(Color userColor, MessageMetadata meta)
 {
     return(VisualizationUtils.SelectColor(userColor, meta));
 }
Пример #15
0
 public override Action CreateGUI(TwistStampedMsg message, MessageMetadata meta) => () =>
 {
     message.header.GUI();
     message.twist.GUI();
 };
Пример #16
0
        public static Action CreateDefaultGUI(Message message, MessageMetadata meta)
        {
            string text = message.ToString();

            return(() => { GUILayout.Label(text); });
        }
 public override void Draw(Drawing3d drawing, QuaternionStampedMsg message, MessageMetadata meta)
 {
     drawing.SetTFTrackingSettings(m_TFTrackingSettings, message.header);
     QuaternionDefaultVisualizer.Draw <FLU>(message.quaternion, drawing, m_DrawAtPosition, m_Size, m_DrawUnityAxes);
     drawing.DrawLabel(SelectLabel(m_Label, meta), transform.position, SelectColor(m_Color, meta), m_Size);
 }
 public override void Draw(Drawing3d drawing, TransformMsg message, MessageMetadata meta)
 {
     Draw <FLU>(message, drawing, m_Size, m_DrawUnityAxes);
     drawing.DrawLabel(SelectLabel(m_Label, meta), message.translation.From <FLU>(), SelectColor(m_Color, meta), m_Size);
 }
Пример #19
0
 public override Action CreateGUI(DiagnosticArrayMsg message, MessageMetadata meta) => () =>
 {
     GUI(message);
 };
 public override void Draw(Drawing3d drawing, TransformStampedMsg message, MessageMetadata meta)
 {
     drawing.SetTFTrackingSettings(m_TFTrackingSettings, message.header);
     TransformDefaultVisualizer.Draw <FLU>(message.transform, drawing, m_Size, m_DrawUnityAxes);
     drawing.DrawLabel(SelectLabel(m_Label, meta), message.transform.translation.From <FLU>(), SelectColor(m_Color, meta), m_Size);
 }
 public override Action CreateGUI(TwistMsg message, MessageMetadata meta) => () =>
 {
     message.GUI();
 };
 public override void Draw(Drawing3d drawing, PolygonMsg message, MessageMetadata meta)
 {
     Draw <FLU>(message, drawing, SelectColor(m_Color, meta), m_Thickness);
 }
 public override void Draw(Drawing3d drawing, PointMsg message, MessageMetadata meta)
 {
     Draw <FLU>(message, drawing, SelectColor(m_Color, meta), SelectLabel(m_Label, meta), m_Radius);
 }
 public override void Draw(Drawing3d drawing, QuaternionMsg message, MessageMetadata meta)
 {
     Draw <FLU>(message, drawing, m_DrawAtPosition, m_Size, m_DrawUnityAxes);
     drawing.DrawLabel(SelectLabel(m_Label, meta), transform.position, SelectColor(m_Color, meta), m_Size);
 }
Пример #25
0
 public override Action CreateGUI(TwistWithCovarianceStampedMsg message, MessageMetadata meta) => () =>
 {
     message.header.GUI();
     message.twist.twist.GUI();
     VisualizationUtils.GUIGrid(message.twist.covariance, 6, ref m_ViewCovariance);
 };
Пример #26
0
 public override void Draw(Drawing3d drawing, WrenchMsg message, MessageMetadata meta)
 {
     Draw <FLU>(message, drawing, SelectColor(m_Color, meta), origin.transform.position, lengthScale, sphereRadius, thickness);
 }