Hello,
I want to get JointValues in subroutine, following is my code.
The mainRoutine is working fine, but when I try to get subroutine’s JointValue(I changed only one place, marked in red), the value always zero. You can also see my robot program from attached picture.
comp = getComponent()
robotExecutor = comp.findBehavioursByType(“rRobotExecutor”)[0]
robotProgram = robotExecutor.Program
mainRoutine = robotProgram.MainRoutine
subroutines = robotProgram.Routines
for statement in mainRoutine.Statements:
try:
print statement.Type
print statement.Positions[0].JointValues[1]
except:
continue
for statement in subroutines[0].Statements:
try:
print statement.Type
print statement.Positions[0].JointValues[1]
except:
continue