Gcon
Model ElementThe GCON element is used to specify a user defined general constraint. Your constraint equations may involve position as well as velocity measures of the system. Although MotionSolve provides a large set of constraints to choose from (see JOINT), there are situations that require non-standard constraints.
Class Name
Gcon
Description
For example, the constraint that a wheel rolls without slipping is a non-holonomic constraint that can be modeled using the GCON element.
Attribute Summary
Name | Property | Modifiable by command? | Designable? |
---|---|---|---|
id | Int () | NO | |
label | Str () | Yes | |
function | Function ("GCOSUB") | Yes | |
routine | Routine () | ||
active | Bool () | Yes |
Usage
Gcon (function=userString, optional_attributes)
Attributes
- function
- String
- i
- Reference to an existing Marker object.
- id
- Integer
- label
- String
- routine
- String or a pointer to a Python function.
- active
- Bool
Example
# Get the ids of the I and J markers
iid = imrkr.id
jid = jmrkr.id
# Create the expression strings
strx = "dx({i},{j})".format(i=iid, j=jid)
stry = "dy({i},{j})".format(i=iid, j=jid)
strz = "dz({i},{j})".format(i=iid, j=jid)
# Define the 3 GCONS: DX(I,J)=0, DY(I,J)=0, DZ(I,J)=0
gx = Gcon (function=strx, i=imrkr, label="X-Constraint")
gy = Gcon (function stry, i-imrkr, label="Y-Constraint")
gz = Gcon (function=strz, i=imrkr, label="Z-Constraint")
Comments
- See Properties for an explanation about what properties are, why they are used, and how you can extend these.
- For a more detailed explanation about Gcon, see Constraint: General.