BoundingBoxDisplay::BoundingBoxDisplay() { coloring_property_ = new rviz::EnumProperty( "coloring", "Flat color", "coloring method", this, SLOT(updateColoring())); coloring_property_->addOption("Flat color", 0); coloring_property_->addOption("Label", 1); coloring_property_->addOption("Value", 2); color_property_ = new rviz::ColorProperty( "color", QColor(25, 255, 0), "color to draw the bounding boxes", this, SLOT(updateColor())); alpha_property_ = new rviz::FloatProperty( "alpha", 0.8, "alpha value to draw the bounding boxes", this, SLOT(updateAlpha())); only_edge_property_ = new rviz::BoolProperty( "only edge", false, "show only the edges of the boxes", this, SLOT(updateOnlyEdge())); line_width_property_ = new rviz::FloatProperty( "line width", 0.005, "line width of the edges", this, SLOT(updateLineWidth())); show_coords_property_ = new rviz::BoolProperty( "show coords", false, "show coordinate of bounding box", this, SLOT(updateShowCoords())); }
void OverlayTextDisplay::updateOvertakeColorProperties() { if (!overtake_color_properties_ && overtake_color_properties_property_->getBool()) { // read all the parameters from properties updateFGColor(); updateFGAlpha(); updateBGColor(); updateBGAlpha(); updateFont(); updateLineWidth(); require_update_texture_ = true; } overtake_color_properties_ = overtake_color_properties_property_->getBool(); if (overtake_color_properties_) { fg_color_property_->show(); fg_alpha_property_->show(); bg_color_property_->show(); bg_alpha_property_->show(); line_width_property_->show(); font_property_->show(); } else { fg_color_property_->hide(); fg_alpha_property_->hide(); bg_color_property_->hide(); bg_alpha_property_->hide(); line_width_property_->hide(); font_property_->hide(); } }
PathDisplay::PathDisplay() { style_property_ = new EnumProperty( "Line Style", "Lines", "The rendering operation to use to draw the grid lines.", this, SLOT( updateStyle() )); style_property_->addOption( "Lines", LINES ); style_property_->addOption( "Billboards", BILLBOARDS ); line_width_property_ = new FloatProperty( "Line Width", 0.03, "The width, in meters, of each path line." "Only works with the 'Billboards' style.", this, SLOT( updateLineWidth() ), this ); line_width_property_->setMin( 0.001 ); line_width_property_->hide(); color_property_ = new ColorProperty( "Color", QColor( 25, 255, 0 ), "Color to draw the path.", this ); alpha_property_ = new FloatProperty( "Alpha", 1.0, "Amount of transparency to apply to the path.", this ); buffer_length_property_ = new IntProperty( "Buffer Length", 1, "Number of paths to display.", this, SLOT( updateBufferLength() )); buffer_length_property_->setMin( 1 ); offset_property_ = new VectorProperty( "Offset", Ogre::Vector3::ZERO, "Allows you to offset the path from the origin of the reference frame. In meters.", this, SLOT( updateOffset() )); }
void Plotter2DDisplay::onInitialize() { static int count = 0; rviz::UniformStringStream ss; ss << "Plotter2DDisplayObject" << count++; overlay_.reset(new OverlayObject(ss.str())); updateBufferSize(); onEnable(); updateShowValue(); updateWidth(); updateHeight(); updateLeft(); updateTop(); updateFGColor(); updateBGColor(); updateFGAlpha(); updateBGAlpha(); updateLineWidth(); updateUpdateInterval(); updateShowBorder(); updateAutoColorChange(); updateMaxColor(); updateShowCaption(); updateTextSize(); updateAutoScale(); updateMinValue(); updateMaxValue(); overlay_->updateTextureSize(width_property_->getInt(), height_property_->getInt() + caption_offset_); }
GridDisplay::GridDisplay() : Display() { frame_property_ = new TfFrameProperty( "Reference Frame", TfFrameProperty::FIXED_FRAME_STRING, "The TF frame this grid will use for its origin.", this, 0, true ); cell_count_property_ = new IntProperty( "Plane Cell Count", 10, "The number of cells to draw in the plane of the grid.", this, SLOT( updateCellCount() )); cell_count_property_->setMin( 1 ); height_property_ = new IntProperty( "Normal Cell Count", 0, "The number of cells to draw along the normal vector of the grid. " " Setting to anything but 0 makes the grid 3D.", this, SLOT( updateHeight() )); height_property_->setMin( 0 ); cell_size_property_ = new FloatProperty( "Cell Size", 1.0f, "The length, in meters, of the side of each cell.", this, SLOT( updateCellSize() )); cell_size_property_->setMin( 0.0001 ); style_property_ = new EnumProperty( "Line Style", "Lines", "The rendering operation to use to draw the grid lines.", this, SLOT( updateStyle() )); style_property_->addOption( "Lines", Grid::Lines ); style_property_->addOption( "Billboards", Grid::Billboards ); line_width_property_ = new FloatProperty( "Line Width", 0.03, "The width, in meters, of each grid line.", style_property_, SLOT( updateLineWidth() ), this ); line_width_property_->setMin( 0.001 ); line_width_property_->hide(); color_property_ = new ColorProperty( "Color", Qt::gray, "The color of the grid lines.", this, SLOT( updateColor() )); alpha_property_ = new FloatProperty( "Alpha", 0.5f, "The amount of transparency to apply to the grid lines.", this, SLOT( updateColor() )); alpha_property_->setMin( 0.0f ); alpha_property_->setMax( 1.0f ); plane_property_ = new EnumProperty( "Plane", "XY", "The plane to draw the grid along.", this, SLOT( updatePlane() )); plane_property_->addOption( "XY", XY ); plane_property_->addOption( "XZ", XZ ); plane_property_->addOption( "YZ", YZ ); offset_property_ = new VectorProperty( "Offset", Ogre::Vector3::ZERO, "Allows you to offset the grid from the origin of the reference frame. In meters.", this, SLOT( updateOffset() )); }
void BoundingBoxDisplay::onInitialize() { MFDClass::onInitialize(); scene_node_ = scene_manager_->getRootSceneNode()->createChildSceneNode(); updateColor(); updateAlpha(); updateOnlyEdge(); updateColoring(); updateLineWidth(); updateShowCoords(); }
void updateCTM(GfxState *state, double m11, double m12, double m21, double m22, double m31, double m32) { double *ctm = getDefCTM(); updateLineDash(state); updateLineJoin(state); updateLineCap(state); updateLineWidth(state); }
//! Change back to the old state void restoreState(GfxState *state) { g_print ("restoreState\n"); // should contain all of our update*() methods? updateLineWidth(state); updateLineDash(state); updateLineJoin(state); updateLineCap(state); updateStrokeColor(state); updateStrokeOpacity(state); updateFillColor(state); updateFillOpacity(state); updateFont(state); }
void OverlayTextDisplay::updateOvertakeColorProperties() { if (!overtake_color_properties_ && overtake_color_properties_property_->getBool()) { // read all the parameters from properties updateFGColor(); updateFGAlpha(); updateBGColor(); updateBGAlpha(); updateFont(); updateLineWidth(); require_update_texture_ = true; } overtake_color_properties_ = overtake_color_properties_property_->getBool(); }
//! Change back to the old state void restoreState(GfxState *state) { // just restore the matrix for now this->matrices.pop_back(); this->matrix = this->matrices.back(); // should contain all of our update*() methods? updateLineWidth(state); updateLineDash(state); updateLineJoin(state); updateLineCap(state); updateStrokeColor(state); updateStrokeOpacity(state); updateFillColor(state); updateFillOpacity(state); updateFont(state); }
// only the first time void OverlayTextDisplay::onInitialize() { onEnable(); updateTopic(); updateOvertakePositionProperties(); updateOvertakeColorProperties(); updateTop(); updateLeft(); updateWidth(); updateHeight(); updateTextSize(); updateFGColor(); updateFGAlpha(); updateBGColor(); updateBGAlpha(); updateFont(); updateLineWidth(); require_update_texture_ = true; }
void DiagnosticsDisplay::onInitialize() { static int counter = 0; scene_node_ = scene_manager_->getRootSceneNode()->createChildSceneNode(); orbit_node_ = scene_node_->createChildSceneNode(); // ?? line_ = new rviz::BillboardLine(context_->getSceneManager(), scene_node_); msg_ = new rviz::MovableText("not initialized", "Liberation Sans", 0.05); msg_->setTextAlignment(rviz::MovableText::H_CENTER, rviz::MovableText::V_ABOVE); frame_id_property_->setFrameManager(context_->getFrameManager()); orbit_node_->attachObject(msg_); msg_->setVisible(false); orbit_theta_ = M_PI * 2.0 / 6 * counter++; updateLineWidth(); updateAxis(); updateDiagnosticsNamespace(); updateRadius(); updateRosTopic(); updateFontSize(); }
void updateCTM(GfxState *state, double m11, double m12, double m21, double m22, double m31, double m32) { DiaMatrix mat; mat.xx = m11; mat.yx = m12; mat.xy = m21; mat.yy = m22; mat.x0 = m31 * scale; mat.y0 = m32 * scale; //this->matrix = mat; dia_matrix_multiply (&this->matrix, &mat, &this->matrix); updateLineDash(state); updateLineJoin(state); updateLineCap(state); updateLineWidth(state); }
DiagnosticsDisplay::DiagnosticsDisplay() : rviz::Display(), msg_(0) { ros_topic_property_ = new rviz::RosTopicProperty( "Topic", "/diagnostics_agg", ros::message_traits::datatype<diagnostic_msgs::DiagnosticArray>(), "diagnostic_msgs::DiagnosticArray topic to subscribe to.", this, SLOT( updateRosTopic() )); frame_id_property_ = new rviz::TfFrameProperty( "frame_id", rviz::TfFrameProperty::FIXED_FRAME_STRING, "the parent frame_id to visualize diagnostics", this, 0, true); diagnostics_namespace_property_ = new rviz::EditableEnumProperty( "diagnostics namespace", "/", "diagnostics namespace to visualize diagnostics", this, SLOT(updateDiagnosticsNamespace())); radius_property_ = new rviz::FloatProperty( "radius", 1.0, "radius of diagnostics circle", this, SLOT(updateRadius())); line_width_property_ = new rviz::FloatProperty( "line width", 0.03, "line width", this, SLOT(updateLineWidth())); axis_property_ = new rviz::EnumProperty( "axis", "x", "axis", this, SLOT(updateAxis())); axis_property_->addOption("x", 0); axis_property_->addOption("y", 1); axis_property_->addOption("z", 2); font_size_property_ = new rviz::FloatProperty( "font size", 0.05, "font size", this, SLOT(updateFontSize())); }
OverlayTextDisplay::OverlayTextDisplay() : Display(), texture_width_(0), texture_height_(0), text_size_(14), line_width_(2), text_(""), font_(""), bg_color_(0, 0, 0, 0), fg_color_(255, 255, 255, 255.0), require_update_texture_(false) { update_topic_property_ = new rviz::RosTopicProperty( "Topic", "", ros::message_traits::datatype<jsk_rviz_plugins::OverlayText>(), "jsk_rviz_plugins::OverlayText topic to subscribe to.", this, SLOT( updateTopic() )); overtake_position_properties_property_ = new rviz::BoolProperty( "Overtake Position Properties", false, "overtake position properties specified by message such as left, top and font", this, SLOT(updateOvertakePositionProperties())); overtake_color_properties_property_ = new rviz::BoolProperty( "Overtake Color Properties", false, "overtake color properties specified by message such as left, top and font", this, SLOT(updateOvertakeColorProperties())); top_property_ = new rviz::IntProperty( "top", 0, "top position", this, SLOT(updateTop())); top_property_->setMin(0); left_property_ = new rviz::IntProperty( "left", 0, "left position", this, SLOT(updateLeft())); left_property_->setMin(0); width_property_ = new rviz::IntProperty( "width", 128, "width position", this, SLOT(updateWidth())); width_property_->setMin(0); height_property_ = new rviz::IntProperty( "height", 128, "height position", this, SLOT(updateHeight())); height_property_->setMin(0); text_size_property_ = new rviz::IntProperty( "text size", 12, "text size", this, SLOT(updateTextSize())); text_size_property_->setMin(0); line_width_property_ = new rviz::IntProperty( "line width", 2, "line width", this, SLOT(updateLineWidth())); line_width_property_->setMin(0); fg_color_property_ = new rviz::ColorProperty( "Foreground Color", QColor(25, 255, 240), "Foreground Color", this, SLOT(updateFGColor())); fg_alpha_property_ = new rviz::FloatProperty( "Foreground Alpha", 0.8, "Foreground Alpha", this, SLOT(updateFGAlpha())); fg_alpha_property_->setMin(0.0); fg_alpha_property_->setMax(1.0); bg_color_property_ = new rviz::ColorProperty( "Background Color", QColor(0, 0, 0), "Background Color", this, SLOT(updateBGColor())); bg_alpha_property_ = new rviz::FloatProperty( "Background Alpha", 0.8, "Background Alpha", this, SLOT(updateBGAlpha())); bg_alpha_property_->setMin(0.0); bg_alpha_property_->setMax(1.0); QFontDatabase database; font_families_ = database.families(); font_property_ = new rviz::EnumProperty( "font", "DejaVu Sans Mono", "font", this, SLOT(updateFont())); for (size_t i = 0; i < font_families_.size(); i++) { font_property_->addOption(font_families_[i], (int)i); } }
Plotter2DDisplay::Plotter2DDisplay() : rviz::Display(), min_value_(0.0), max_value_(0.0) { update_topic_property_ = new rviz::RosTopicProperty( "Topic", "", ros::message_traits::datatype<std_msgs::Float32>(), "std_msgs::Float32 topic to subscribe to.", this, SLOT(updateTopic())); show_value_property_ = new rviz::BoolProperty( "Show Value", true, "Show value on plotter", this, SLOT(updateShowValue())); buffer_length_property_ = new rviz::IntProperty( "Buffer length", 100, ros::message_traits::datatype<std_msgs::Float32>(), this, SLOT(updateBufferSize())); width_property_ = new rviz::IntProperty("width", 128, "width of the plotter window", this, SLOT(updateWidth())); width_property_->setMin(1); width_property_->setMax(2000); height_property_ = new rviz::IntProperty("height", 128, "height of the plotter window", this, SLOT(updateHeight())); height_property_->setMin(1); height_property_->setMax(2000); left_property_ = new rviz::IntProperty("left", 128, "left of the plotter window", this, SLOT(updateLeft())); left_property_->setMin(0); top_property_ = new rviz::IntProperty("top", 128, "top of the plotter window", this, SLOT(updateTop())); top_property_->setMin(0); auto_scale_property_ = new rviz::BoolProperty( "auto scale", true, "enable auto scale", this, SLOT(updateAutoScale())); max_value_property_ = new rviz::FloatProperty( "max value", 1.0, "max value, used only if auto scale is disabled", this, SLOT(updateMaxValue())); min_value_property_ = new rviz::FloatProperty( "min value", -1.0, "min value, used only if auto scale is disabled", this, SLOT(updateMinValue())); fg_color_property_ = new rviz::ColorProperty( "foreground color", QColor(25, 255, 240), "color to draw line", this, SLOT(updateFGColor())); fg_alpha_property_ = new rviz::FloatProperty( "foreground alpha", 0.7, "alpha belnding value for foreground", this, SLOT(updateFGAlpha())); fg_alpha_property_->setMin(0); fg_alpha_property_->setMax(1.0); bg_color_property_ = new rviz::ColorProperty( "background color", QColor(0, 0, 0), "background color", this, SLOT(updateBGColor())); bg_alpha_property_ = new rviz::FloatProperty( "backround alpha", 0.0, "alpha belnding value for background", this, SLOT(updateBGAlpha())); bg_alpha_property_->setMin(0); bg_alpha_property_->setMax(1.0); line_width_property_ = new rviz::IntProperty("linewidth", 1, "linewidth of the plot", this, SLOT(updateLineWidth())); line_width_property_->setMin(1); line_width_property_->setMax(1000); show_border_property_ = new rviz::BoolProperty( "border", true, "show border or not", this, SLOT(updateShowBorder())); text_size_property_ = new rviz::IntProperty("text size", 12, "text size of the caption", this, SLOT(updateTextSize())); text_size_property_->setMin(1); text_size_property_->setMax(1000); show_caption_property_ = new rviz::BoolProperty( "caption", true, "show caption or not", this, SLOT(updateShowCaption())); update_interval_property_ = new rviz::FloatProperty( "update interval", 0.04, "update interval of the plotter", this, SLOT(updateUpdateInterval())); update_interval_property_->setMin(0.0); update_interval_property_->setMax(100); auto_color_change_property_ = new rviz::BoolProperty("auto color change", false, "change the color automatically", this, SLOT(updateAutoColorChange())); max_color_property_ = new rviz::ColorProperty( "max color", QColor(255, 0, 0), "only used if auto color change is set to True.", this, SLOT(updateMaxColor())); }