I am trying to get the led colors of nearby robots using omni-directional camera with LUA in ARGoS Simulator. But I am getting the wrong output. Actually my code is given below.
Code: Select all
if robot.id == 2 then
for i = 1, #robot.colored_blob_omnidirectional_camera do
if robot.colored_blob_omnidirectional_camera[i].color.red then
log(robot.id .. "finds red")
elseif robot.colored_blob_omnidirectional_camera[i].color.green then
log(robot.id .. "finds green")
elseif robot.colored_blob_omnidirectional_camera[i].color.blue then
log(robot.id .. "finds blue")
end
end
end
Is there any mistake in above code?
Thanks for help!