My plan is to distribute cylinders in the arena with either blue or red LEDS, and have the bots push the cylinders to one side of the room based on the color of the light.
My issue is the footbots are unable to detect the colored leds on the cylinders. I know this because I tried visualizing rays, and printing the list of color blobs returned by the camaras (both are empty). If I add a multiple robots, they are able to detect each others leds.
In my .argos file I have the media set as "leds", and the color_blob_camara set to this medium.
Code: Select all
<media>
<led id="leds" />
</media>
Code: Select all
<colored_blob_omnidirectional_camera implementation="rot_z_only" medium="leds" show_rays="true" />
Code: Select all
void GenericLoopFunctions::SetUpCylinders() {
CSpace::TMapPerType& boxes = GetSpace().GetEntitiesByType("cylinder");
CLEDMedium& cLEDMedium = GetSimulator().GetMedium<CLEDMedium>("leds");
for(CSpace::TMapPerType::iterator it = boxes.begin();
it != boxes.end();
++it) {
CCylinderEntity& box = *any_cast<CCylinderEntity*>(it->second);
box.AddLED(CVector3(0.0, 0.0, 0.1), // offset
CColor::BLUE); // color
// Enable LED management for the box
box.EnableLEDs(cLEDMedium);
}
}
Any thoughts on where I am going wrong?