Cylinders with LEDS for Swarm sorting task: LEDs not being detected
Posted: Thu Aug 09, 2018 6:54 pm
I'm trying to implement a task where a swarm of footbot robots try and sort objects.
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.
I distribute the cylinders in the .argos file, and then set the leds in the loop_functions (I've also tried adding the leds to the cylinders in the .argos like the example in this posthttps://www.argos-sim.info/forum/viewto ... ?f=3&t=167)
I'm sure this SetUpCylinders() method is being called after reset, before the experiment begins.
Any thoughts on where I am going wrong?
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?