public override void Draw(Drawing3d drawing, JointTrajectoryMsg message, MessageMetadata meta)
    {
#if URDF_IMPORTER
        drawing.SetTFTrackingSettings(m_TFTrackingSettings, message.header);
        m_RobotData.DrawJointPaths(drawing, message, SelectColor(m_Color, meta), m_PathThickness);
#endif
    }
    public override void Draw(Drawing3d drawing, MultiDOFJointStateMsg message, MessageMetadata meta)
    {
#if URDF_IMPORTER
        drawing.SetTFTrackingSettings(m_TFTrackingSettings, message.header);
        m_RobotData.DrawGhost(drawing, message, SelectColor(m_Color, meta));
#endif
    }
Beispiel #3
0
    public override void Draw(Drawing3d drawing, JointStateMsg message, MessageMetadata meta)
    {
#if URDF_IMPORTER
        drawing.SetTFTrackingSettings(m_TFTrackingSettings, message.header);
        var color = SelectColor(m_Color, meta);
        m_RobotData.DrawGhost(drawing, message, color);
        if (m_ShowEffort)
        {
            m_RobotData.DrawEffort(drawing, message, color);
        }
#endif
    }
Beispiel #4
0
        public void Redraw()
        {
            if (m_Mesh == null)
            {
                m_Mesh          = new Mesh();
                m_Mesh.vertices = new[]
                { Vector3.zero, new Vector3(0, 0, 1), new Vector3(1, 0, 1), new Vector3(1, 0, 0) };
                m_Mesh.uv        = new[] { Vector2.zero, Vector2.up, Vector2.one, Vector2.right };
                m_Mesh.triangles = new[] { 0, 1, 2, 2, 3, 0 };
            }

            if (m_Material == null)
            {
                m_Material = (m_Settings.m_Material != null) ? new Material(m_Settings.m_Material) : new Material(Shader.Find("Unlit/OccupancyGrid"));
            }
            m_Material.mainTexture = GetTexture();
            m_Material.SetColor(k_Color0, m_Settings.m_Unoccupied);
            m_Material.SetColor(k_Color100, m_Settings.m_Occupied);
            m_Material.SetColor(k_ColorUnknown, m_Settings.m_Unknown);

            var origin   = m_Message.info.origin.position.From <FLU>();
            var rotation = m_Message.info.origin.orientation.From <FLU>();

            rotation.eulerAngles += new Vector3(0, -90, 0); // TODO: Account for differing texture origin
            var scale = m_Message.info.resolution;

            if (m_Drawing == null)
            {
                m_Drawing = Drawing3dManager.CreateDrawing();
            }
            else
            {
                m_Drawing.Clear();
            }

            m_Drawing.SetTFTrackingSettings(m_Settings.m_TFTrackingSettings, m_Message.header);
            // offset the mesh by half a grid square, because the message's position defines the CENTER of grid square 0,0
            Vector3 drawOrigin = origin - rotation * new Vector3(scale * 0.5f, 0, scale * 0.5f) + m_Settings.m_Offset;

            m_Drawing.DrawMesh(m_Mesh, drawOrigin, rotation,
                               new Vector3(m_Message.info.width * scale, 1, m_Message.info.height * scale), m_Material);
        }
Beispiel #5
0
 public override void Draw(Drawing3d drawing, GridCellsMsg message, MessageMetadata meta)
 {
     drawing.SetTFTrackingSettings(m_TFTrackingSettings, message.header);
     Draw <FLU>(message, drawing, SelectColor(m_Color, meta), m_Radius);
 }
Beispiel #6
0
 public override void Draw(Drawing3d drawing, AccelWithCovarianceStampedMsg message, MessageMetadata meta)
 {
     drawing.SetTFTrackingSettings(m_TFTrackingSettings, message.header);
     AccelWithCovarianceDefaultVisualizer.Draw <FLU>(message.accel, drawing, SelectColor(m_Color, meta), m_Origin, m_LengthScale, m_SphereRadius, m_Thickness);
 }
Beispiel #7
0
 public override void Draw(Drawing3d drawing, ImuMsg message, MessageMetadata meta)
 {
     drawing.SetTFTrackingSettings(m_TFTrackingSettings, message.header);
     Draw <FLU>(message, drawing, SelectColor(m_Color, meta), m_LengthScale, m_SphereRadius, m_Thickness);
 }
Beispiel #8
0
 public override void Draw(Drawing3d drawing, PoseStampedMsg message, MessageMetadata meta)
 {
     drawing.SetTFTrackingSettings(m_TFTrackingSettings, message.header);
     PoseDefaultVisualizer.Draw <FLU>(message.pose, drawing, m_Size, m_DrawUnityAxes);
 }
 public override void Draw(Drawing3d drawing, PoseArrayMsg message, MessageMetadata meta)
 {
     drawing.SetTFTrackingSettings(m_TFTrackingSettings, message.header);
     Draw <FLU>(message, drawing, m_Size, m_DrawUnityAxes);
 }
Beispiel #10
0
 public override void Draw(Drawing3d drawing, PathMsg message, MessageMetadata meta)
 {
     drawing.SetTFTrackingSettings(m_TFTrackingSettings, message.header);
     Draw <FLU>(message, drawing, SelectColor(m_Color, meta), m_Thickness, m_Offset);
 }
 public override void Draw(Drawing3d drawing, InertiaStampedMsg message, MessageMetadata meta)
 {
     drawing.SetTFTrackingSettings(m_TFTrackingType, message.header);
     Vector3DefaultVisualizer.Draw <FLU>(message.inertia.com, drawing, m_Origin, SelectColor(m_Color, meta), SelectLabel(m_Label, meta), m_Radius);
 }
 public override void Draw(Drawing3d drawing, MagneticFieldMsg message, MessageMetadata meta)
 {
     drawing.SetTFTrackingSettings(m_TFTrackingSettings, message.header);
     Draw <FLU>(message, drawing, SelectColor(m_Color, meta));
 }