1 #include <OgreSceneNode.h> 2 #include <OgreSceneManager.h> 12 #include <boost/foreach.hpp> 23 new rviz::ColorProperty(
"Force Color", QColor(204, 51, 51),
"Color to draw the force arrows.",
27 new rviz::ColorProperty(
"Torque Color", QColor(204, 204, 51),
"Color to draw the torque arrows.",
44 new rviz::IntProperty(
"History Length", 1,
"Number of prior measurements to display.",
this,
81 for (
size_t i = 0; i <
visuals_.size(); i++)
83 visuals_[i]->setForceColor(force_color.r, force_color.g, force_color.b, alpha);
84 visuals_[i]->setTorqueColor(torque_color.r, torque_color.g, torque_color.b, alpha);
85 visuals_[i]->setForceScale(force_scale);
86 visuals_[i]->setTorqueScale(torque_scale);
88 visuals_[i]->setHideSmallValues(hide_small_values);
110 "Message contained invalid floating point values (nans or infs)");
117 Ogre::Quaternion orientation;
118 Ogre::Vector3 position;
122 ROS_DEBUG(
"Error transforming from frame '%s' to frame '%s'", msg->header.frame_id.c_str(),
127 if (position.isNaN())
130 1.0,
"Wrench position contains NaNs. Skipping render as long as the position is invalid");
147 visual->setWrench(msg->wrench);
148 visual->setFramePosition(position);
149 visual->setFrameOrientation(orientation);
156 visual->setForceColor(force_color.r, force_color.g, force_color.b, alpha);
157 visual->setTorqueColor(torque_color.r, torque_color.g, torque_color.b, alpha);
158 visual->setForceScale(force_scale);
159 visual->setTorqueScale(torque_scale);
160 visual->setWidth(width);
rviz::FloatProperty * force_scale_property_
boost::circular_buffer< boost::shared_ptr< WrenchVisual > > visuals_
rviz::ColorProperty * force_color_property_
void onInitialize() override
Override this function to do subclass-specific initialization.
DisplayContext * context_
This DisplayContext pointer is the main connection a Display has into the rest of rviz...
rviz::FloatProperty * alpha_property_
rviz::IntProperty * history_length_property_
void reset() override
Called to tell the display to clear its state.
Ogre::ColourValue getOgreColor() const
rviz::FloatProperty * torque_scale_property_
Property specialized to enforce floating point max/min.
Property specialized to provide max/min enforcement for integers.
Ogre::SceneNode * scene_node_
The Ogre::SceneNode to hold all 3D scene elements shown by this Display.
QString fixed_frame_
A convenience variable equal to context_->getFixedFrame().
bool validateFloats(const sensor_msgs::CameraInfo &msg)
#define ROS_ERROR_THROTTLE(period,...)
virtual FrameManager * getFrameManager() const =0
Return the FrameManager instance.
rviz::FloatProperty * width_property_
virtual int getInt() const
Return the internal property value as an integer.
virtual Ogre::SceneManager * getSceneManager() const =0
Returns the Ogre::SceneManager used for the main RenderPanel.
Property specialized to provide getter for booleans.
virtual float getFloat() const
bool getTransform(const Header &header, Ogre::Vector3 &position, Ogre::Quaternion &orientation)
Return the pose for a header, relative to the fixed frame, in Ogre classes.
rviz::BoolProperty * hide_small_values_property_
rviz::ColorProperty * torque_color_property_
void onInitialize() override
void processMessage(const geometry_msgs::WrenchStamped::ConstPtr &msg) override
virtual bool getBool() const
void updateHistoryLength()
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
~WrenchStampedDisplay() override
virtual void setStatus(StatusProperty::Level level, const QString &name, const QString &text)
Show status level and text. This is thread-safe.