43 gui_connector_(argc,argv),
44 info_connector_(argc,argv),
45 map_connector_(argc,argv),
58 std::string(
"/resources/images/arrow_move.png")).c_str()),
59 QSize(20,20), QIcon::Normal, QIcon::Off);
63 std::string(
"/resources/images/remove_icon.png")).c_str()),
64 QSize(20,20), QIcon::Normal, QIcon::Off);
91 "stdr_server/rfid_list",
98 n_.
serviceClient<stdr_msgs::DeleteRfidTag>(
"stdr_server/delete_rfid_tag");
102 "stdr_server/co2_sources_list",
107 n_.
serviceClient<stdr_msgs::AddCO2Source>(
"stdr_server/add_co2_source");
110 "stdr_server/delete_co2_source");
114 "stdr_server/thermal_sources_list",
120 "stdr_server/add_thermal_source");
123 "stdr_server/delete_thermal_source");
127 "stdr_server/sound_sources_list",
133 "stdr_server/add_sound_source");
136 "stdr_server/delete_sound_source");
186 SIGNAL(robotFromFile(stdr_msgs::RobotMsg)),
225 timer_ =
new QTimer(
this);
227 timer_, SIGNAL(timeout()),
331 std::string(
"/resources/images/logo.png")).c_str());
369 for(
unsigned int i = 0 ; i < msg.rfid_tags.size() ; i++)
371 QPoint p(msg.rfid_tags[i].pose.x /
map_msg_.info.resolution,
372 msg.rfid_tags[i].pose.y /
map_msg_.info.resolution);
377 temp_tag.
setMessage(QString(msg.rfid_tags[i].message.c_str()));
379 rfid_tags_.insert(std::pair<QString, CGuiRfidTag>(
380 QString(temp_tag.
getName().c_str()), temp_tag));
395 for(
unsigned int i = 0 ; i < msg.co2_sources.size() ; i++)
397 QPoint p(msg.co2_sources[i].pose.x /
map_msg_.info.resolution,
398 msg.co2_sources[i].pose.y /
map_msg_.info.resolution);
403 temp_source.
setPpm(msg.co2_sources[i].ppm);
406 QString(temp_source.
getName().c_str()), temp_source));
418 (
const stdr_msgs::ThermalSourceVector& msg)
422 for(
unsigned int i = 0 ; i < msg.thermal_sources.size() ; i++)
424 QPoint p(msg.thermal_sources[i].pose.x /
map_msg_.info.resolution,
425 msg.thermal_sources[i].pose.y /
map_msg_.info.resolution);
430 temp_source.
setDegrees(msg.thermal_sources[i].degrees);
433 QString(temp_source.
getName().c_str()), temp_source));
446 (
const stdr_msgs::SoundSourceVector& msg)
450 for(
unsigned int i = 0 ; i < msg.sound_sources.size() ; i++)
452 QPoint p(msg.sound_sources[i].pose.x /
map_msg_.info.resolution,
453 msg.sound_sources[i].pose.y /
map_msg_.info.resolution);
461 QString(temp_source.
getName().c_str()), temp_source));
479 QImage(msg.info.width,msg.info.height,QImage::Format_RGB32);
483 for(
unsigned int i = 0 ; i < msg.info.width ; i++ )
485 for(
unsigned int j = 0 ; j < msg.info.height ; j++ )
487 if( msg.data[j * msg.info.width + i] == -1 )
489 c=QColor(127,127,127);
493 d = (100.0 - msg.data[j * msg.info.width + i]) / 100.0 * 255.0;
497 painter.drawPoint(i,j);
500 int originx = msg.info.origin.position.x / msg.info.resolution;
501 int originy = msg.info.origin.position.y / msg.info.resolution;
502 painter.setPen(Qt::blue);
503 painter.drawLine(originx, originy - 20, originx, originy + 20);
504 painter.drawLine(originx - 20, originy, originx + 20, originy);
509 msg.info.height * msg.info.resolution,
510 msg.info.resolution);
523 "stdr_server/active_robots",
538 std::string file_name_str=file_name.toStdString();
665 const stdr_msgs::RobotIndexedVectorMsg& msg)
667 std::set<QString> newSensors, erasedSensorsL, erasedSensorsS;
668 for(
unsigned int r = 0 ; r < msg.robots.size() ; r++ )
670 QString baseName = QString(msg.robots[r].name.c_str());
671 for(
unsigned int l = 0;
672 l < msg.robots[r].robot.laserSensors.size() ; l++)
674 QString fullName = baseName + QString(
"/") +
676 msg.robots[r].robot.laserSensors[l].frame_id.c_str() );
677 newSensors.insert(fullName);
679 for(
unsigned int s = 0;
680 s < msg.robots[r].robot.sonarSensors.size() ;
s++ )
682 QString fullName = baseName + QString(
"/") +
684 msg.robots[r].robot.sonarSensors[
s].frame_id.c_str());
685 newSensors.insert(fullName);
692 if( newSensors.find(it->first) == newSensors.end() )
694 erasedSensorsL.insert(it->first);
700 if(newSensors.find(it->first) == newSensors.end())
702 erasedSensorsS.insert(it->first);
706 for(std::set<QString>::iterator it = erasedSensorsL.begin() ;
707 it != erasedSensorsL.end() ; it++)
712 for(std::set<QString>::iterator it = erasedSensorsS.begin() ;
713 it != erasedSensorsS.end() ; it++)
727 const stdr_msgs::RobotIndexedVectorMsg& msg)
743 for(
unsigned int i = 0 ; i < msg.robots.size() ; i++)
778 pnew.x() *
map_msg_.info.resolution,
779 pnew.y() *
map_msg_.info.resolution);
781 stdr_msgs::RobotIndexedMsg newRobot;
817 QString name=QString(
"rfid_tag_") + QString().setNum(
rfid_tags_.size());
820 stdr_msgs::RfidTag new_tag;
823 QString rfid_id = QInputDialog::getText(
825 tr(
"RFID tag id:"), QLineEdit::Normal,
827 if ( ok && !rfid_id.isEmpty() ) {
828 new_tag.tag_id = rfid_id.toStdString();
831 QString rfid_message = QInputDialog::getText(
833 tr(
"RFID tag message (optional):"), QLineEdit::Normal,
835 if ( ok && !rfid_message.isEmpty() ) {
836 new_tag.message = rfid_message.toStdString();
839 new_tag.pose.x = pnew.x() *
map_msg_.info.resolution ;
840 new_tag.pose.y = pnew.y() *
map_msg_.info.resolution ;
841 new_tag.pose.theta = 0;
843 stdr_msgs::AddRfidTag srv;
844 srv.request.newTag = new_tag;
848 "STDR robot - Error", QString(srv.response.message.c_str()));
867 QString name=QString(
"co2_source_") + QString().setNum(
co2_sources_.size());
870 stdr_msgs::CO2Source new_source;
873 QString
id = QInputDialog::getText(
875 tr(
"CO2 Source id:"), QLineEdit::Normal,
877 if ( ok && !
id.isEmpty() ) {
878 new_source.id =
id.toStdString();
881 QString ppms = QInputDialog::getText(
883 tr(
"PPMs (Part Per Million):"), QLineEdit::Normal,
885 if ( ok && !ppms.isEmpty() ) {
886 new_source.ppm = ppms.toFloat();
889 new_source.pose.x = pnew.x() *
map_msg_.info.resolution ;
890 new_source.pose.y = pnew.y() *
map_msg_.info.resolution ;
891 new_source.pose.theta = 0;
893 stdr_msgs::AddCO2Source srv;
894 srv.request.newSource = new_source;
898 "STDR robot - Error", QString(srv.response.message.c_str()));
916 QString name=QString(
"thermal_source_") +
920 stdr_msgs::ThermalSource new_source;
923 QString
id = QInputDialog::getText(
925 tr(
"Thermal Source id:"), QLineEdit::Normal,
927 if ( ok && !
id.isEmpty() ) {
928 new_source.id =
id.toStdString();
931 QString degrees = QInputDialog::getText(
933 tr(
"Degrees:"), QLineEdit::Normal,
935 if ( ok && !degrees.isEmpty() ) {
936 new_source.degrees = degrees.toFloat();
939 new_source.pose.x = pnew.x() *
map_msg_.info.resolution ;
940 new_source.pose.y = pnew.y() *
map_msg_.info.resolution ;
941 new_source.pose.theta = 0;
943 stdr_msgs::AddThermalSource srv;
944 srv.request.newSource = new_source;
948 "STDR robot - Error", QString(srv.response.message.c_str()));
966 QString name=QString(
"sound_source_") +
970 stdr_msgs::SoundSource new_source;
973 QString
id = QInputDialog::getText(
975 tr(
"Sound Source id:"), QLineEdit::Normal,
977 if ( ok && !
id.isEmpty() ) {
978 new_source.id =
id.toStdString();
981 QString dbs = QInputDialog::getText(
983 tr(
"DBs (Decibels):"), QLineEdit::Normal,
985 if ( ok && !dbs.isEmpty() ) {
986 new_source.dbs = dbs.toFloat();
989 new_source.pose.x = pnew.x() *
map_msg_.info.resolution ;
990 new_source.pose.y = pnew.y() *
map_msg_.info.resolution ;
991 new_source.pose.theta = 0;
993 stdr_msgs::AddSoundSource srv;
994 srv.request.newSource = new_source;
998 "STDR robot - Error", QString(srv.response.message.c_str()));
1067 QString(
"Time elapsed : ") +
1072 std::vector<QString> toBeErased;
1076 if( ! it->second->getActive())
1078 toBeErased.push_back(it->first);
1082 it->second->paint();
1085 for(
unsigned int i = 0 ; i < toBeErased.size() ; i++)
1093 if( ! it->second->getActive())
1095 toBeErased.push_back(it->first);
1099 it->second->paint();
1102 for(
unsigned int i = 0 ; i < toBeErased.size() ; i++)
1111 if( ! it->second->getActive())
1113 toBeErased.push_back(it->first);
1117 QString robotName = it->first;
1122 it->second->setImage(
1124 getVisualization(
map_msg_.info.resolution));
1127 it->second->setCurrentSpeed(
1134 for(
unsigned int i = 0 ; i < toBeErased.size() ; i++)
1159 for(
unsigned int i = 0 ; i <
all_robots_.robots.size() ; i++)
1161 if(
all_robots_.robots[i].name == robotName.toStdString())
1163 for(
unsigned int j = 0 ;
1164 j <
all_robots_.robots[i].robot.laserSensors.size() ;
1167 if(
all_robots_.robots[i].robot.laserSensors[j].frame_id
1168 == laserName.toStdString())
1170 return all_robots_.robots[i].robot.laserSensors[j];
1175 return stdr_msgs::LaserSensorMsg();
1188 for(
unsigned int i = 0 ; i <
all_robots_.robots.size() ; i++)
1190 if(
all_robots_.robots[i].name == robotName.toStdString())
1192 for(
unsigned int j = 0 ;
1193 j <
all_robots_.robots[i].robot.sonarSensors.size() ;
1196 if(
all_robots_.robots[i].robot.sonarSensors[j].frame_id
1197 == sonarName.toStdString())
1199 return all_robots_.robots[i].robot.sonarSensors[j];
1204 return stdr_msgs::SonarSensorMsg();
1217 QString name = robotName + QString(
"/") + laserName;
1225 std::pair<QString,CLaserVisualisation *>(name,lv));
1226 lv->setWindowFlags(Qt::WindowStaysOnTopHint);
1243 QString name = robotName + QString(
"/") + sonarName;
1251 std::pair<QString,CSonarVisualisation *>(name,sv));
1252 sv->setWindowFlags(Qt::WindowStaysOnTopHint);
1266 QString name = robotName;
1274 std::pair<QString,CRobotVisualisation *>(name,sv));
1275 sv->setWindowFlags(Qt::WindowStaysOnTopHint);
1294 if(b == Qt::RightButton)
1298 QAction *nothing = myMenu.addAction(
1299 QString(
"Robot : ") +
1301 nothing->setCheckable(
false);
1302 nothing->setEnabled(
false);
1304 QAction *deleteRobot = myMenu.addAction(
icon_delete_,
"Delete robot");
1305 QAction *moveRobot = myMenu.addAction(
icon_move_,
"Move robot");
1306 myMenu.addSeparator();
1307 QAction *showCircle = myMenu.addAction(
"Show proximity circles");
1308 QAction *followRobot = myMenu.addAction(
"Follow robot");
1311 if(selectedItem == showCircle)
1315 else if(selectedItem == deleteRobot)
1320 else if(selectedItem == moveRobot)
1324 else if(selectedItem == followRobot)
1336 else if(b == Qt::LeftButton)
1344 if(i->second.checkProximity(pointClicked))
1346 if(b == Qt::RightButton)
1350 QAction *name = myMenu.addAction(
1351 QString(
"RFID tag : ") + QString(i->first)
1353 name->setCheckable(
false);
1354 name->setEnabled(
false);
1356 QAction *message = myMenu.addAction(
1357 QString(
"Message : ") + QString(i->second.getMessage())
1359 message->setCheckable(
false);
1360 message->setEnabled(
false);
1362 QAction *deleteTag = myMenu.addAction(
icon_delete_,
"Delete RFID tag");
1365 if(selectedItem == deleteTag)
1367 stdr_msgs::DeleteRfidTag srv;
1368 srv.request.name = i->first.toStdString();
1378 if(i->second.checkProximity(pointClicked))
1380 if(b == Qt::RightButton)
1384 QAction *name = myMenu.addAction(
1385 QString(
"CO2 Source : ") + QString(i->first)
1387 name->setCheckable(
false);
1388 name->setEnabled(
false);
1390 QAction *message = myMenu.addAction(
1391 QString(
"PPMs : ") + QString().setNum(i->second.getPpm())
1393 message->setCheckable(
false);
1394 message->setEnabled(
false);
1397 "Delete CO2 Source");
1400 if(selectedItem == deleteSource)
1402 stdr_msgs::DeleteCO2Source srv;
1403 srv.request.name = i->first.toStdString();
1413 if(i->second.checkProximity(pointClicked))
1415 if(b == Qt::RightButton)
1419 QAction *name = myMenu.addAction(
1420 QString(
"Thermal Source : ") + QString(i->first)
1422 name->setCheckable(
false);
1423 name->setEnabled(
false);
1425 QAction *message = myMenu.addAction(
1426 QString(
"Degrees : ") + QString().setNum(i->second.getDegrees())
1428 message->setCheckable(
false);
1429 message->setEnabled(
false);
1432 "Delete Thermal Source");
1435 if(selectedItem == deleteSource)
1437 stdr_msgs::DeleteThermalSource srv;
1438 srv.request.name = i->first.toStdString();
1448 if(i->second.checkProximity(pointClicked))
1450 if(b == Qt::RightButton)
1454 QAction *name = myMenu.addAction(
1455 QString(
"Sound Source : ") + QString(i->first)
1457 name->setCheckable(
false);
1458 name->setEnabled(
false);
1460 QAction *message = myMenu.addAction(
1461 QString(
"DBs : ") + QString().setNum(i->second.getDb())
1463 message->setCheckable(
false);
1464 message->setEnabled(
false);
1467 "Delete Sound Source");
1470 if(selectedItem == deleteSource)
1472 stdr_msgs::DeleteSoundSource srv;
1473 srv.request.name = i->first.toStdString();
1496 geometry_msgs::Pose2D newPose;
1497 newPose.x = pnew.x() *
map_msg_.info.resolution;
1498 newPose.y = pnew.y() *
map_msg_.info.resolution;
1513 "STDR robot - Error",
"Unable to relocate the robot");
1524 QString robotName,QString laserName)
1531 laserName.toStdString());
1534 laserName.toStdString());
1547 QString robotName,QString sonarName)
1554 sonarName.toStdString());
1557 sonarName.toStdString());
1569 (QString robotName,QString rfidReaderName)
1576 rfidReaderName.toStdString());
1579 rfidReaderName.toStdString());
1590 (QString robotName,QString co2SensorName)
1597 co2SensorName.toStdString());
1600 co2SensorName.toStdString());
1611 (QString robotName,QString thermalSensorName)
1618 thermalSensorName.toStdString());
1620 thermalSensorName, (vs + 1) % 3);
1622 thermalSensorName.toStdString());
1633 (QString robotName,QString soundSensorName)
1640 soundSensorName.toStdString());
1642 soundSensorName, (vs + 1) % 3);
1644 soundSensorName.toStdString());
void updateZoom(QPoint p, bool z)
Updates the map zoom. Wrapper for a loader function.
void thermalSensorVisibilityClicked(QString robotName, QString thermalSensorName)
Informs CGuiController that a Thermal Sensor visibility status has \ been clicked. Connects to the CInfoConnector::thermalSensorVisibilityClicked\ signal.
Implements the functionalities of the sonar visualization widget. Inherits form QWidget and Ui_sonarV...
void setLaserVisibility(QString robotName, QString laserName, char vs)
Is emitted when a laser's visibility status is going to be changed. Connects to the CInfoConnector::s...
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
CRobotCreatorConnector robotCreatorConn
< Serves the Qt events of the RobotCreator Widget
void saveRobotPressed(stdr_msgs::RobotMsg newRobotMsg, QString file_name)
Saves the robot in a yaml file. Connects to the CGuiConnector::CRobotCreatorConnector::saveRobotPress...
void sonarVisualizerClicked(QString robotName, QString sonarName)
Informs CGuiController that a sonar visualizer has been clicked. Connects to the CInfoConnector::sona...
void setGridColumnStretch(int cell, int stretch)
Wraps the Qt gridColumnStretch function.
const std::string & getFrameId(const T &t)
void setThermalSensorVisibility(QString robotName, QString thermalSensorName, char vs)
Is emitted when a thermal sensor's visibility status is going to be \ changed. Connects to the CInfoC...
void setMapInitialized(bool mi)
Sets the map_initialized_ private variable.
nav_msgs::OccupancyGrid map_msg_
Robot handler from stdr_robot.
Implements the functionalities of a sound source.
stdr_msgs::RobotIndexedMsg spawnNewRobot(const stdr_msgs::RobotMsg msg)
void thermalPlaceSet(QPoint p)
Gets the point at which the new thermal source is placed. Connects to the CMapConnector::thermalPlace...
void setRfidReaderVisibility(QString robotName, QString rfidReaderName, char vs)
Is emitted when a rfid sensor's visibility status is going to be \ changed. Connects to the CInfoConn...
void rfidPlaceSet(QPoint p)
Gets the point at which the new RFID tag is placed. Connects to the CMapConnector::robotPlaceSet sign...
void robotVisualizerClicked(QString robotName)
Informs CGuiController that a robot visualizer has been clicked. Connects to the CInfoConnector::robo...
void setSoundSensorVisibility(QString robotName, QString soundSensorName, char vs)
Is emitted when a sound sensor's visibility status is going to be \ changed. Connects to the CInfoCon...
std::map< QString, CSonarVisualisation * > sonar_visualizers_
Robot visualizers.
Implements the functionalities of the robot visualization widget. Inherits form QWidget and Ui_robotV...
CMapConnector map_connector_
void zoomOutPressed(QPoint p)
Performs zoom out when the button is pressed. Connects to the CMapConnector::zoomOutPressed signal...
void loadRfidPressed(void)
Informs CGuiController that an RFID is going to be placed in the environment. Connects to the CGuiCon...
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
std::map< QString, CGuiSoundSource > sound_sources_
ROS subscriber for occupancy grid map.
void loadSoundPressed(void)
Informs CGuiController that a sound source is going to be placed in the environment. Connects to the CGuiConnector::loadSoundPressed signal.
std::map< QString, CLaserVisualisation * > laser_visualizers_
Sonar visualizers.
void show(void)
Shows the main window.
void initializeCommunications(void)
Initializes the Qt event connections and ROS subscribers and publishers.
void receiveRobots(const stdr_msgs::RobotIndexedVectorMsg &msg)
Receives the robots from stdr_server. Connects to "stdr_server/active_robots" ROS topic...
ros::NodeHandle n_
ROS tf transform listener.
void waitForRfidPose(void)
Is emitted when a new rfid tag is going to be placed. Connects to the CMapConnector::waitForRfidPose ...
void loadThermalPressed(void)
Informs CGuiController that a thermal source is going to be placed in the environment. Connects to the CGuiConnector::loadThermalPressed signal.
void waitForRobotPose(void)
Is emitted when a new robot is going to be placed. Connects to the CMapConnector::waitForPlace slot...
void rfidReaderVisibilityClicked(QString robotName, QString rfidReaderName)
Informs CGuiController that a rfidReader visibility status has \ been clicked. Connects to the CInfoC...
QWidget * getLoader(void)
Returns the CMapLoader object.
ros::ServiceClient new_thermal_source_client_
Service client for deleting a thermal source.
~CGuiController(void)
Default destructor.
QIcon icon_delete_
QImage created one time, containing the OGM.
bool call(MReq &req, MRes &res)
void shutdown(void)
Shuts down the main window.
QIcon icon_move_
QIcon for delete robot (pop-up menu)
QTime elapsed_time_
QIcon for move robot (pop-up menu)
void receiveMap(const nav_msgs::OccupancyGrid &msg)
Receives the occupancy grid map from stdr_server. Connects to "map" ROS topic.
ros::ServiceClient delete_thermal_source_client_
Service client for inserting a new sound source.
QWidget * getLoader(void)
Returns the CInfoLoader object.
Implements the functionalities of a thermal source.
std::map< QString, CGuiSoundSource >::iterator SoundSourcesIterator
void replaceRobot(std::string robotFrameId)
Is emitted when a robot is going to be re-placed. Connects to the CMapConnector::waitForReplace slot...
std::string getName(void)
Returns the "name" of the source.
ros::Subscriber rfids_subscriber_
ROS subscriber for co2 sources.
QImage running_map_
Object of CGuiConnector.
Implements the functionalities of an RFID tag.
ros::ServiceClient delete_rfid_tag_client_
Service client for inserting a new co2 source.
std::map< QString, CRobotVisualisation * >::iterator RobotVisIterator
stdr_msgs::SoundSourceVector sound_source_pure_
Sound sources in the environment.
ROSCPP_DECL void spin(Spinner &spinner)
Implements the functionalities for a robot.
void laserVisibilityClicked(QString robotName, QString laserName)
Informs CGuiController that a laser visibility status has been clicked. Connects to the CInfoConnecto...
ros::Subscriber sound_sources_subscriber_
The ROS node handle.
void updateCenter(QPoint p)
Updates the map center when a robot is followed.
std::map< QString, CLaserVisualisation * >::iterator LaserVisIterator
void raiseMessage(QString title, QString s)
Raises a message box with a specific message.
void updateTree(const stdr_msgs::RobotIndexedVectorMsg &msg)
Updates the information tree according to the ensemble of robots.
void addToGrid(QWidget *w, int row, int column)
Adds a widget to the main window Qt grid.
stdr_msgs::LaserSensorMsg getLaserDescription(QString robotName, QString laserName)
Returns a stdr_msgs::LaserSensorMsg message from robot and laser name.
void robotReplaceSet(QPoint p, std::string robotName)
Informs CGuiController about the new pose of a robot. Connects to the CMapConnector::robotReplaceSet ...
bool closeTriggered(void)
Returns the exit triggered status.
void waitForThermalPose(void)
Is emitted when a new thermal source is going to be placed. Connects to the CMapConnector::waitForThe...
QEvent * getCloseEvent(void)
Returns the exit event captured.
ros::Subscriber co2_sources_subscriber_
ROS subscriber for thermal sources.
void loadRobotFromFilePressed(stdr_msgs::RobotMsg newRobotMsg)
Informs CGuiController that a robot is loaded from a yaml file. Connects to the CGuiConnector::robotF...
void setInitialImageSize(QSize s)
Sets map initial size to the loader.
QTimer * timer_
Elapsed time from the experiment's start.
stdr_robot::HandleRobot robot_handler_
All robots in "raw" form.
void setLaser(stdr_msgs::LaserSensorMsg msg)
Sets the laser description message.
static void saveMessage(T msg, std::string file_name)
void setCO2SensorVisibility(QString robotName, QString co2SensorName, char vs)
Is emitted when a CO2 sensor's visibility status is going to be \ changed. Connects to the CInfoConne...
std::map< QString, CRobotVisualisation * > robot_visualizers_
RFID tags in the environment.
void updateMapInfo(float width, float height, float ocgd)
Updates the information tree according to the specific map.
void waitForCo2Pose(void)
Is emitted when a new CO2 source is going to be placed. Connects to the CMapConnector::waitForCo2Pose...
ros::ServiceClient new_sound_source_client_
Service client for deleting a sound source.
stdr_msgs::RobotMsg getNewRobot(void)
Returns the created robot.
void setMessage(QString msg)
Sets the tag message.
Implements the functionalities of a CO2 source.
void setMapInitialized(bool mi)
Sets the map initialization status.
void receiveRfids(const stdr_msgs::RfidTagVector &msg)
Receives the existent rfid tags.
void setPpm(float ppm)
Sets the tag message.
ros::ServiceClient delete_co2_source_client_
Service client for inserting a new thermal source.
QImage initial_map_
QImage that initiates as initial_map and the elements are painted on it.
Implements the functionalities of the laser visualization widget. Inherits form QWidget and Ui_laserV...
std::map< QString, CSonarVisualisation * >::iterator SonarVisIterator
void drawGrid(QImage *img, float resolution)
Wrapper for the draw grid function of loader.
stdr_msgs::RfidTagVector rfid_tag_pure_
Thermal sources in the environment.
std::map< QString, CGuiThermalSource >::iterator ThermalSourcesIterator
Number of input arguments.
CGuiConnector gui_connector_
Object of CInfoConnector.
void laserVisualizerClicked(QString robotName, QString laserName)
Informs CGuiController that a laser visualizer has been clicked. Connects to the CInfoConnector::lase...
void setStatusBarMessage(QString s)
Displays a message in the QMainWindow status bar.
void loadCo2Pressed(void)
Informs CGuiController that a CO2 source is going to be placed in the environment. Connects to the CGuiConnector::loadCo2Pressed signal.
CInfoLoader loader
< Object of CInfoLoader
QPoint getGlobalPoint(QPoint p)
Returns the point in the real map image. Wrapper for a loader function.
void receiveThermalSources(const stdr_msgs::ThermalSourceVector &msg)
Receives the existent thermal sources.
CInfoConnector info_connector_
Object of CMapConnector.
tf::TransformListener listener_
The occypancy grid map.
bool deleteRobot(const std::string &name)
void waitForSoundPose(void)
Is emitted when a new sound source is going to be placed. Connects to the CMapConnector::waitForSOund...
ros::ServiceClient delete_sound_source_client_
void updateImage(QImage *img)
Emits the signalUpdateImage signal.
void co2PlaceSet(QPoint p)
Gets the point at which the new CO2 source is placed. Connects to the CMapConnector::co2PlaceSet sign...
void zoomInPressed(QPoint p)
Performs zoom in when the button is pressed. Connects to the CMapConnector::zoomInPressed signal...
void receiveSoundSources(const stdr_msgs::SoundSourceVector &msg)
Receives the existent sound sources.
std::map< QString, CGuiRfidTag >::iterator RfidTagIterator
void sonarVisibilityClicked(QString robotName, QString sonarName)
Informs CGuiController that a sonar visibility status has been clicked. Connects to the CInfoConnecto...
void receiveCO2Sources(const stdr_msgs::CO2SourceVector &msg)
Receives the existent co2 sources.
void soundPlaceSet(QPoint p)
Gets the point at which the new sound source is placed. Connects to the CMapConnector::soundPlaceSet ...
The main namespace for STDR GUI.
void loadRobotPressed(stdr_msgs::RobotMsg newRobotMsg)
Loads a robot from robot creator into map. Connects to the CGuiConnector::CRobotCreatorConnector::loa...
void setSonar(stdr_msgs::SonarSensorMsg msg)
Sets the sonar description message.
ros::Subscriber robot_subscriber_
ROS subscriber for rfids.
void cleanupVisualizers(const stdr_msgs::RobotIndexedVectorMsg &msg)
Dumps all visualizers that connect to robots not existent in the input argument message.
void updateMapInternal(void)
Updates the map to be shown in GUI. Connects to the timeout signal of timer_.
stdr_msgs::RobotIndexedVectorMsg all_robots_
Timer for the drawing event.
void setNewRobot(stdr_msgs::RobotMsg msg)
Sets the created robot.
bool map_lock_
Prevents actions before map initializes.
std::map< QString, CGuiCo2Source > co2_sources_
Sound sources in the environment.
std::set< std::string > my_robots_
Laser visualizers.
bool init()
Initializes the ROS spin and Qt threads.
CGuiController(int argc, char **argv)
Default contructor.
std::string robot_following_
Service client for inserting a new rfid tag.
void setInitialPose(float x, float y)
Sets the robot's initial pose.
ros::Subscriber map_subscriber_
ROS subscriber to get all robots.
stdr_msgs::CO2SourceVector co2_source_pure_
CO2 sources in the environment.
std::vector< CGuiRobot > registered_robots_
Robots created from the specific GUI instance.
std::map< QString, CGuiThermalSource > thermal_sources_
The original vector.
void setupWidgets(void)
Sets up the main window widgets.
void robotPlaceSet(QPoint p)
Gets the point at which the new robot is placed. Connects to the CMapConnector::robotPlaceSet signal...
ros::ServiceClient new_rfid_tag_client_
Service client for deleting a rfid tag.
QPoint mapToGlobal(QPoint p)
Calls the Qt function that gets the real point that the event happened.
void setRobotVisibility(QString robotName, char vs)
Is emitted when a robot's visibility status is going to be changed. Connects to the CInfoConnector::s...
void setSonarVisibility(QString robotName, QString sonarName, char vs)
Is emitted when a sonar's visibility status is going to be changed. Connects to the CInfoConnector::s...
bool moveRobot(const std::string &name, const geometry_msgs::Pose2D newPose)
stdr_msgs::ThermalSourceVector thermal_source_pure_
CO2 sources in the environment.
void uncheckZoomButtons(void)
Unchecks the zoom in & out buttons when right click in map is pushed.
void co2SensorVisibilityClicked(QString robotName, QString co2SensorName)
Informs CGuiController that a CO2Sensor visibility status has \ been clicked. Connects to the CInfoCo...
void spinThreadFunction(void)
Thread that performs the ros::spin functionality.
stdr_msgs::SonarSensorMsg getSonarDescription(QString robotName, QString sonarName)
Returns a stdr_msgs::SonarSensorMsg message from robot and sonar name.
void itemClicked(QPoint p, Qt::MouseButton b)
Informs CGuiController that click has performed in the map. Connects to the CMapConnector::itemClicke...
void robotVisibilityClicked(QString robotName)
Informs CGuiController that a robot visibility status has been clicked. Connects to the CInfoConnecto...
ros::ServiceClient new_co2_source_client_
Service client for deleting a co2 source.
void setDegrees(float degrees)
Sets the tag message.
bool isGridEnabled(void)
Returns the grid enabled state.
std::map< QString, CGuiCo2Source >::iterator Co2SourcesIterator
std::map< QString, CGuiRfidTag > rfid_tags_
The original rfid vector.
bool map_initialized_
All the robots server has.
void soundSensorVisibilityClicked(QString robotName, QString soundSensorName)
Informs CGuiController that a sound Sensor visibility status has \ been clicked. Connects to the CInf...
ros::Subscriber thermal_sources_subscriber_
ROS subscriber for sound sources.