Show variables values at the console

Typically: "How do I... ", "How can I... " questions
Post Reply
luberdis

Show variables values at the console

Post 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

fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

Re: Show variables values at the console

Post 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

luberdis

Re: Show variables values at the console

Post 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

Post Reply