Go to the documentation of this file.
30 #include <OgreSceneNode.h>
31 #include <OgreSceneManager.h>
74 sensor_msgs::PointCloud2Ptr filtered(
new sensor_msgs::PointCloud2);
77 sensor_msgs::PointField x;
80 x.datatype = sensor_msgs::PointField::FLOAT32;
82 sensor_msgs::PointField y;
85 y.datatype = sensor_msgs::PointField::FLOAT32;
87 sensor_msgs::PointField z;
90 z.datatype = sensor_msgs::PointField::FLOAT32;
92 sensor_msgs::PointField relative_humidity;
93 relative_humidity.name =
"relative_humidity";
94 relative_humidity.offset = 12;
95 relative_humidity.datatype = sensor_msgs::PointField::FLOAT64;
96 relative_humidity.count = 1;
99 filtered->header = msg->header;
100 filtered->fields.push_back(x);
101 filtered->fields.push_back(y);
102 filtered->fields.push_back(z);
103 filtered->fields.push_back(relative_humidity);
104 filtered->data.resize(20);
105 const float zero_float = 0.0;
106 memcpy(&filtered->data[x.offset], &zero_float, 4);
107 memcpy(&filtered->data[y.offset], &zero_float, 4);
108 memcpy(&filtered->data[z.offset], &zero_float, 4);
109 memcpy(&filtered->data[relative_humidity.offset], &msg->relative_humidity, 8);
110 filtered->height = 1;
112 filtered->is_bigendian =
false;
113 filtered->point_step = 20;
114 filtered->row_step = 1;
virtual void unsubscribe()
void initialize(DisplayContext *context, Ogre::SceneNode *scene_node)
void update(float wall_dt, float ros_dt)
virtual ros::CallbackQueueInterface * getThreadedQueue()=0
Return a CallbackQueue using a different thread than the main GUI one.
virtual Property * subProp(const QString &sub_name)
Return the first child Property with the given name, or the FailureProperty if no child has the name.
void addMessage(const sensor_msgs::PointCloudConstPtr &cloud)
void hide()
Hide this Property in any PropertyTreeWidgets.
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
virtual bool setValue(const QVariant &new_value)
Set the new value for this property. Returns true if the new value is different from the old value,...
Ogre::SceneNode * scene_node_
The Ogre::SceneNode to hold all 3D scene elements shown by this Display.
Displays a point cloud of type sensor_msgs::PointCloud.
void setCallbackQueue(CallbackQueueInterface *queue)
RelativeHumidityDisplay()
Displays a RelativeHumidity message of type sensor_msgs::RelativeHumidity.
void onInitialize() override
void reset() override
Called to tell the display to clear its state.
DisplayContext * context_
This DisplayContext pointer is the main connection a Display has into the rest of rviz....
void processMessage(const sensor_msgs::RelativeHumidityConstPtr &msg) override
Process a single message. Overridden from MessageFilterDisplay.
void onInitialize() override
Do initialization. Overridden from MessageFilterDisplay.
PointCloudCommon * point_cloud_common_
~RelativeHumidityDisplay() override
ros::NodeHandle update_nh_
A NodeHandle whose CallbackQueue is run from the main GUI thread (the "update" thread).
void update(float wall_dt, float ros_dt) override
Called periodically by the visualization manager.
rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Dec 13 2024 03:31:02