com.yobotics.simulationconstructionset
Class Link

java.lang.Object
  extended by com.yobotics.simulationconstructionset.Link
All Implemented Interfaces:
java.io.Serializable

public class Link
extends java.lang.Object
implements java.io.Serializable

Title: Yobotics! Simulation Construction Set

Description: Package for Simulating Dynamic Robots and Mechanisms

Copyright: Copyright (c) Yobotics, Inc. 2000-2005

Version:
1.0
Author:
Jerry Pratt
See Also:
Serialized Form

Constructor Summary
Link(Link other)
          Copy constructor.
Link(LinkDefinitionFixedFrame linkDefinition)
           
Link(java.lang.String linkName)
          Basic constructor, creates a new link with the specified name.
 
Method Summary
 void addCoordinateSystemToCOM(double length)
          Adds a coordinate system representation at the center of mass of this link.
 void addEllipsoidFromMassProperties()
          Adds an ellipsoid representing the mass and inertia of the link at its center of mass.
 void addEllipsoidFromMassProperties(AppearanceDefinition appearance)
          Adds an ellipsoid representing the mass and inertia of the link at its center of mass with the specified appearance.
 void addToCollisionGroup(CollisionGroup collisionGroup)
          Adds this Link to a CollisionGroup to enable collision detection inside that group or amoung groups.
 void addToCollisionGroups(CollisionGroup[] collisionGroups)
          Adds this Link to all the CollisionGroups listed to enable collision detection inside that group or amoung groups.
 void combineLinks(Link link)
          Combines the specified link with this link.
 void enableCollisions(double maxVelocity, vclip.PolyTree polyTree, Robot rob)
          Enables collisions for this link.
 void getComOffset(javax.vecmath.Vector3d comOffsetRet)
          Stores a vector3d representation of the offset from the links center of mass in the provided variable.
 Graphics3DObject getLinkGraphics()
          Retrieves the LinkGraphics object representing this link.
 double getMass()
          Retrieves the mass of this joint.
 void getMomentOfInertia(javax.vecmath.Matrix3d momentOfInertia)
          Retrieves the moment of inertia for this link.
 java.lang.String getName()
          Retrieves this link's name.
 void setComOffset(double xOffset, double yOffset, double zOffset)
          Sets the offset from the inbound joint to this links center of mass.
 void setComOffset(javax.vecmath.Vector3d comOffset)
          Sets the offset from the inbound joint ot this links center of mass.
 void setLinkGraphics(Graphics3DObject linkGraphics)
          Sets the graphical representation of this link to the provided LinkGraphics.
 void setMass(double mass)
          Sets the mass of this joint.
 void setMassAndRadiiOfGyration(double mass, double radiusOfGyrationX, double radiusOfGyrationY, double radiusOfGyrationZ)
          Sets the mass and moment of inertia of this link.
 void setMomentOfInertia(double Ixx, double Iyy, double Izz)
          Sets the moment of inertia for this link.
 void setMomentOfInertia(javax.vecmath.Matrix3d momentOfInertia)
          Sets the moment of inertia for this link.
 java.lang.String toString()
          Returns a string representation of this link.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Link

public Link(LinkDefinitionFixedFrame linkDefinition)

Link

public Link(java.lang.String linkName)
Basic constructor, creates a new link with the specified name.

Parameters:
linkName - Name for this link.

Link

public Link(Link other)
Copy constructor. Doesn't copy the parentJoint reference.

Parameters:
other - Link to copy
Method Detail

getName

public java.lang.String getName()
Retrieves this link's name.

Returns:
Name of this link.

toString

public java.lang.String toString()
Returns a string representation of this link.
The following is an example of its format:

       Link: <Link Name>
          Mass: <Link Mass>
          COM Offset: <Center of Mass offset>
          Moment of Inertia: 
 m00, m01, m02
 m10, m11, m12
 m20, m21, m22

Overrides:
toString in class java.lang.Object
Returns:
String representation of this link.

combineLinks

public void combineLinks(Link link)
Combines the specified link with this link. This combines their mass, calculates the resulting center of mass, and the new overall inertia of the combined link.

Parameters:
link - Link to be combined with this link.

setMass

public void setMass(double mass)
Sets the mass of this joint. All masses are in kilograms.

Parameters:
mass - New joint mass.

getMass

public double getMass()
Retrieves the mass of this joint. All masses are in kilograms.

Returns:
The mass of this joint.

setMomentOfInertia

public void setMomentOfInertia(double Ixx,
                               double Iyy,
                               double Izz)
Sets the moment of inertia for this link. This is stored as a matrix with the values Ixx, Iyy and Izz representing the positions m00, m11 and m22 respectively.

Ixx 0 0
0 Iyy 0
0 0 Izz
Inertias are represented in units of kg*m^2

Parameters:
Ixx - double
Iyy - double
Izz - double

setMassAndRadiiOfGyration

public void setMassAndRadiiOfGyration(double mass,
                                      double radiusOfGyrationX,
                                      double radiusOfGyrationY,
                                      double radiusOfGyrationZ)
Sets the mass and moment of inertia of this link. The moments of inertia are computed as Ixx = mass * (radiusOfGyrationY * radiusOfGyrationY + radiusOfGyrationZ * radiusOfGyrationY), etc. This is equivalent to the mass being concentrated on the surface of a thin ellipsoid with the given radii of gyration.

Parameters:
mass - Mass of the link.
radiusOfGyrationX - Radius of gyration in the x direction.
radiusOfGyrationY - Radius of gyration in the y direction.
radiusOfGyrationZ - Radius of gyration in the z direction.

setMomentOfInertia

public void setMomentOfInertia(javax.vecmath.Matrix3d momentOfInertia)
Sets the moment of inertia for this link. Inertias are represented in units of kg*m^2

Parameters:
momentOfInertia - Matrix3d representing the moment of inertia

getMomentOfInertia

public void getMomentOfInertia(javax.vecmath.Matrix3d momentOfInertia)
Retrieves the moment of inertia for this link. Inertias are represented in units of kg*m^2

Parameters:
momentOfInertia - Matrix3d representation of the moment of inertia.

setComOffset

public void setComOffset(double xOffset,
                         double yOffset,
                         double zOffset)
Sets the offset from the inbound joint to this links center of mass. The inbound joint is usually the parent to the link in question. This defaults to 0,0,0 and must be specified prior to simulation if accurate results are desired.

Parameters:
xOffset - Offset in the x direction.
yOffset - Offset in the y direction.
zOffset - Offset in the z direction.

setComOffset

public void setComOffset(javax.vecmath.Vector3d comOffset)
Sets the offset from the inbound joint ot this links center of mass.

Parameters:
comOffset - Vector3d representing the offset.

getComOffset

public void getComOffset(javax.vecmath.Vector3d comOffsetRet)
Stores a vector3d representation of the offset from the links center of mass in the provided variable.

Parameters:
comOffsetRet - Vector3d in which the offset will be stored.

setLinkGraphics

public void setLinkGraphics(Graphics3DObject linkGraphics)
Sets the graphical representation of this link to the provided LinkGraphics. LinkGraphics store the graphical data for each link allowing different shapes and features to be created and stored.

Parameters:
linkGraphics - LinkGraphics to be used for this link.

getLinkGraphics

public Graphics3DObject getLinkGraphics()
Retrieves the LinkGraphics object representing this link.

Returns:
LinkGraphics representing the graphical properties of this link.

enableCollisions

public void enableCollisions(double maxVelocity,
                             vclip.PolyTree polyTree,
                             Robot rob)
Enables collisions for this link.

Parameters:
maxVelocity - Maximum velocity of any point on the link. Used for improving collision detection performance.
polyTree - PolyTree defining collision geometry.

addToCollisionGroup

public void addToCollisionGroup(CollisionGroup collisionGroup)
Adds this Link to a CollisionGroup to enable collision detection inside that group or amoung groups.

Parameters:
collisionGroup - CollisionGroup to add this Link to.

addToCollisionGroups

public void addToCollisionGroups(CollisionGroup[] collisionGroups)
Adds this Link to all the CollisionGroups listed to enable collision detection inside that group or amoung groups.

Parameters:
collisionGroups - CollisionGroup array to add this Link to.

addEllipsoidFromMassProperties

public void addEllipsoidFromMassProperties()
Adds an ellipsoid representing the mass and inertia of the link at its center of mass. This ellipsoid has a default matte black appearance.


addCoordinateSystemToCOM

public void addCoordinateSystemToCOM(double length)
Adds a coordinate system representation at the center of mass of this link. The axis of this system have the given length.

Parameters:
length - length in meters of each arm/axis on the coordinate system.

addEllipsoidFromMassProperties

public void addEllipsoidFromMassProperties(AppearanceDefinition appearance)
Adds an ellipsoid representing the mass and inertia of the link at its center of mass with the specified appearance.

Parameters:
appearance - Appearance to be used with the ellipsoid. See YoAppearance for implementations.