Moving foot-bot towards a patch in ARGoS using LUA
Posted: Tue May 19, 2020 3:55 am
Hi
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.
I have subtracted the current coordinates vector from the target coordinates vector using this.
Also obtained the orientation angle of foot-bot using GPS sensor.
I have rotated the new vector and tried to move the foot-bot but it is not moving.
Even this rotating new vector doesn't work and I am confused about setting the coordinates towards new desired location. How can I set orientation towards new coordinates if I have the current x, y and orientation using GPS sensor.
Thanks and best regards
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