us.ihmc.scs2.definition.robot.urdf.items.URDFLink Maven / Gradle / Ivy
package us.ihmc.scs2.definition.robot.urdf.items;
import java.util.Collections;
import java.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* ROS Specification link.
*
* @author Sylvain Bertrand
*/
@XmlType(propOrder = {"name", "inertial", "visual", "collision"})
public class URDFLink implements URDFItem
{
private String name;
private URDFInertial inertial;
private List visuals;
private List collisions;
@XmlAttribute(name = "name")
public void setName(String name)
{
this.name = name;
}
@XmlElement(name = "inertial")
public void setInertial(URDFInertial inertial)
{
this.inertial = inertial;
}
@XmlElement(name = "visual")
public void setVisual(List visual)
{
this.visuals = visual;
}
@XmlElement(name = "collision")
public void setCollision(List collision)
{
this.collisions = collision;
}
public String getName()
{
return name;
}
public URDFInertial getInertial()
{
return inertial;
}
public List getVisual()
{
return visuals;
}
public List getCollision()
{
return collisions;
}
@Override
public String getContentAsString()
{
return format("[name: %s, inertial: %s, visual: %s, collision: %s]", name, inertial, visuals, collisions);
}
@Override
public String toString()
{
return itemToString();
}
@Override
public List getFilenameHolders()
{
return URDFItem.combineItemListsFilenameHolders(Collections.singletonList(inertial), visuals, collisions);
}
}