point_visual.h
Go to the documentation of this file.
1 #ifndef POINT_VISUAL_H
2 #define POINT_VISUAL_H
3 
4 #include <geometry_msgs/PointStamped.h>
5 
6 namespace Ogre
7 {
8 class Vector3;
9 class Quaternion;
10 } // namespace Ogre
11 
12 namespace rviz
13 {
14 class Shape;
15 }
16 
17 namespace rviz
18 {
19 // Each instance of PointStampedVisual represents the visualization of a single
20 // sensor_msgs::Point message. Currently it just shows an arrow with
21 // the direction and magnitude of the acceleration vector, but could
22 // easily be expanded to include more of the message data.
24 {
25 public:
26  // Constructor. Creates the visual stuff and puts it into the
27  // scene, but in an unconfigured state.
28  PointStampedVisual(Ogre::SceneManager* scene_manager, Ogre::SceneNode* parent_node);
29 
30  // Destructor. Removes the visual stuff from the scene.
31  virtual ~PointStampedVisual();
32 
33  // set rainbow color
34  void getRainbowColor(float value, Ogre::ColourValue& color);
35  // Configure the visual to show the data in the message.
36  void setMessage(const geometry_msgs::PointStamped::ConstPtr& msg);
37 
38  // Set the pose of the coordinate frame the message refers to.
39  // These could be done inside setMessage(), but that would require
40  // calls to FrameManager and error handling inside setMessage(),
41  // which doesn't seem as clean. This way PointStampedVisual is only
42  // responsible for visualization.
43  void setFramePosition(const Ogre::Vector3& position);
44  void setFrameOrientation(const Ogre::Quaternion& orientation);
45 
46  // Set the color and alpha of the visual, which are user-editable
47  // parameters and therefore don't come from the Point message.
48  void setColor(float r, float g, float b, float a);
49 
50  void setRadius(float r);
51 
52 private:
53  // The object implementing the point circle
55 
56  // A SceneNode whose pose is set to match the coordinate frame of
57  // the Point message header.
58  Ogre::SceneNode* frame_node_;
59 
60  // The SceneManager, kept here only so the destructor can ask it to
61  // destroy the ``frame_node_``.
62  Ogre::SceneManager* scene_manager_;
63 
64  float radius_;
65 };
66 
67 } // end namespace rviz
68 
69 #endif // POINT_VISUAL_H
Ogre::SceneNode * frame_node_
Definition: point_visual.h:58
Ogre::SceneManager * scene_manager_
Definition: point_visual.h:62
r
static void getRainbowColor(float value, Ogre::ColourValue &color)


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Sat May 27 2023 02:06:25