Beispiel #1
0
        public void _Reads_Link_Visual_Geometry()
        {
            robot.ConstructFromString(urdfString);

            Link sensorLink = robot.links.Find(link => link.name == "sensor_link");

            Link.Geometry        geometry = sensorLink.visuals[0].geometry;
            Link.Geometry.Sphere sphere   = geometry.sphere;
            Assert.That(sphere.radius, Is.EqualTo(0.1d));

            Link baseLink = robot.links.Find(link => link.name == "base_link");

            Link.Geometry.Mesh mesh = baseLink.visuals[0].geometry.mesh;
            Assert.That(mesh.filename, Is.EqualTo("filename.stl"));
            Assert.That(mesh.scale, Is.EqualTo(new[] { 0.001d, 0.001d, 0.001d }));
        }
Beispiel #2
0
        private Godot.Mesh CreateSphere(
            Link.Geometry.Sphere sphere,
            SpatialMaterial mat = null)
        {
            SphereMesh temp = new SphereMesh();

            if (mat != null)
            {
                temp.Material = mat;
            }

            temp.RadialSegments = 16;
            temp.Radius         = (float)sphere.radius;
            temp.Height         = (float)(sphere.radius * 2.0);

            return(temp);
        }