I tried this code just putting cylinder on scene as test.
Code: Select all
function sysCall_init()
Graph1 = sim.getObjectHandle("YawPitchRoll")
Graph2 = sim.getObjectHandle("AlphaBetaGamma")
cyl = sim.getObjectHandle("Cylinder")
yaw = sim.addGraphStream(Graph1,"Yaw","deg",0,{1,0,0})
pitch = sim.addGraphStream(Graph1,"Pitch","deg",0,{0,1,0})
roll = sim.addGraphStream(Graph1,"Roll","deg",0,{0,0,1})
alpha = sim.addGraphStream(Graph2,"alpha","deg",0,{1,0,0})
beta = sim.addGraphStream(Graph2,"beta","deg",0,{0,1,0})
gamma = sim.addGraphStream(Graph2,"gamma","deg",0,{0,0,1})
end
function sysCall_actuation()
cyl_orien = sim.getObjectOrientation(cyl,-1)
sim.setGraphStreamValue(Graph2,alpha,cyl_orien[1])
sim.setGraphStreamValue(Graph2,beta,cyl_orien[2])
sim.setGraphStreamValue(Graph2,gamma,cyl_orien[3])
changeRotate = sim.alphaBetaGammaToYawPitchRoll(cyl_orien[1],cyl_orien[2],cyl_orien[3])
print(changeRotate)
sim.setGraphStreamValue(Graph1,Yaw,changeRotate[1])
sim.setGraphStreamValue(Graph1,pitch,changeRotate[2])
sim.setGraphStreamValue(Graph1,roll,changeRotate[3])
end
why can't I get the result as table?
thank you as usual.