34 resolution_(resolution)
37 setWindowTitle(
name_);
43 name_.toStdString().c_str(),
102 sonarMaxDist->setText(QString().setNum(msg.maxRange) + QString(
" m"));
103 sonarMinDist->setText(QString().setNum(msg.minRange) + QString(
" m"));
123 float real_dist =
range_.range;
124 if(real_dist >
msg_.maxRange)
126 real_dist =
msg_.maxRange;
128 else if(real_dist <
msg_.minRange)
130 real_dist =
msg_.minRange;
133 sonarDist->setText(QString().setNum(real_dist) + QString(
" m"));
134 sonarDistBar->setValue(sonarDistBar->maximum() * real_dist /
msg_.maxRange);
void closeEvent(QCloseEvent *event)
Called when the close event is triggered.
CSonarVisualisation(QString name, float resolution)
Default contructor.
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
~CSonarVisualisation(void)
Default destructor.
void callback(const sensor_msgs::Range &msg)
Called when new laser data are available.
void destruct(void)
Destroys the visualizer.
void paint(void)
Paints the visualizer.
sensor_msgs::Range range_
Subscriber for getting the sonar ranges.
stdr_msgs::SonarSensorMsg msg_
The laser frame id.
The main namespace for STDR GUI.
void setSonar(stdr_msgs::SonarSensorMsg msg)
Sets the sonar description message.
ros::Subscriber subscriber_
Description of the sonar sensor.
bool getActive(void)
Returns true if the visualizer is active.
bool active_
< True if the visualizer is active