@@ -39,11 +39,11 @@ namespace autoware_overlay_rviz_plugin
39
39
SignalDisplay::SignalDisplay ()
40
40
{
41
41
property_width_ = new rviz_common::properties::IntProperty (
42
- " Width" , 517 , " Width of the overlay" , this , SLOT (updateOverlaySize ()));
42
+ " Width" , 550 , " Width of the overlay" , this , SLOT (updateOverlaySize ()));
43
43
property_height_ = new rviz_common::properties::IntProperty (
44
- " Height" , 175 , " Height of the overlay" , this , SLOT (updateOverlaySize ()));
44
+ " Height" , 100 , " Height of the overlay" , this , SLOT (updateOverlaySize ()));
45
45
property_left_ = new rviz_common::properties::IntProperty (
46
- " Left" , 10 , " Left position of the overlay" , this , SLOT (updateOverlayPosition ()));
46
+ " Left" , 0 , " Left position of the overlay" , this , SLOT (updateOverlayPosition ()));
47
47
property_top_ = new rviz_common::properties::IntProperty (
48
48
" Top" , 10 , " Top position of the overlay" , this , SLOT (updateOverlayPosition ()));
49
49
property_signal_color_ = new rviz_common::properties::ColorProperty (
@@ -325,35 +325,31 @@ void SignalDisplay::drawWidget(QImage & hud)
325
325
QPainter painter (&hud);
326
326
painter.setRenderHint (QPainter::Antialiasing, true );
327
327
328
- QRectF backgroundRect (0 , 0 , 322 , hud.height ());
328
+ QRectF backgroundRect (0 , 0 , 550 , hud.height ());
329
329
drawHorizontalRoundedRectangle (painter, backgroundRect);
330
330
331
331
// Draw components
332
- if (steering_wheel_display_) {
333
- steering_wheel_display_->drawSteeringWheel (painter, backgroundRect);
334
- }
335
332
if (gear_display_) {
336
333
gear_display_->drawGearIndicator (painter, backgroundRect);
337
334
}
335
+
336
+ if (steering_wheel_display_) {
337
+ steering_wheel_display_->drawSteeringWheel (painter, backgroundRect);
338
+ }
339
+
338
340
if (speed_display_) {
339
341
speed_display_->drawSpeedDisplay (painter, backgroundRect);
340
342
}
341
343
if (turn_signals_display_) {
342
344
turn_signals_display_->drawArrows (painter, backgroundRect, property_signal_color_->getColor ());
343
345
}
344
346
345
- // a 27px space between the two halves of the HUD
346
-
347
- QRectF smallerBackgroundRect (340 , 0 , 190.0 / 2 , hud.height ());
348
-
349
- drawVerticalRoundedRectangle (painter, smallerBackgroundRect);
350
-
351
347
if (traffic_display_) {
352
- traffic_display_->drawTrafficLightIndicator (painter, smallerBackgroundRect );
348
+ traffic_display_->drawTrafficLightIndicator (painter, backgroundRect );
353
349
}
354
350
355
351
if (speed_limit_display_) {
356
- speed_limit_display_->drawSpeedLimitIndicator (painter, smallerBackgroundRect );
352
+ speed_limit_display_->drawSpeedLimitIndicator (painter, backgroundRect );
357
353
}
358
354
359
355
painter.end ();
@@ -364,8 +360,8 @@ void SignalDisplay::drawHorizontalRoundedRectangle(
364
360
{
365
361
painter.setRenderHint (QPainter::Antialiasing, true );
366
362
QColor colorFromHSV;
367
- colorFromHSV.setHsv (0 , 0 , 0 ); // Hue, Saturation, Value
368
- colorFromHSV.setAlphaF (0.65 ); // Transparency
363
+ colorFromHSV.setHsv (0 , 0 , 29 ); // Hue, Saturation, Value
364
+ colorFromHSV.setAlphaF (0.60 ); // Transparency
369
365
370
366
painter.setBrush (colorFromHSV);
371
367
@@ -404,7 +400,9 @@ void SignalDisplay::updateOverlaySize()
404
400
void SignalDisplay::updateOverlayPosition ()
405
401
{
406
402
std::lock_guard<std::mutex> lock (mutex_);
407
- overlay_->setPosition (property_left_->getInt (), property_top_->getInt ());
403
+ overlay_->setPosition (
404
+ property_left_->getInt (), property_top_->getInt (), HorizontalAlignment::CENTER,
405
+ VerticalAlignment::TOP);
408
406
queueRender ();
409
407
}
410
408
0 commit comments