Page 1 of 1

Show variables values at the console

Posted: 17 Dec 2018, 15:16
by luberdis
Hi I would like to ask you with which function can I show the value of a variable at the console. I already know the sim.AddstatusBar but it only works for messages with string character

So the child script of the robot is for example
function sysCall_actuation()
quat=sim.getObjectQuaternion(MainBodyBase,-1)
euler=sim.getObjectOrientation(MainBodyBase,-1)




sim.setJointTargetVelocity(leftMotor,0.3)
sim.setJointTargetVelocity(rightMotor,0.6)



end

I want to check the values in every iteration of quat and Euler

Re: Show variables values at the console

Posted: 19 Dec 2018, 18:08
by fferri

Code: Select all

function sysCall_actuation()
    quat=sim.getObjectQuaternion(MainBodyBase,-1)
    euler=sim.getObjectOrientation(MainBodyBase,-1)
    print(quat,euler)
end
or also

Code: Select all

function sysCall_actuation()
    quat=sim.getObjectQuaternion(MainBodyBase,-1)
    euler=sim.getObjectOrientation(MainBodyBase,-1)
    printf('Quaternion: %s',quat)
    printf('Euler: %s',euler)
end

Re: Show variables values at the console

Posted: 04 Jan 2019, 08:52
by luberdis
Thanks actually I was trying these but it did not work and then I figured out it was a problem in the libraries