101 float pose_theta = yaw;
105 float real_dist =
range_.range;
106 if(real_dist >
msg_.maxRange)
108 real_dist =
msg_.maxRange;
110 painter.setBrush(brush);
111 QPen pen(QColor(0,0,0,0));
114 else if(real_dist <
msg_.minRange)
116 real_dist =
msg_.minRange;
118 painter.setBrush(brush);
119 QPen pen(QColor(0,0,0,0));
125 painter.setBrush(brush);
126 QPen pen(QColor(0,0,0,0));
131 pose_x / ocgd - real_dist / ocgd,
133 pose_y / ocgd - real_dist / ocgd,
135 real_dist / ocgd * 2,
136 real_dist / ocgd * 2,
138 - (pose_theta -
msg_.coneAngle / 2.0)
158 float size = m->width();
159 float climax = size / maxRange * ocgd / 2.1;
163 float real_dist =
range_.range;
164 if(real_dist >
msg_.maxRange)
166 real_dist =
msg_.maxRange;
167 QBrush brush(QColor(100,100,100,100));
168 painter.setBrush(brush);
170 else if(real_dist <
msg_.minRange)
172 real_dist =
msg_.minRange;
173 QBrush brush(QColor(100,100,100,100));
174 painter.setBrush(brush);
178 QBrush brush(QColor(0,200,0,100));
179 painter.setBrush(brush);
183 size / 2 + (
msg_.pose.x / ocgd - real_dist / ocgd) * climax,
184 size / 2 + (
msg_.pose.y / ocgd - real_dist / ocgd) * climax,
186 real_dist / ocgd * 2 * climax,
187 real_dist / ocgd * 2 * climax,
202 return msg_.maxRange;
229 return msg_.frame_id;
~CGuiSonar(void)
Default destructor.
stdr_msgs::SonarSensorMsg msg_
Subscriber for the ros sensor msg.
char getVisualizationStatus(void)
Returns the visibility status of the specific sonar sensor.
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
void toggleVisualizationStatus(void)
Toggles the visibility status of the specific sonar sensor.
std::string topic_
The ROS tf frame.
char visualization_status_
void callback(const sensor_msgs::Range &msg)
Callback for the ros sonar message.
sensor_msgs::Range range_
Visualization status of the specific sonar.
bool lock_
< Used to avoid drawing when a new sonar message arives
TFSIMD_FORCE_INLINE const tfScalar & x() const
CGuiSonar(stdr_msgs::SonarSensorMsg msg, std::string baseTopic)
Default contructor.
std::string tf_frame_
A sonar sensor message : Depscription of a sonar sensor.
void getRPY(tfScalar &roll, tfScalar &pitch, tfScalar &yaw, unsigned int solution_number=1) const
TFSIMD_FORCE_INLINE const tfScalar & y() const
std::string getFrameId(void)
Returns the frame id of the specific sonar sensor.
void paint(QImage *m, float ocgd, tf::TransformListener *listener)
Paints the sonar range in the map image.
The main namespace for STDR GUI.
float getMaxRange(void)
Returns the max range of the specific sonar sensor.
void setVisualizationStatus(char vs)
Sets the visibility status of the specific sonar sensor.
void visualizerPaint(QImage *m, float ocgd, float maxRange)
Paints the sonar range in it's own visualizer.
ros::Subscriber subscriber_
The ros sonar range msg.