I am studying the ballbot model in V-REP. Could someone help me understand it?

Code: Select all

```
local l=math.sqrt(v[1]*v[1]+v[2]*v[2]+v[3]*v[3])
local ls=l
local w=0.18
v[1]=v[1]*ls*w/l
v[2]=v[2]*ls*w/l
v[3]=v[3]*ls*w/l
```

Code: Select all

```
local m=simGetObjectMatrix(sens,-1)
local euler=simGetEulerAnglesFromMatrix(m)
euler[1]=0
euler[2]=0
local m2=simBuildMatrix({0,0,0},euler)
local m3=simGetInvertedMatrix(m2)
local vect={m[3],m[7],m[11]}
vect=simMultiplyVector(m3,vect)
v=simMultiplyVector(m3,v)
velo=simMultiplyVector(m3,velo)
d=0.2
```

What are the variables vect, velo, d and v ?

Which controller is being used ?

Thanks