How to draw the variable by the loop function
Posted: Fri Jan 03, 2020 4:55 am
				
				I tried to show the variable on the top of the robot. But I don't know why I failed.
In .h file
			Code: Select all
void CIDQTUserFunctions::Draw(CFootBotEntity& c_entity) {
   /* The position of the text is expressed wrt the reference point of the footbot
    * For a foot-bot, the reference point is the center of its base.
    * See also the description in
    * $ argos3 -q foot-bot
    */
    CFootBotPhysarum& cController = dynamic_cast<CFootBotPhysarum&>(c_entity.GetControllableEntity().GetController());
    UInt8 type = cController.GetTypeData();
   std::string str=std::to_string(type);
   DrawText(CVector3(0.0, 0.0, 0.3),   // position
            str); // text
}Code: Select all
// UInt8 GetTypeData();
   inline UInt8 GetTypeData() {
      return m_robot_type;
   }