I am starting out to use ARGoS and my goal is to create a new method for the footbot controller's control step for the diffusion_10 experiment.
I am trying to find a way to read / print / log the input coming from the sensors to no avail.
I've tried putting the following within
Code: Select all
RLOG << "m_pcProximity";
RLOG << m_pcProximity;
std::cout << "m_pcProximity";
std::cout << m_pcProximity;
Code: Select all
RLOG << "cAccumulator";
RLOG << cAccumulator;
std::cout << "cAccumulator";
std::cout << cAccumulator;
Code: Select all
void CFootBotDiffusion::ControlStep() {
/* Get readings from proximity sensor */
const CCI_FootBotProximitySensor::TReadings& tProxReads = m_pcProximity->GetReadings();
/* Sum them together */
RLOG << "m_pcProximity"; //ADDED
RLOG << m_pcProximity; //ADDED
std::cout << "m_pcProximity"; //ADDED
std::cout << m_pcProximity; //ADDED
CVector2 cAccumulator;
for(size_t i = 0; i < tProxReads.size(); ++i) {
cAccumulator += CVector2(tProxReads[i].Value, tProxReads[i].Angle);
}
RLOG << "cAccumulator"; //ADDED
RLOG << cAccumulator; //ADDED
std::cout << "cAccumulator"; //ADDED
std::cout << cAccumulator; //ADDED
cAccumulator /= tProxReads.size();
/* If the angle of the vector is small enough and the closest obstacle
* is far enough, continue going straight, otherwise curve a little
*/
CRadians cAngle = cAccumulator.Angle();
if(m_cGoStraightAngleRange.WithinMinBoundIncludedMaxBoundIncluded(cAngle) &&
cAccumulator.Length() < m_fDelta ) {
/* Go straight */
m_pcWheels->SetLinearVelocity(m_fWheelVelocity, m_fWheelVelocity);
}
else {
/* Turn, depending on the sign of the angle */
if(cAngle.GetValue() > 0.0f) {
m_pcWheels->SetLinearVelocity(m_fWheelVelocity, 0.0f);
}
else {
m_pcWheels->SetLinearVelocity(0.0f, m_fWheelVelocity);
}
}
}
Are there any ways to either display the data in the ARGoS simulator log gui or a mac's terminal? Where can I put functions to output to the terminal or the ARGoS gui? and which functions should they be?
Any advice is appreciated, thanks a lot!