Go to the documentation of this file.
30 #include <OgreSceneNode.h>
31 #include <OgreSceneManager.h>
77 sensor_msgs::PointCloud2Ptr filtered(
new sensor_msgs::PointCloud2);
80 sensor_msgs::PointField x;
83 x.datatype = sensor_msgs::PointField::FLOAT32;
85 sensor_msgs::PointField y;
88 y.datatype = sensor_msgs::PointField::FLOAT32;
90 sensor_msgs::PointField z;
93 z.datatype = sensor_msgs::PointField::FLOAT32;
95 sensor_msgs::PointField fluid_pressure;
96 fluid_pressure.name =
"fluid_pressure";
97 fluid_pressure.offset = 12;
98 fluid_pressure.datatype = sensor_msgs::PointField::FLOAT64;
99 fluid_pressure.count = 1;
102 filtered->header = msg->header;
103 filtered->fields.push_back(x);
104 filtered->fields.push_back(y);
105 filtered->fields.push_back(z);
106 filtered->fields.push_back(fluid_pressure);
107 filtered->data.resize(20);
108 const float zero_float = 0.0;
109 memcpy(&filtered->data[x.offset], &zero_float, 4);
110 memcpy(&filtered->data[y.offset], &zero_float, 4);
111 memcpy(&filtered->data[z.offset], &zero_float, 4);
112 memcpy(&filtered->data[fluid_pressure.offset], &msg->fluid_pressure, 8);
113 filtered->height = 1;
115 filtered->is_bigendian =
false;
116 filtered->point_step = 20;
117 filtered->row_step = 1;
Displays an FluidPressure message of type sensor_msgs::FluidPressure.
void update(float wall_dt, float ros_dt) override
Called periodically by the visualization manager.
virtual void unsubscribe()
void initialize(DisplayContext *context, Ogre::SceneNode *scene_node)
void update(float wall_dt, float ros_dt)
void onInitialize() override
Do initialization. Overridden from MessageFilterDisplay.
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 processMessage(const sensor_msgs::FluidPressureConstPtr &msg) override
Process a single message. Overridden from MessageFilterDisplay.
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.
~FluidPressureDisplay() override
Displays a point cloud of type sensor_msgs::PointCloud.
void setCallbackQueue(CallbackQueueInterface *queue)
void reset() override
Called to tell the display to clear its state.
void onInitialize() override
DisplayContext * context_
This DisplayContext pointer is the main connection a Display has into the rest of rviz....
PointCloudCommon * point_cloud_common_
ros::NodeHandle update_nh_
A NodeHandle whose CallbackQueue is run from the main GUI thread (the "update" thread).
rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Aug 2 2024 08:43:09