35 resolution_(resolution)
38 setWindowTitle(
name_);
44 name_.toStdString().c_str(),
52 QImage::Format_RGB32);
110 laserMax->setText(QString().setNum(msg.maxRange) + QString(
" m"));
111 laserMin->setText(QString().setNum(msg.minRange) + QString(
" m"));
133 for(
unsigned int i = 0 ; i <
scan_.ranges.size() ; i++)
136 float real_dist =
scan_.ranges[i];
137 if(real_dist >
msg_.maxRange)
139 real_dist =
msg_.maxRange;
140 painter.setPen(QColor(255,0,0,100));
142 else if(real_dist <
msg_.minRange)
144 real_dist =
msg_.minRange;
145 painter.setPen(QColor(100,100,100,100));
149 painter.setPen(QColor(255,0,0,100));
157 cos(
scan_.angle_min + ((
float)i) *
scan_.angle_increment) *
160 sin(
scan_.angle_min + ((
float)i) *
scan_.angle_increment) *
165 QString().setNum(mean/
scan_.ranges.size()) + QString(
" m"));
166 laserImage->setPixmap(
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
sensor_msgs::LaserScan scan_
Subscriber for getting the laser scans.
stdr_msgs::LaserSensorMsg msg_
The image to draw into.
void destruct(void)
Destroys the visualizer.
ros::Subscriber subscriber_
Description of the laser sensor.
bool active_
< True if the visualizer is active
CLaserVisualisation(QString name, float resolution)
Default contructor.
void setLaser(stdr_msgs::LaserSensorMsg msg)
Sets the laser description message.
void paint(void)
Paints the visualizer.
QImage internal_image_
A void image.
The main namespace for STDR GUI.
void closeEvent(QCloseEvent *event)
Called when the close event is triggered.
QImage void_image_
The laser frame id.
bool getActive(void)
Returns true if the visualizer is active.
~CLaserVisualisation(void)
Default destructor.
void callback(const sensor_msgs::LaserScan &msg)
Called when new laser data are available.