Page 1 of 1

Moving foot-bot towards a patch in ARGoS using LUA

Posted: Tue May 19, 2020 3:55 am
by Waqar731
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.

Code: Select all

local pos = { a=robot.positioning.position.x, b=robot.positioning.position.y } local target = { a=4, b=4 }
I have subtracted the current coordinates vector from the target coordinates vector using this.

Code: Select all

local newvector = {a = target.a - pos.a, b = target.b - pos.b }
Also obtained the orientation angle of foot-bot using GPS sensor.

Code: Select all

robot.positioning.orientation.angle
I have rotated the new vector and tried to move the foot-bot but it is not moving.

Code: Select all

newvector.rotate (-orientation) robot.wheels.set_velocity(newvector)
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

Re: Moving foot-bot towards a patch in ARGoS using LUA

Posted: Tue Jun 02, 2020 7:56 pm
by pincy
The method "set_velocity" does not accept a vector as input, but the wheel speeds.

Re: Moving foot-bot towards a patch in ARGoS using LUA

Posted: Wed Jun 03, 2020 4:29 am
by Waqar731
thanks for the reply, Can u please exactly tell where I have mistake in the code?

Re: Moving foot-bot towards a patch in ARGoS using LUA

Posted: Wed Jun 03, 2020 4:36 am
by pincy
robot.wheels.set_velocity(10,5) sets the left wheel to 10 cm/s and the right to 5 cm/s

Re: Moving foot-bot towards a patch in ARGoS using LUA

Posted: Wed Jun 03, 2020 5:18 am
by Waqar731
I know how to move normally with velocity. But this question was asked in a sense that how to set direction/orientation of foot-bot towards the specific patch. But this question is still unsolved. Please tell me the can I move robot towards a specific patch.

Re: Moving foot-bot towards a patch in ARGoS using LUA

Posted: Thu Jun 04, 2020 6:00 am
by Waqar731
Hi,
Currently robot has been placed on coordinates (-2,-2) as can be seen in attached screenshot.
Screenshot from 2020-06-04 10-54-53.png
Screenshot from 2020-06-04 10-54-53.png (77.35 KiB) Viewed 22479 times
Now I want to move it to (0,0) coordinates without using any light source or omni-directional camera. I have tried the following lines of code, but it is not even moving the robot. The code I am using is given below:

Code: Select all

pos_x=robot.positioning.position.x pos_y=robot.positioning.position.y local target = { a=0, b=0 } local newvector = {a = target.a - pos_x, b = target.b - pos_y } local orientation=robot.positioning.orientation.angle newvector.rotate(-orientation) robot.wheels.set_velocity(10,10)
Please help me to solve this issue. Thanks

Re: Moving foot-bot towards a patch in ARGoS using LUA

Posted: Thu Jun 04, 2020 8:15 pm
by pincy
Look into the inverse kinematics of differential drive robots: http://rossum.sourceforge.net/papers/DiffSteer/. This is not a problem with ARGoS.