vcPathStatement

A vcPathStatement is a type of robot statement that can execute a set of positions. It allows you to manage a large amount of data used for robot motion planning.

Inherits: vcStatement

Path Properties

Name Type Access Description
Base vcBaseFrame RW Defines the base frame of the path statement.
FrameNameField Integer RW Defines the index of schema property used for labeling position in 3D world.

The schema property should be a string data type.

The default is -1. This means the position will not be labeled with its custom name rather the number of position in path.

FrameNameVisibleField

Integer

RW

Defines the index of schema property used for controlling the visibility of position label in 3D world.

The schema property should be a Boolean data type.

The default is -1. This means the labels are visible.

ExternalTCP Boolean RW Defines if external tcp mode is used for the path statement.
Positions vcPositionFrameIterator R Gets an iterator for positions in the path statement.

Each position is of type vcSchemaPositionFrame.

ProcessHandler vcPythonProcessHandler RW Defines the process handler used by robot to execute path statement.
SchemaProperties List of vcProperty R Gets a list of schema properties for path statement.

See "Schema Properties" section for more information.

ShowReferenceFrames Boolean RW Turns on/off visibility of positions marked as reference points.
Tool vcBaseFrame RW Defines the tool frame of the path statement.

Schema Properties

The positions of a vcPathStatement are linear motions and defined using schema properties, which are fields in a schema database (table) unique to each vcPathStatement object.

Default

By default, each path position (record) is defined by seven, built-in schema properties as well additional properties for any external joint values. Each built-in property is mapped to an internal Field property, for example Position is mapped to PositionField. The mapping is done by referencing the index of a schema property. For example, PositionField has a default value of 0 since Position is the first property/field in schema of path position. We recommend that you do not modify any internal Field properties for built-in schema properties.

Name Type Access Description
FrameVisible Boolean RW Turns on/off the visibility of the position in 3D world.
IsContinuous Boolean RW Defines if robot motion to and from position should be one continuous motion.
IsReference Boolean RW Indicates if position is used as reference for calculating adjustments to path positions.
LineColor vcVector   RW Defines the color of line to position.
LineVisible Boolean RW Defines if line to position is visible in 3D world.
Position vcMatrix RW Defines the position matrix of position.
PositionStatus Integer RW Indicates the status of position, for example whether or not it is unreachable.

Status is determined by three flags.

1
Reachable

2
Within joint limits of robot

4
No singularity

The default is 7. The status is not updated automatically by application. You would need to manually test the position as a vcMotionTarget object and evaluate configuration warnings. The configuration warning and position status values are flipped, so a configuration warning of 0 would be a status of 7.

If you do not modify LineColor, the color of position in 3D world will automatically be updated based on PositionStatus. For example, green is reachable and red is unreachable.

See Configuration Warnings constants for more information or review the example in vcSchemaPositionFrame.

E1 ... EN Real RW Defines one or more external joint values for the position.

Optional

If you add any of the following schema properties by name, the property will automatically be mapped to an internal Field property and affect a robot motioning to positions. The same recommendation applies to not modify the internal Field property.

Note: If you create a Path statement using the GUI, MaxSpeed, Acceleration, Deceleration, AccuracyMethod and AccuracyValue will automatically be added as schema properties.

Name Type Access Description
Acceleration Real RW Defines the maximum Cartesian acceleration of motion (units/s^2) used to calculate target trajectory.
AccuracyMethod Enumeration RW Defines the zone of accuracy type to use for the position, for example distance, time or velocity.

See Motion Target Constants for more information.

AccuracyValue Real RW Defines the limit used in AccuracyMethod.
AngularAcceleration Real RW Defines the maximum angular acceleration of motion (degrees/s^2) used to calculate target trajectory.
AngularDeceleration Real RW Defines the maximum angular deceleration of motion (degrees/s^2) used to calculate target trajectory.
Deceleration Real RW Defines the maximum Cartesian deceleration of motion (units/s^2) used to calculate target trajectory.
MaxAngularSpeed Real RW Defines the maximum angular speed (degrees/s^2) used to calculate target trajectory.
MaxSpeed Real RW Defines the maximum Cartesian speed (units/s) used to calculate target trajectory.

Methods

Name Return Type Parameters Description
addSchemaProperties List of Integer List of Object properties

Adds a list of custom properties for each position in path statement, and then returns a list of indices for the added properties in SchemaProperties.

The list should contain one or more value pairs Enumeration type, String name. Each pair defines a single property to add.

beginBatchUpdate None Integer schema_size Sets the initial amount of schema database entries, for example 100 entries for 100 path positions. This is done to allocate enough memory for storing schema property values for each path position.

Note: This method is required if there is no existing schema database. If the database exists, this is optional.

Note: Using size value -1 doesn't allocate space for new schema items and doesn't reset current data. It only blocks notify events when items are updated between this call and EndBatchUpdate.

clearPositions None None Removes all positions from path statement, thereby removing all schema database entries.
endBatchUpdate None Integer schema_size Sets the final amount of schema database entries, for example 96 entries for 96 path positions. This is done to not allocate more memory than is needed to store schema property values for each path position.
getSchemaSize Integer None Returns the total amount of entries for schema database of path statement.
getSchemaValue <Type> Integer position_index, String property_name Returns the value of schema property for path position.
setSchemaValues None Integer position_index, String property_name, <Type> value

or

Integer position_index, List of Integer property_indices, List of <Type> values

Sets one or more schema properties for path position.

Note: The method should not be called when there are no rows in the schema database or if the row's index value does not exist.

removeSchemaProperties None List of String property_names

or

List of vcProperty properties

Removes properties referenced by property_names list or properties list arguments

Examples

Example. Add path statement and populate position table

from vcScript import *
import vcMatrix
 
comp = getComponent()
executor = comp.findBehaviour("Executor")
routine = executor.Program.MainRoutine
 
#add path statement
path_statement = routine.addStatement('Path', 0)
 
#clear path table
path_statement.clearPositions()
 
#add schema properties/fields for table
my_props = [VC_MATRIX,  "Position",\
VC_INTEGER, "MotionType",\
VC_INTEGER, "OriginalIndex",\
VC_REAL, "Speed"]
prop_indices = path_statement.addSchemaProperties(my_props)
 
#add data to path table
path_statement.beginBatchUpdate(100)
for point_index in range(100):
  position = vcMatrix.new()
  motion_type = 1
  speed = 200.0
  position_values = (position, motion_type, point_index, speed)
  path_statement.setSchemaValues(point_index, prop_indices, position_values)
  path_statement.setSchemaValues(0, "IsReference", True)
  path_statement.setSchemaValues(99, "IsReference", True)
path_statement.endBatchUpdate(100)
 
path_handler = comp.getBehaviour("MyHandler")
path_statement.ProcessHandler = path_handler
 
app = getApplication()
app.SelectionManager.clear()
app.SelectionManager.setSelection(path_statement)
app.render()

Example. Customize name of positions

from vcScript import *
import vcMatrix
 
comp = getComponent()
rx = comp.findBehaviour("Executor")
mr = rx.Program.MainRoutine
 
mr.clear()
path = mr.addStatement("Path")
 
#add schema property for custom name
#assign the index of that property to FrameNameField
index = path.addSchemaProperties([VC_STRING,"ExampleName"])[0]
path.FrameNameField = index
 
#this will label positions P1...P10 i.e. default labeling of positions
#path.FrameNameField = -1
 
path.beginBatchUpdate(10)
for i in range(10):
  #define position
  position = vcMatrix.new()
  position.translateAbs(1000,i*100,1000)
  path.setSchemaValues(i,"Position",position)
  
  #frame of position must be visible, otherwise name is also hidden
  path.setSchemaValues(i,"FrameVisible",True)
  
  #will label positions T1...T10
  path.setSchemaValues(i,"ExampleName","T"+str(i+1))
path.endBatchUpdate(10)
 
app = getApplication()
app.render()

Example. Toggle visibility of position labels

from vcScript import *
import vcMatrix
 
comp = getComponent()
rx = comp.findBehaviour("Executor")
mr = rx.Program.MainRoutine
 
mr.clear()
path = mr.addStatement("Path")
 
index = path.addSchemaProperties([VC_BOOLEAN,"ExampleNameVisible"])[0]
path.FrameNameVisibleField = index
 
path.beginBatchUpdate(10)
for i in range(10):
  #define position
  position = vcMatrix.new()
  position.translateAbs(1000,i*100,1000)
  path.setSchemaValues(i,"Position",position)
  
  #frame of position must be visible, otherwise name is also hidden
  path.setSchemaValues(i,"FrameVisible",True)
  
  #frames are visible but not the labels
  path.setSchemaValues(i,"ExampleNameVisible",False)
path.endBatchUpdate(10)
app = getApplication()
app.render()