Motion
Model ElementMotion defines a motion input into the system.
Class Name
Motion
Description
- At an allowed degree-of-freedom in a joint
- A relative displacement between two markers
- Revolute joints (rotational motion only)
- Translational joints (translational motion only)
- Cylindrical joints (either rotational or translational motion)
More general motion input on a Marker can be achieved using the Motion_Marker entity.
This interface accommodates both types of motion input.
Attribute Summary
Name | Property | Modifiable by command? | Designable? |
---|---|---|---|
id | Int() | ||
label | Str() | Yes | |
i | Reference("Marker") | Yes | Yes |
j | Reference("Marker") | Yes | Yes |
joint | Reference("Joint") | Yes | |
jtype | Enum("TRANSLATION ROTATION", default="TRANSLATION") | ||
direction | Enum("X Y Z B1 B2 B3") | Yes | |
dtype | Enum("DISPLACEMENT VELOCITY ACCELERATION", default="DISPLACEMENT") | Yes | |
icdisp | Double(None) | Yes | FD Only |
icvel | Double(None) | Yes | FD Only |
function | Function("MOTSUB") | Yes | FD Only |
routine | Routine() | FD Only | |
active | Bool() | Yes |
Usage
# Joint-based motion specified as an expression
Motion (joint=objJoint, function=expressionString, optional_attributes)
# Joint-based motion specified in a compiled user-written subroutine
Motion (joint=objJoint, function=userString, routine=string optional_attributes)
# Joint-based motion specified in a Python function
Motion (joint=objJoint, function= userString, routine=functionPointer, optional_attributes)
# Marker-based motion specified as an expression
Motion (i=objMarker, j=objMarker, direction=string, function=expressionString, optional_attributes)
# Marker-based motion specified in a compiled user-written subroutine
Motion (i=objMarker, j=objMarker, direction=string, function=userString, routine=string, optional_attributes)
# Marker-based motion specified in a Python function
Motion (i=objMarker, j=objMarker, direction=string, function=userString, routine=functionPointer, optional_attributes)
Attributes
- joint
- Reference to an existing Joint object.
- function
- String defining a valid MotionSolve expression.
- jtype
- String
- joint
- Reference to an existing Joint object.
- function
- String defining a valid MotionSolve expression.
- routine
- String
- jtype
- String
- joint
- Reference to an existing Joint object.
- function
- String defining a valid MotionSolve expression.
- routine
- Pointer to a callable function in Python.
- jtype
- String
- i
- Reference to an existing Marker object.
- j
- Reference to an existing floating Marker object.
- direction
- String
- function
- String defining a valid MotionSolve expression.
- i
- Reference to an existing Marker object.
- j
- Reference to an existing floating Marker object.
- direction
- String
- function
- String defining a valid MotionSolve expression.
- routine
- String
- i
- Reference to an existing marker object.
- j
- Reference to an existing floating Marker object.
- direction
- String
- function
- String defining a valid MotionSolve expression.
- routine
- Pointer to a callable function in Python.
- id
- Integer
- label
- String
- dtype
- Specifies whether the motion applies a displacement input, a velocity input, or an
acceleration input. You must select one value from:
- dtype="DISPLACEMENT" - to specify a displacement input.
- dtype="VELOCITY" - to specify a velocity input.
- dtype="ACCELERATION" - to specify an acceleration input.
- icdisp
- Double
- icvel
- Double
- active
- Boolean
Example
mot1 = Motion (label="mot1", joint=j301, dtype="ACCELERATION",
function="CUBSPL(Time, 0, 301001)")
mot2 = Motion (label="mot2",joint=j302, function="CUBSPL(Time, 0, 301)")
mot3 = Motion (label="mot3",i=j303, j=0,direction="Y",dtype="VELOCITY",
function="-2*PI*Cos(2*PI*(Time-30D))")
mot4 = Motion (label="mot4", i=j303, j=0, direction="B1", dtype="DISPLACEMENT",
function="CURVE(3, Time, 1)")
mot5 = Motion (label="mot5", i=j305, j=j404, direction="B3", dtype="DISPLACEMENT",
function="USER(1,2,9,-10.32)",routine="RobotMotion")
# Define the function
def RobotMotion (id, time, par, npar, dflag, iflag):
x0 = par[0]
x1 = par[1]
h0 = par[2]
h1 = par[3]
return STEP (time, x0, h0, x1, h1)
# Now refer to the function in the Motion object
mot5 = Motion (label="mot5",i=j305, j=j404, direction="B3", dtype="DISPLACEMENT",
function="USER(1,2,9,-10.32)", routine=RobotMotion
Joint-based Motion vs. Marker based Motion.
#Mot61 and mot62 are entirely equivalent:
Mot61 = Motion (label="mot61",i=cyl_I, j=cyl_J, direction="Z",
function="2*sin(pi*time)")
Mot62 = Motion (label="mot62",joint=cyl1, jtype="TRANSLATION",
function="2*sin(pi*time)")
#Mot71 and mot72 are entirely equivalent:
Mot71 = Motion (label="mot71",i=cyl_I, j=cyl_J, direction="B3",
function="2*sin(pi*time)")
Mot72 = Motion (label="mot72",joint=cyl, jtype="ROTATION",
function="2*sin(pi*time)")