Show variables values at the console

Typically: "How do I... ", "How can I... " questions
Post Reply
luberdis
Posts: 12
Joined: 14 Dec 2018, 16:06

Show variables values at the console

Post by luberdis » 17 Dec 2018, 15:16

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: 256
Joined: 09 Sep 2013, 19:28

Re: Show variables values at the console

Post by fferri » 19 Dec 2018, 18:08

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
Posts: 12
Joined: 14 Dec 2018, 16:06

Re: Show variables values at the console

Post by luberdis » 04 Jan 2019, 08:52

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