Assembly< DataType, dim > Class Template Reference

#include <Assembly.h>

List of all members.

Public Types

typedef Part< DataType, dim > PartType
typedef ads::FixedArray< dim,
DataType
point_type
typedef ads::FixedArray< dim, int > multi_index_type

Public Member Functions

 Assembly ()
 Assembly (const base &v)
 ~Assembly ()
virtual void setDim ()
virtual std::vector< int > & IdTag ()
virtual void setIdTag (std::vector< int > val)
virtual std::string Name ()
virtual void setName (std::string val)
virtual baseGetWorld ()
virtual void setDHMat (MType val)
virtual MType GetDHMat ()
virtual void AddPart (PartType *v)
virtual void AddPart (PartType &v)
virtual int GetNumParts ()
virtual PartTypeGetNthPart (int n)
virtual void AddSubAssembly (base *v)
virtual void AddSubAssembly (base &v)
virtual int GetNumSubAssemblies ()
virtual baseGetNthSubAssembly (int n)
virtual void setAssemblyTmatrix ()
virtual void setAssemblyTmatrix (const MType ttemp)
virtual MTypegetAssemblyTmatrix ()
void setAssemblyMotion (MType &Tmatrix)
void updateAssembly (DataType dt, DataType time, MType transform, int level)
void resetAssembly ()
void partPressureForces (multi_index_type *cons, DataType *press, DataType scale)
virtual void logPartLoads (std::ofstream &ofs, DataType time_, int steps)
void send2CPT (int &nump, int &numc, point_type *vertices, multi_index_type *connections, DataType scale)
void vel2CPT (int &totPoints, point_type *velocities, DataType scale)
int GetNumPoints ()
void GetNumPC (int &pcount, int &ccount)
void print (int level)
void printSummary (int level)
virtual void outputAssembly_Brep3D (DataType time, int pc, int pointCount[], int &pp, FILE *fout)
virtual void outputAssembly_STL (DataType time, FILE *fout)
virtual void Restart (std::ifstream &ifs, int &pos, double &t, double &dt)
virtual void Checkpointing (std::ofstream &ofs)
virtual PTypeGetVerticies ()
virtual multi_index_typeGetConnections ()
virtual void makeVerticies (int n)
virtual void makeConnections (int n)
virtual PType surfacePoint (PType I_A, DataType zmin, int flag)
virtual PType surfacePoint (PType I_A, DataType zmin, int flag, DataType off)

Protected Attributes

std::vector< int > idTag
std::string name
bool mobile
MType AssemblyTmatrix
MType MotionTmatrix
std::vector< basesubAssemblies
std::vector< PartType * > parts
int num_subAssemblies
int num_parts
MType DHMat
MType DHMat_old
baseparent
std::vector< int > edges
int component
int backedge
int gdistance
PTypeverticies
multi_index_typeconnections

Detailed Description

template<class DataType, int dim>
class Assembly< DataType, dim >


http://en.wikipedia.org/wiki/Denavit–Hartenberg_parameters
http://elvis.rowan.edu/~kay/papers/kinematics.pdf
www.site.uottawa.ca/~petriu/generalrobotics.org-ppp-Kinematics_final.ppt‎

Geometry Solver USAGE:
initialize: parts and assemblies are read or created from input files.
set up:

getGeometry: called at each coupling time step

  1. Deformable Parts are updated in their native coordinate frame based on prescribed local transformations or on the fly based on
    output from a coupled (kinetic) solver.
  2. Kinematic update (mobile chains only)
    1. Denavit-Hartenberg joint parameters are updated by prescription, based on part deformation,
      from a coupled (kinetic) solver, or any combination there in.
    2. Denavit-Hartenberg matrixes are updated for parts and assemblies.
  3. All mobile parts are updated to their pose relative to the Scene's coordinate frame by using the following Denavit-Hartenberg matrixes to tranform the part's cPoints.
    • $ Part^{Scene}_{Native} = \left[T^{Scene}_0\right] \, \left[T^0_{Native}\right] \times Part.cPoints $
    1. Part boundaries (2D:curves, 3D:surfaces) are sent to AMROC-FSI
    2. If this is an output time step part boundaries are output along with selected simulation variables
    3. If kinematicOutput is selected Denavit-Hartenberg parameters are output
    4. If constructionOutput is selcted the curves, splines, points, and vectors, used in constructing parts and assemblies will be output

Kinematic solver
Motions and deformations can be prescribed a priori or determined on the fly from a coupled kinetic solver.

  1. Part: Updates Denavit-Hartenberg parameters for part deformation or for precribed
    changes in joint position and/or orientation.
    • part deformation can cause changes in $ d, r, \alpha, \theta$ due to:
      • $\Delta\,orientation :=$ angle3D(change in facet normal) in $link_i$'s frame
      • $\Delta\,position :=$ change in facet centroids in $link_i$'s frame
  2. Part and Assembly: Updates DH parameters for prescribed joint motions
    (joint axis revolution/translation $:= q_{pre}$)

CAPABILITY / STRUCTURE NOTATION
Attachment class functionality deprecated by Denavit-Hartenberg Link and Joint classes.
DH_Link class

Joint class

Kinematic Chain Class

================================================================================================

Scene:

================================================================================================

Denavit-Hartenberg kinematic chain
Link
Joint to Parent Joint to Child
$ i $ $ r $ $ \alpha $ $ d $ $ \theta $ $ q_{pre} $ $ O $ $ \vec{X} $ $ \vec{Y} $ $ \vec{Z} $ idTag $ ParentP $ $ \vec{ParentN} $ facet Id facet Orientation jointType idTag $ ChildP $ $ \vec{ChildN} $ facet Id facet Orientation jointType
1 Assembly Base$ O_0 $ Base $ \vec{Z}_0 $ NONE NONE Part / Assembly $ O_1 $ $ \vec{Z}_1 $ outward
2 Part / Assembly $ \mapsto \, \vec{ChildN}_1 $ inward Part / Assembly outward
$ \vdots $
$ i $ Part / Assembly $ \mapsto \, \vec{ChildN}_{i-1} $ inward Part / Assembly outward
$ \vdots $
$ \mathcal{N} $ Part / Assembly $ \mapsto \, \vec{ChildN}_{\mathcal{N}-1} $ inward Part / Assembly $ O_{Native} $ $ \vec{Z}_{Native} $ NONE NONE

================================================================================================

Denavit-Hartenberg convention and algorithm:
The four parameters $r_i, \alpha_i, d_i$, and $\theta_i$ in $ (\star) $ are generally
given the names link length, link twist, link offset, and joint angle, respectively.

  1. : Locate and label the joint axes $z_0, . . . , z_{n−1}$.
    • Joint positions and axii can be specified in the native coordinate frame of a Part or Assembly.
    • Joint positions and axii can be determined from Part Facet s.
  2. : Establish the base frame. Set the origin anywhere on the $z_0$ axis.
    The $x_0$ and $y_0$ axes are chosen conveniently to form a right-hand frame.
    For $i = 1, \dots , n − 1,$ perform Steps 3 to 5 when joint i and i-1 are in the same coordinate frame.
    When i and i-1 are in different coordinate frames the Denavit-Hartenberg parameters are specified.
  3. : Locate the origin $O_i$ where the common normal to $z_i$ and $z_{i-1}$
    intersects $z_i$. If $z_i$ intersects $z_{i-1}$ locate $O_i$ at this intersection. If $z_i$
    and $z_{i-1}$ are parallel, locate $O_i$ in any convenient position along $z_i$.
  4. : Establish the $ \hat{x}_i $ axis along the common normal between $z_{i-1}$ and $z_i$ through
    $O_i$, or in the direction normal to the $z_{i-1}$$z_i$ plane if $z_{i-1}$ and $z_i$
    intersect.
    dist3D_Line_to_Line() can set $ O_i = L1i $, $ \hat{x}_i = \vec{CN} $, $ r_i = dist $, and $ L0i $
  5. : Establish $y_i$ to complete a right-hand frame.
    cross3D() ($ \hat{z}_i $,$ \hat{x}_i $ ) returns $ \hat{y}_i $
  6. : Establish the end-effector frame $o_n x_n y_n z_n$. Assuming the $n^{th}$ joint
    is revolute, set $z_n = \hat{a}$ along the direction $z_{n-1}$. Establish the origin
    On conveniently along $z_n$, preferably at the center of the gripper or at
    the tip of any tool that the manipulator may be carrying. Set $y_n = \hat{s}$
    in the direction of the gripper closure and set $x_n = \hat{n}$ as $\hat{s} \times \hat{a}$. If
    the tool is not a simple gripper set $x_n$ and $y_n$ conveniently to form a
    right-hand frame.
  7. : Create a table of link parameters $r_i, d_i, \alpha_i, \theta_i$.
    • $r_i$ = distance along $x_i$ from $O_i$ to the intersection of the $x_i$ and $z_{i-1}$
      axes. Can be set by dist3D_Line_to_Line()
    • $d_i$ = distance along $z_{i-1}$ from $O_{i-1}$ to the intersection of the $x_i$ and
      $z_{i-1}$ axes $ := L0i $ from dist3D_Line_to_Line(). $d_i$ is variable if joint $i$ is prismatic.
    • $\alpha_i =$ the angle between $z_{i-1}$ and $z_i$ measured about $x_i$ (see Figure 3.3).
      angle3D2_axis() ( $z_{i-1}$ , $z_i$, $x_i$ ) returns $\alpha_i $
    • $\theta_i =$ the angle between $x_{i-1}$ and $x_i$ measured about $z_{i-1}$ (see Figure
      3.3). $\theta_i$ is variable if joint $i$ is revolute.
      angle3D2_axis() ( $x_{i-1}$ , $x_i$, $z_{i-1}$ ) returns $\theta_i $
  8. : Form the homogeneous transformation matrices $A_i$ by substituting
    the above parameters into $ (\star) $.
  9. : Form
    $T^0_\mathcal{N} = A_1 \cdots A_n$. This then gives the position and orientation
    of the $\mathcal{N}^{th}$ link frame expressed in base coordinates.

$ A_i = R_{z\,,\,\Theta_i} Trans_{z\,,\,d_i} Trans_{x\,,\,r_i} R_{x\,,\,\alpha_i} \quad (\star) $

$ A_i = \left[ \begin{array}{cccc} c \Theta_i & -s \Theta_i & 0 & 0 \\ s \Theta_i & c \Theta_i & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{array} \right] \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & D_i \\ 0 & 0 & 0 & 1 \end{array} \right] \left[ \begin{array}{cccc} 1 & 0 & 0 & r_i \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{array} \right] \left[ \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 0 & c \alpha_i & -s \alpha_i & 0 \\ 0 & s \alpha_i & c \alpha_i & 0 \\ 0 & 0 & 0 & 1 \end{array} \right] $

$ A_i = \left[ \begin{array}{cccc} c \Theta_i & -s \Theta_i c \alpha_i & s \Theta_i s \alpha_i & r_i c \Theta_i \\ s \Theta_i & c \Theta_i c \alpha_i & -c \Theta_i s \alpha_i & r_i s \Theta_i \\ 0 & s \alpha_i & c \alpha_i & D_i \\ 0 & 0 & 0 & 1 \end{array} \right] $

Where $ \Theta_i = \theta_i + q_{pre} $ if joint $ i $ is revolute, $ \Theta_i = \theta_i $ otherwise.
And where $ D_i = d_i + q_{pre} $ if joint $ i $ is prismatic, $ D_i = d_i $ otherwise.

Denavit-HartenbergLink_0.png
Denavit-HartenbergExample_0.png

Member Typedef Documentation

template<class DataType , int dim>
typedef ads::FixedArray<dim,int> Assembly< DataType, dim >::multi_index_type
template<class DataType , int dim>
typedef Part<DataType,dim> Assembly< DataType, dim >::PartType
template<class DataType , int dim>
typedef ads::FixedArray<dim,DataType> Assembly< DataType, dim >::point_type

Constructor & Destructor Documentation

template<class DataType , int dim>
Assembly< DataType, dim >::~Assembly (  )  [inline]

Member Function Documentation

template<class DataType , int dim>
virtual void Assembly< DataType, dim >::AddPart ( PartType v  )  [inline, virtual]
template<class DataType , int dim>
virtual void Assembly< DataType, dim >::AddSubAssembly ( base v  )  [inline, virtual]
template<class DataType , int dim>
virtual void Assembly< DataType, dim >::AddSubAssembly ( base v  )  [inline, virtual]
template<class DataType , int dim>
virtual MType* Assembly< DataType, dim >::getAssemblyTmatrix (  )  [inline, virtual]
template<class DataType , int dim>
virtual multi_index_type* Assembly< DataType, dim >::GetConnections (  )  [inline, virtual]
template<class DataType , int dim>
virtual MType Assembly< DataType, dim >::GetDHMat (  )  [inline, virtual]
template<class DataType , int dim>
virtual PType* Assembly< DataType, dim >::GetVerticies (  )  [inline, virtual]
template<class DataType , int dim>
virtual base* Assembly< DataType, dim >::GetWorld (  )  [inline, virtual]
template<class DataType , int dim>
virtual void Assembly< DataType, dim >::makeConnections ( int  n  )  [inline, virtual]
template<class DataType , int dim>
virtual void Assembly< DataType, dim >::makeVerticies ( int  n  )  [inline, virtual]
template<class DataType , int dim>
void Assembly< DataType, dim >::setAssemblyMotion ( MType Tmatrix  )  [inline]
template<class DataType , int dim>
virtual void Assembly< DataType, dim >::setAssemblyTmatrix ( const MType  ttemp  )  [inline, virtual]
template<class DataType , int dim>
virtual void Assembly< DataType, dim >::setAssemblyTmatrix (  )  [inline, virtual]
template<class DataType , int dim>
virtual void Assembly< DataType, dim >::setDHMat ( MType  val  )  [inline, virtual]
template<class DataType , int dim>
virtual void Assembly< DataType, dim >::setDim (  )  [inline, virtual]
template<class DataType , int dim>
virtual void Assembly< DataType, dim >::setIdTag ( std::vector< int >  val  )  [inline, virtual]
template<class DataType , int dim>
virtual void Assembly< DataType, dim >::setName ( std::string  val  )  [inline, virtual]

References Assembly< DataType, dim >::name.

Referenced by main().


Member Data Documentation

template<class DataType , int dim>
int Assembly< DataType, dim >::backedge [protected]
template<class DataType , int dim>
int Assembly< DataType, dim >::component [protected]
template<class DataType , int dim>
MType Assembly< DataType, dim >::DHMat_old [protected]
template<class DataType , int dim>
std::vector<int> Assembly< DataType, dim >::edges [protected]
template<class DataType , int dim>
int Assembly< DataType, dim >::gdistance [protected]
template<class DataType , int dim>
std::vector<int> Assembly< DataType, dim >::idTag [protected]

A std::vector of $ \mathcal{N} $ integers (+ for assemblies, - for parts) for the $ \mathcal{N}-1 $ assemblies from base assembly to this assembly. idTag[$ j $ ] is the index number of the Assembly in the subAssemblies of Assembly[$ j-1 $]. idTag[$0$] is the index number of the base Assembly in the Scene's assemblyList. $ j \in [0,\mathcal{N}] = $ Assembly index

Referenced by Assembly< DataType, dim >::AddPart(), Assembly< DataType, dim >::AddSubAssembly(), Assembly< DataType, dim >::Assembly(), Assembly< DataType, dim >::IdTag(), and Assembly< DataType, dim >::setIdTag().

template<class DataType , int dim>
bool Assembly< DataType, dim >::mobile [protected]
template<class DataType , int dim>
MType Assembly< DataType, dim >::MotionTmatrix [protected]
template<class DataType , int dim>
std::string Assembly< DataType, dim >::name [protected]
template<class DataType , int dim>
int Assembly< DataType, dim >::num_parts [protected]
template<class DataType , int dim>
int Assembly< DataType, dim >::num_subAssemblies [protected]
template<class DataType , int dim>
base* Assembly< DataType, dim >::parent [protected]
template<class DataType , int dim>
PType* Assembly< DataType, dim >::verticies [protected]

The documentation for this class was generated from the following file:
Generated on Thu Jun 30 02:18:58 2016 for Motion - rigid body dynamics solver by  doxygen 1.6.3