I'm coding my foot-bot controller in Lua,
and I'm trying to get the readings from the omnidirectional camera of the foot-bot.
I'm able to get the table (= the readings), but I'm unable to iterate over it.
You can view this in the code below.
Code: Select all
function init()
robot.colored_blob_omnidirectional_camera.enable()
end
function step()
-- Here I'm logging the amount of entries in the table
-- This shows the value 1 on the screen
log(#robot.colored_blob_omnidirectional_camera)
-- Here I'm trying to iterate over the entries
-- However this doesn't show anything on the screen
for i = 0, #robot.colored_blob_omnidirectional_camera do
log(i .. " -> " .. robot.colored_blob_omnidirectional_camera[i].value)
end
end
Sincerely yours,
Ewout Merckx