38 radius_ = msg.robot.footprint.radius;
43 for(
unsigned int i = 0 ; i < msg.robot.laserSensors.size() ; i++)
48 for(
unsigned int i = 0 ; i < msg.robot.sonarSensors.size() ; i++)
53 for(
unsigned int i = 0 ; i < msg.robot.rfidSensors.size() ; i++)
58 for(
unsigned int i = 0 ; i < msg.robot.co2Sensors.size() ; i++)
63 for(
unsigned int i = 0 ; i < msg.robot.thermalSensors.size() ; i++)
68 for(
unsigned int i = 0 ; i < msg.robot.soundSensors.size() ; i++)
104 std::string speeds_topic =
frame_id_ + std::string(
"/cmd_vel");
106 speeds_topic.c_str(),
134 for(
unsigned int i = 0 ; i <
lasers_.size() ; i++)
138 for(
unsigned int i = 0 ; i <
sonars_.size() ; i++)
142 for(
unsigned int i = 0 ; i <
rfids_.size() ; i++)
170 painter.setRenderHint(QPainter::Antialiasing,
true);
194 static QPointF *points =
new QPointF[
footprint_.points.size() + 1];
196 for(
unsigned int i = 0 ; i <
footprint_.points.size() + 1; i++)
221 painter.drawPolyline(points,
footprint_.points.size() + 1);
235 for(
unsigned int i = 0 ; i < 5 ; i++)
255 float dist = sqrt( pow(dx,2) + pow(dy,2) );
273 for(
unsigned int i = 0 ; i <
lasers_.size() ; i++)
277 for(
unsigned int i = 0 ; i <
sonars_.size() ; i++)
321 painter.setFont(QFont(
"Courier New"));
409 for(
unsigned int l = 0 ; l <
lasers_.size() ; l++)
411 float t =
lasers_[l]->getMaxRange();
417 for(
unsigned int l = 0 ; l <
sonars_.size() ; l++)
419 float t =
sonars_[l]->getMaxRange();
427 for(
unsigned int l = 0 ; l <
lasers_.size() ; l++)
431 for(
unsigned int l = 0 ; l <
sonars_.size() ; l++)
445 for(
unsigned int i = 0 ; i <
lasers_.size() ; i++)
449 return lasers_[i]->getVisualizationStatus();
462 for(
unsigned int i = 0 ; i <
rfids_.size() ; i++)
466 return rfids_[i]->getVisualizationStatus();
530 for(
unsigned int i = 0 ; i <
lasers_.size() ; i++)
534 lasers_[i]->toggleVisualizationStatus();
546 for(
unsigned int i = 0 ; i <
sonars_.size() ; i++)
550 return sonars_[i]->getVisualizationStatus();
563 for(
unsigned int i = 0 ; i <
sonars_.size() ; i++)
567 sonars_[i]->toggleVisualizationStatus();
579 for(
unsigned int i = 0 ; i <
rfids_.size() ; i++)
583 rfids_[i]->toggleVisualizationStatus();
649 for(
unsigned int i = 0 ; i <
lasers_.size() ; i++)
653 for(
unsigned int i = 0 ; i <
sonars_.size() ; i++)
657 for(
unsigned int i = 0 ; i <
rfids_.size() ; i++)
681 std::vector<float> speeds;
695 for(
unsigned int i = 0 ; i <
rfids_.size() ; i++)
697 rfids_[i]->setEnvironmentalTags(env_tags);
void setEnvironmentalTags(stdr_msgs::RfidTagVector env_tags)
Sets the tags existent in the environment.
char getThermalSensorVisualizationStatus(std::string frame_id)
Returns the rfid reader visibility status.
char getCO2SensorVisualizationStatus(std::string frame_id)
Returns the rfid reader visibility status.
bool robot_initialized_
Check for start.
void setEnvironmentalThermalSources(stdr_msgs::ThermalSourceVector env_thermal_sources)
Sets the thermal sources existent in the environment.
bool getShowLabel(void)
Gets the show_label_ flag.
float linear_speed_y_
Robot current angular speed.
geometry_msgs::Pose2D initial_pose_
Current robot pose.
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
char visualization_status_
void setEnvironmentalCO2Sources(stdr_msgs::CO2SourceVector env_co2_sources)
Sets the tags existent in the environment.
void toggleVisualizationStatus(void)
Toggles the visibility status.
bool show_label_
< If true the robot's label is visible
std::vector< CGuiSonar * > sonars_
Robot Rfid antenna sensors.
void destroy(void)
Destroys the robot object.
CGuiRobot(const stdr_msgs::RobotIndexedMsg &msg)
Default contructor.
void draw(QImage *m, float ocgd, tf::TransformListener *listener)
Paints the robot and it's sensors to the image.
std::string frame_id_
Initial robot pose.
char getSoundSensorVisualizationStatus(std::string frame_id)
Returns the rfid reader visibility status.
char getRfidReaderVisualizationStatus(std::string frame_id)
Returns the rfid reader visibility status.
TFSIMD_FORCE_INLINE const tfScalar & y() const
Implements the functionalities for a sonar sensor.
float radius_
Map resolution.
std::vector< CGuiRfid * > rfids_
Robot Rfid antenna sensors.
float angular_speed_
Radius of robot if shape is circular.
std::vector< CGuiCO2 * > co2_sensors_
Robot Rfid antenna sensors.
void toggleSonarVisualizationStatus(std::string frame_id)
Toggles the sonar visibility status.
void toggleLaserVisualizationStatus(std::string frame_id)
Toggles the laser visibility status.
bool checkEventProximity(QPoint p)
Checks if the robot is near a specific point.
void speedsCallback(const geometry_msgs::Twist &msg)
Callback for the ros laser message.
char getVisualizationStatus(void)
Returns the visibility status.
TFSIMD_FORCE_INLINE const tfScalar & x() const
bool started_
Subscriber for the speeds twist message.
void toggleThermalSensorVisualizationStatus(std::string frame_id)
Toggles the rfid reader visibility status.
void toggleSoundSensorVisualizationStatus(std::string frame_id)
Toggles the rfid reader visibility status.
void drawLabel(QImage *m, float ocgd)
Draws the robot's label.
ros::Subscriber speeds_subscriber_
Robot current linear speed.
int getSonarsNumber(void)
Returns the sonars number.
~CGuiRobot(void)
Default destructor.
void getRPY(tfScalar &roll, tfScalar &pitch, tfScalar &yaw, unsigned int solution_number=1) const
Implements the functionalities for an RFID antenna sensor.
void toggleCO2SensorVisualizationStatus(std::string frame_id)
Toggles the rfid reader visibility status.
TFSIMD_FORCE_INLINE const tfScalar & y() const
std::string getFrameId(void)
Returns the frame id of the specific robot.
int getLasersNumber(void)
Returns the lasers number.
TFSIMD_FORCE_INLINE const tfScalar & x() const
QPoint getCurrentPose(void)
Returns the current robot pose.
geometry_msgs::Pose2D current_pose_
Robot footprint if not circular.
bool show_circles_
True when robot is initialized.
std::vector< CGuiLaser * > lasers_
Robot sonar sensors.
void toggleShowLabel(void)
Toggles the show_label_ flag.
Implements the functionalities for an RFID antenna sensor.
The main namespace for STDR GUI.
char getSonarVisualizationStatus(std::string frame_id)
Returns the sonar visibility status.
void toggleRfidReaderVisualizationStatus(std::string frame_id)
Toggles the rfid reader visibility status.
stdr_msgs::FootprintMsg footprint_
Visualization image.
float linear_speed_
Robot current linear speed by Y.
QImage getVisualization(float ocgd)
Returns the visualization image of the robot.
geometry_msgs::Pose2D getCurrentPoseM(void)
Returns the current robot pose in meters.
void setEnvironmentalSoundSources(stdr_msgs::SoundSourceVector env_sound_sources)
Sets the sound sources existent in the environment.
std::vector< float > getSpeeds(void)
Returns the current robot speed.
void drawSelf(QImage *m)
Draws the robot body.
std::vector< CGuiThermal * > thermal_sensors_
Robot Rfid antenna sensors.
Implements the functionalities for a laser sensor.
void setShowLabel(bool b)
Sets the show_label_ flag.
char getLaserVisualizationStatus(std::string frame_id)
Returns the laser visibility status.
float resolution_
Robot laser sensors.
void toggleShowCircles(void)
Toggles the show_circles_ flag.
std::vector< CGuiSound * > sound_sensors_
Robot frame id.