vcJoint

vcJoint is a joint that can be defined using kinematics, driven by controllers and affected by physics.

Properties

Name Type Access Description
Controller vcRobotController

or

vcServoController

R Gets the controller of joint.

If joint is not driven by controller, value is None.

CurrentValue Real RW Defines the joint's value.
Dof vcDof R Gets the Dof object of joint.
ExternalController vcRobotController

or

vcServoController

R Gets the external controller of joint.

If joint is not driven by an external controller, value is None.

InitialValue Real RW Defines the initial value of joint. That is, the initial state of the joint.
LagTime Real RW Defines the lag time (in seconds) of joint.
MaxAcceleration Real RW Defines the maximum acceleration (units/degrees per second squared) of joint.
MaxDeceleration Real RW Defines the maximum deceleration (units/degrees per second squared) of joint.
MaxSpeed Real RW Defines the maximum speed (units/degrees per second) of joint.
MaxValue String RW Defines an expression that when evaluated returns the maximum value of joint.
MinValue String RW Defines an expression that when evaluated returns the minimum value of joint.
Name String RW Defines the joint's name.
SettleTime Real RW Defines the settle time (in seconds) of joint.
Type Enumeration RW Defines the joint type.

See Joint Constants for more information.

Examples

Example. Access and modify joint values

from vcScript import *
 
#Access joint information via Servo/Robot Controller
comp = getComponent()
contrl = comp.findBehaviour("Controller")
 
#Example for returning joint values
def exampleJ(joint):
  print joint.MinValue
  print joint.MaxValue
  print joint.CurrentValue
  print joint.Type
 
#Joint values can be also changed in simulation
def OnRun():
  j = contrl.getJoint(0)
  j.CurrentValue = 90.0
  exampleJ(j)
 
def OnReset():
  j = contrl.getJoint(0)
  j.CurrentValue = 0.0
  exampleJ(j)

Example. Get joint values

from vcScript import *
 
comp = getComponent()
controller = comp.findBehavioursByType(VC_ROBOTCONTROLLER)[0]
joint1_as_prop = comp.getProperty(controller.Joints[0].Name)
print joint1_as_prop.MaxValue