Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add receiver parameter to constructor of CovarianceProperty #913

Open
wants to merge 1 commit into
base: rolling
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ class RVIZ_COMMON_PUBLIC CovarianceProperty : public rviz_common::properties::Bo
bool default_value = false,
const QString & description = QString(),
Property * parent = nullptr,
const char * changed_slot = nullptr);
const char * changed_slot = nullptr,
QObject * receiver = nullptr);

~CovarianceProperty() override = default;

Expand Down
27 changes: 14 additions & 13 deletions rviz_common/src/rviz_common/properties/covariance_property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,52 +51,53 @@ CovarianceProperty::CovarianceProperty(
bool default_value,
const QString & description,
Property * parent,
const char * changed_slot)
: BoolProperty(name, default_value, description, parent, changed_slot)
const char * changed_slot,
QObject * receiver)
: BoolProperty(name, default_value, description, parent, changed_slot, receiver)
{
position_property_ = new BoolProperty(
"Position", true,
"Whether or not to show the position part of covariances",
this, changed_slot, parent);
this, changed_slot, receiver);
position_property_->setDisableChildrenIfFalse(true);

position_color_property_ = new ColorProperty(
"Color", QColor(204, 51, 204),
"Color to draw the position covariance ellipse.",
position_property_, changed_slot, parent);
position_property_, changed_slot, receiver);

position_alpha_property_ = new FloatProperty(
"Alpha", 0.3f,
"0 is fully transparent, 1.0 is fully opaque.",
position_property_, changed_slot, parent);
position_property_, changed_slot, receiver);
position_alpha_property_->setMin(0);
position_alpha_property_->setMax(1);

position_scale_property_ = new FloatProperty(
"Scale", 1.0f,
"Scale factor to be applied to covariance ellipse. "
"Corresponds to the number of standard deviations to display",
position_property_, changed_slot, parent);
position_property_, changed_slot, receiver);
position_scale_property_->setMin(0);

orientation_property_ = new BoolProperty(
"Orientation", true,
"Whether or not to show the orientation part of covariances",
this, changed_slot, parent);
this, changed_slot, receiver);
orientation_property_->setDisableChildrenIfFalse(true);

orientation_frame_property_ = new EnumProperty(
"Frame", "Local",
"Frame used to display the orientation covariance.",
orientation_property_, changed_slot, parent);
orientation_property_, changed_slot, receiver);
orientation_frame_property_->addOption("Local", rviz_rendering::Local);
orientation_frame_property_->addOption("Fixed", rviz_rendering::Fixed);

orientation_colorstyle_property_ = new EnumProperty(
"Color Style", "Unique",
"Style to color the orientation covariance: "
"XYZ with same unique color or following RGB order",
orientation_property_, changed_slot, parent);
orientation_property_, changed_slot, receiver);
orientation_colorstyle_property_->addOption("Unique", rviz_rendering::Unique);
orientation_colorstyle_property_->addOption("RGB", rviz_rendering::RGB);
connect(
Expand All @@ -106,12 +107,12 @@ CovarianceProperty::CovarianceProperty(
orientation_color_property_ = new ColorProperty(
"Color", QColor(255, 255, 127),
"Color to draw the covariance ellipse.",
orientation_property_, changed_slot, parent);
orientation_property_, changed_slot, receiver);

orientation_alpha_property_ = new FloatProperty(
"Alpha", 0.5f,
"0 is fully transparent, 1.0 is fully opaque.",
orientation_property_, changed_slot, parent);
orientation_property_, changed_slot, receiver);
orientation_alpha_property_->setMin(0);
orientation_alpha_property_->setMax(1);

Expand All @@ -120,14 +121,14 @@ CovarianceProperty::CovarianceProperty(
"For 3D poses: the distance where to position the ellipses representing "
"orientation covariance. "
"For 2D poses: the height of the triangle representing the variance on yaw",
orientation_property_, changed_slot, parent);
orientation_property_, changed_slot, receiver);
orientation_offset_property_->setMin(0);

orientation_scale_property_ = new FloatProperty(
"Scale", 1.0f,
"Scale factor to be applied to orientation covariance shapes. "
"Corresponds to the number of standard deviations to display",
orientation_property_, changed_slot, parent);
orientation_property_, changed_slot, receiver);
orientation_scale_property_->setMin(0);

setDisableChildrenIfFalse(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void OdometryDisplay::setupProperties()
covariance_property_ = new rviz_common::properties::CovarianceProperty(
"Covariance", true,
"Whether or not the covariances of the messages should be shown.",
this, SLOT(updateCovariances()));
this, SLOT(updateCovariances()), this);
}

OdometryDisplay::~OdometryDisplay() = default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ PoseWithCovarianceDisplay::PoseWithCovarianceDisplay()

covariance_property_ = new rviz_common::properties::CovarianceProperty(
"Covariance", true, "Whether or not the covariances of the messages should be shown.",
this, SLOT(updateCovariance()));
this, SLOT(updateCovariance()), this);
}

void PoseWithCovarianceDisplay::onInitialize()
Expand Down