How to find out the equations in scripts?

Typically: "How do I... ", "How can I... " questions
Post Reply
DannyYeong
Posts: 44
Joined: 24 Feb 2015, 17:06

How to find out the equations in scripts?

Post by DannyYeong »

Hi!

I'm curious to how the equation "0.5-posx" was determined in the coding below:

Image

the function just tells the Yaw axis camera to move accordingly with the red sphere's movement.Normally how do you determine the constant values in the equation? The youtuber video @33:12 to @35:25
https://www.youtube.com/watch?v=kOjQRYmeX_o din't explain how how he got the value, but instead just mentions how it affects the velocity of the camera.

Note; The vision sensor returns back posx as the "centre of mass x" value to the script.

Thanks in advance!

Regards,
Danny

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: How to find out the equations in scripts?

Post by coppelia »

Hello Danny,

not sure what script you are talking about. But this is really specific to the coding style and the purpose of the script.

Cheers

DannyYeong
Posts: 44
Joined: 24 Feb 2015, 17:06

Re: How to find out the equations in scripts?

Post by DannyYeong »

coppelia wrote:Hello Danny,

not sure what script you are talking about. But this is really specific to the coding style and the purpose of the script.

Cheers
My main purpose is the equation, normally how do you define one? Or at least, where to start?

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: How to find out the equations in scripts?

Post by coppelia »

Well, that's the whole purpose of a programming language. I recommend you start by learning Lua (or by that matter any other language you might use with V-REP). The easiest would be to download the Lua interpreter, launch it, and play a little bit with it. E.g.:

Code: Select all

a=3
b=6
c=a+b
print(c)
Cheers

Post Reply