I found the issue. I put the correct code in the
original post, so whoever looks for an answer gets the right thing instantly.
I copy the correct code here:
Code: Select all
CMyLoopFunctions::Init(...) {
// Get a reference to the LED medium
//
// The passed id "leds" corresponds to the id of the led_medium in
// the XML file
//
// see https://github.com/ilpincy/argos3/blob/master/src/core/simulator/simulator.h
// see https://github.com/ilpincy/argos3/blob/master/src/plugins/simulator/media/led_medium.h
CLEDMedium& cLEDMedium = GetSimulator().GetMedium("leds");
// Add a new box with an LED on top
// see https://github.com/ilpincy/argos3/blob/master/src/plugins/simulator/entities/box_entity.h
CBoxEntity* pcBox = new CBoxEntity("box1", // id
CVector3(1.0, 2.0, 0.0), // position
CQuaternion(), // orientation
true, // movable or not?
CVector3(0.5, 0.5, 0.5), // size
1.0); // mass in kg
// Add LED on top of the box
pcBox->AddLED(CVector3(0.0, 0.0, 1.0), // offset
CColor::RED); // color
// Enable LED management for the box
pcBox->EnableLEDs(cLEDMedium);
// Add the box to the simulation
AddEntity(*pcBox);
}
Notice that the files you gave me do not compile, due to naming issues in the include files. Also, you haven't included all the changes I made in the past fixes I gave you, such as linking as follows:
Code: Select all
if(ARGOS_COMPILE_QTOPENGL)
target_link_libraries(epuck_aggregation_loop_functions argos3plugin_simulator_qtopengl ${ARGOS_QTOPENGL_LIBRARIES})
endif(ARGOS_COMPILE_QTOPENGL)
In the future, please give me files that compile, to make it faster for me to reproduce issues.
I made ARGoS.