Open Legendorik opened 8 months ago
I accidentally solved the problem by duplicating the pcBox->EnableLEDs(cLEDMedium)
call.
// Enable LED management for the box
pcBox->EnableLEDs(cLEDMedium);
pcBox->AddLED(CVector3(0, 0, 0), // offset
CColor::RED); // color
pcBox->EnableLEDs(cLEDMedium);
// Add the box to the simulation
AddEntity(*pcBox);
I don't know why this works, but if this is a planned behavior, it should be mentioned in the documentation. At the moment the description of the addLED
function says
"Adds an LED to this entity. For the LEDs to be updated correctly, you must first call CBoxEntity::EnableLEDs().", but it doesn't work on my example described above
I'm trying to modify the foraging example and spawn light sources at the food positions in loop function to see them with sensors. However, the camera does not recognize the LEDs that have appeared in the arena. I think the problem here is the medium, but I don't know what else I can do.
So, I started with spawning boxes with leds on food points.
This code spawns boxes (invisible due to zero height and small size) and LEDs, but the camera thinks that all 15 LEDs are spawned in the center (shown in the screenshot). From this result, I concluded that the EnableLEDs function was used incorrectly. Although the code was taken from the answers from the Argos forum, I am not sure that the LEDs should be enabled after adding them, not before. So i switched calls
It has gotten worse, now LEDs are undetectable even in the center. I've tried moving them around and playing with offset, but to no avail.
Camera setup
Media setup
I also tried to spawn just light sources without boxes, but they are still undetectable by camera
Please, tell me what's wrong