stdr_robot_creator_connector.h
Go to the documentation of this file.
00001 /******************************************************************************
00002    STDR Simulator - Simple Two DImensional Robot Simulator
00003    Copyright (C) 2013 STDR Simulator
00004    This program is free software; you can redistribute it and/or modify
00005    it under the terms of the GNU General Public License as published by
00006    the Free Software Foundation; either version 3 of the License, or
00007    (at your option) any later version.
00008    This program is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011    GNU General Public License for more details.
00012    You should have received a copy of the GNU General Public License
00013    along with this program; if not, write to the Free Software Foundation,
00014    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
00015    
00016    Authors : 
00017    * Manos Tsardoulias, etsardou@gmail.com
00018    * Aris Thallas, aris.thallas@gmail.com
00019    * Chris Zalidis, zalidis@gmail.com 
00020 ******************************************************************************/
00021 
00022 #ifndef STDR_ROBOT_CREATOR_CONNECTOR
00023 #define STDR_ROBOT_CREATOR_CONNECTOR
00024 
00025 #include "stdr_gui/stdr_robot_creator/stdr_robot_creator_loader.h"
00026 
00031 namespace stdr_gui
00032 {
00037   class CRobotCreatorConnector:
00038     public QObject
00039   {
00040     Q_OBJECT
00041     //------------------------------------------------------------------------//
00042     private:
00044       int   argc_; 
00046       char**  argv_;
00047       
00049       float climax_;
00050       
00052       CRobotCreatorLoader loader_;
00053       
00055       stdr_msgs::RobotMsg new_robot_msg_;
00056       
00058       unsigned int laser_hightlight_id_;
00060       unsigned int sonar_hightlight_id_;
00062       unsigned int rfid_antenna_hightlight_id_;
00064       unsigned int co2_sensor_hightlight_id_;
00065       unsigned int thermal_sensor_hightlight_id_;
00066       unsigned int sound_sensor_hightlight_id_;
00067       
00069       QTreeWidgetItem* current_laser_;
00071       QTreeWidgetItem* current_sonar_;
00073       QTreeWidgetItem* current_rfid_;
00074       QTreeWidgetItem* current_co2_sensor_;
00075       QTreeWidgetItem* current_thermal_sensor_;
00076       QTreeWidgetItem* current_sound_sensor_;
00078       QTreeWidgetItem* current_footprint_point_;
00079       
00085       void showMessage(QString msg);
00086     
00087     //------------------------------------------------------------------------//
00088     public:
00089     
00091       static int laser_number;
00093       static int sonar_number;
00095       static int rfid_number;
00096       static int co2_sensors_number;
00097       static int thermal_sensors_number;
00098       static int sound_sensors_number;
00099     
00106       CRobotCreatorConnector(int argc, char **argv);
00107       
00112       ~CRobotCreatorConnector(void);
00113       
00118       void initialise(void);
00119       
00125       void deleteTreeNode(QTreeWidgetItem *item);
00126       
00131       void editRobot(void);
00132       
00137       void addLaser(void);
00138       
00144       void addLaser(stdr_msgs::LaserSensorMsg lmsg);
00145       
00151       void eraseLaser(QTreeWidgetItem *item);
00152       
00158       void editLaser(QTreeWidgetItem *item);
00159       
00165       int searchLaser(QString frameId);
00166       
00172       void saveLaser(QTreeWidgetItem *item);
00173       
00179       void loadLaser(QTreeWidgetItem *item);
00180       
00187       void updateLaserTree(QTreeWidgetItem *item,stdr_msgs::LaserSensorMsg l);
00188       
00193       void addFootprintPoint(void);
00194       
00199       void addFootprintPoint(geometry_msgs::Point pt);
00200       
00205       void eraseFootprintPoint(QTreeWidgetItem *item);
00206       
00211       void addSonar(void);
00212       
00218       void addSonar(stdr_msgs::SonarSensorMsg smsg);
00219       
00225       void eraseSonar(QTreeWidgetItem *item);
00226       
00232       void editSonar(QTreeWidgetItem *item);
00233       
00239       int searchSonar(QString frameId);
00240       
00246       void saveSonar(QTreeWidgetItem *item);
00247       
00253       void saveRfidAntenna(QTreeWidgetItem *item);
00254       void saveCO2Sensor(QTreeWidgetItem *item);
00255       void saveThermalSensor(QTreeWidgetItem *item);
00256       void saveSoundSensor(QTreeWidgetItem *item);
00257       
00263       void loadSonar(QTreeWidgetItem *item);
00264       
00270       void loadRfidAntenna(QTreeWidgetItem *item);
00271       void loadCO2Sensor(QTreeWidgetItem *item);
00272       void loadThermalSensor(QTreeWidgetItem *item);
00273       void loadSoundSensor(QTreeWidgetItem *item);
00274       
00281       void updateSonarTree(QTreeWidgetItem *item,stdr_msgs::SonarSensorMsg l);
00282       
00289       void updateRfidTree(QTreeWidgetItem *item,stdr_msgs::RfidSensorMsg l);
00290       void updateCO2SensorTree(QTreeWidgetItem *item,stdr_msgs::CO2SensorMsg l);
00291       void updateThermalSensorTree(QTreeWidgetItem *item,stdr_msgs::ThermalSensorMsg l);
00292       void updateSoundSensorTree(QTreeWidgetItem *item,stdr_msgs::SoundSensorMsg l);
00293       
00298       void addRfidAntenna(void);
00299       void addCO2Sensor(void);
00300       void addThermalSensor(void);
00301       void addSoundSensor(void);
00302       
00308       void addRfidAntenna(stdr_msgs::RfidSensorMsg rmsg);
00309       void addCO2Sensor(stdr_msgs::CO2SensorMsg rmsg);
00310       void addThermalSensor(stdr_msgs::ThermalSensorMsg rmsg);
00311       void addSoundSensor(stdr_msgs::SoundSensorMsg rmsg);
00312       
00318       void eraseRfid(QTreeWidgetItem *item);
00319       void eraseCO2Sensor(QTreeWidgetItem *item);
00320       void eraseThermalSensor(QTreeWidgetItem *item);
00321       void eraseSoundSensor(QTreeWidgetItem *item);
00322       
00328       void editRfid(QTreeWidgetItem *item);
00329       void editCO2Sensor(QTreeWidgetItem *item);
00330       void editThermalSensor(QTreeWidgetItem *item);
00331       void editSoundSensor(QTreeWidgetItem *item);
00332       
00338       void editFootprintPoint(QTreeWidgetItem *item);
00339       
00345       int searchRfid(QString frameId);
00346       int searchCO2Sensor(QString frameId);
00347       int searchThermalSensor(QString frameId);
00348       int searchSoundSensor(QString frameId);
00349       
00354       void drawRobot(void);
00355       
00360       void drawLasers(void);
00361       
00366       void drawSonars(void);
00367       
00372       void drawRfidAntennas(void);
00373       void drawCO2Sensors(void);
00374       void drawThermalSensors(void);
00375       void drawSoundSensors(void);
00376 
00381       void updateRobotPreview(void);
00382       
00387       void updateRobotTree(void);
00388       
00395       void setInitialPose(float x, float y);
00396       
00401       stdr_msgs::RobotMsg getNewRobot(void);
00402       
00408       void setNewRobot(stdr_msgs::RobotMsg msg);
00409     
00410     //------------------------------------------------------------------------//  
00411     public Q_SLOTS:
00412     
00419       void treeItemClicked ( QTreeWidgetItem * item, int column );
00420       
00425       void updateLaser(void);
00426       
00431       void updateSonar(void);
00432       
00437       void updateLaserOpen(void);
00438       
00443       void updateSonarOpen(void);
00444       
00449       void updateRfidAntenna(void);
00450       void updateCO2Sensor(void);
00451       void updateThermalSensor(void);
00452       void updateSoundSensor(void);
00453       void updateKinematicModel(void);
00454       
00459       void updateRfidAntennaOpen(void);
00460       void updateCO2SensorOpen(void);
00461       void updateThermalSensorOpen(void);
00462       void updateSoundSensorOpen(void);
00463       
00468       void updateRobot(void);
00469       
00474       void updateRobotOpen(void);
00475       
00480       void updateFootprintPoint(void);
00481       
00486       void updateFootprintPointOpen(void);
00487       
00492       void saveRobot(void);
00493       
00498       void getRobotFromYaml(void);
00499       
00504       void loadRobot(void);
00505     
00506     //------------------------------------------------------------------------//  
00507     Q_SIGNALS:
00508     
00514       void loadRobotPressed(stdr_msgs::RobotMsg newRobotMsg);
00515       
00522       void saveRobotPressed(stdr_msgs::RobotMsg newRobotMsg,QString file_name);
00523   };
00524 }
00525 
00526 #endif


stdr_gui
Author(s): Manos Tsardoulias
autogenerated on Thu Jun 6 2019 18:57:38