I m trying to move a foot bot towards a specific patch in LUA lets say from position (1,1) to a position (4,4) without using light source. I have obtained the current coordinates x and y of foot-bot using GPS sensor and stored them in a vector. Also stored target coordinates values in a spearate vector.
Code: Select all
local pos = { a=robot.positioning.position.x, b=robot.positioning.position.y }
local target = { a=4, b=4 }
Code: Select all
local newvector = {a = target.a - pos.a, b = target.b - pos.b }
Code: Select all
robot.positioning.orientation.angle
Code: Select all
newvector.rotate (-orientation)
robot.wheels.set_velocity(newvector)
Thanks and best regards