All Downloads are FREE. Search and download functionalities are using the official Maven repository.

us.ihmc.simulationconstructionset.robotdefinition.LinkDefinitionFixedFrame Maven / Gradle / Ivy

There is a newer version: 0.25.2
Show newest version
package us.ihmc.simulationconstructionset.robotdefinition;

import us.ihmc.euclid.matrix.Matrix3D;
import us.ihmc.euclid.tuple3D.Vector3D;
import us.ihmc.graphicsDescription.Graphics3DObject;
import us.ihmc.graphicsDescription.instructions.Graphics3DPrimitiveInstruction;
import us.ihmc.simulationconstructionset.util.XMLReaderUtility;

public class LinkDefinitionFixedFrame
{
   private String name;
   private double mass;
   private Vector3D comOffset = new Vector3D();
   private Matrix3D momentOfInertia = new Matrix3D();
   private Graphics3DObject graphicsDefinition = new Graphics3DObject();

   public String getName()
   {
      return name;
   }

   public void setName(String name)
   {
      this.name = name;
   }

   public double getMass()
   {
      return mass;
   }

   public void setMass(double mass)
   {
      this.mass = mass;
   }

   public Vector3D getComOffset()
   {
      return comOffset;
   }

   public void setComOffset(Vector3D comOffset)
   {
      this.comOffset = comOffset;
   }

   public Matrix3D getInertia()
   {
      return momentOfInertia;
   }

   public void setInertia(Matrix3D inertia)
   {
      momentOfInertia = inertia;
   }

   public Graphics3DObject getGraphicsDefinition()
   {
      return graphicsDefinition;
   }

   public void setLinkGraphics(Graphics3DObject graphicsDefinition)
   {
      this.graphicsDefinition = graphicsDefinition;
   }

   @Override
   public String toString()
   {
      String returnString = "\t\n";

      returnString += "\t\t" + mass + "\n";
      //      returnString += "Mass = " + mass + "\n";

      returnString += "\t\t" + comOffset + "\n";
      //      returnString += "comOffset = " + comOffset + "\n";

      returnString += "\t\t" + XMLReaderUtility.matrix3DToString(momentOfInertia) + "\n";
      //      returnString += "momentOfInertia = \n" + momentOfInertia + "\n";

      returnString += "\t\t\n";
      //      returnString +="***************************** GRAPHICS START************************************\n";
      if (graphicsDefinition != null)
      {
         for (Graphics3DPrimitiveInstruction instruction : graphicsDefinition.getGraphics3DInstructions())
         {
            returnString += instruction;
         }
      }
      returnString += "\t\t\n";
      //      returnString +="***************************** GRAPHICS END************************************\n";

      returnString += "\t\n";

      return returnString;
   }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy