screw_visual.h
Go to the documentation of this file.
1 #ifndef SCREW_VISUAL_H
2 #define SCREW_VISUAL_H
3 
4 #include <geometry_msgs/Vector3.h>
5 #include <OgrePrerequisites.h>
6 
7 namespace rviz
8 {
9 class Arrow;
10 class BillboardLine;
11 } // namespace rviz
12 
13 namespace rviz
14 {
15 // ScrewVisual visualizes a single screw, i.e. a wrench, twist, or acceleration
17 {
18 public:
19  // Constructor. Creates the visual stuff and puts it into the scene, but in an unconfigured state.
20  ScrewVisual(Ogre::SceneManager* scene_manager, Ogre::SceneNode* parent_node);
21 
22  // Destructor. Removes the visual stuff from the scene.
23  virtual ~ScrewVisual();
24 
25  // Configure the visual to show the given linear and angular vectors
26  void setScrew(const Ogre::Vector3& linear, const Ogre::Vector3& angular);
27  // Configure the visual to show the data in the message.
28  void setScrew(const geometry_msgs::Vector3& linear, const geometry_msgs::Vector3& angular);
29 
30  // Set the pose of the coordinate frame the message refers to.
31  // This could be done inside setMessage(), but that would require calls to FrameManager
32  // and error handling inside setMessage(), which doesn't seem as clean.
33  // This way ScrewVisual is only responsible for visualization.
34  void setFramePosition(const Ogre::Vector3& position);
35  void setFrameOrientation(const Ogre::Quaternion& orientation);
36 
37  // Set the color and alpha of the visual, which are user-editable
38  // parameters and therefore don't come from the message.
39  void setLinearColor(float r, float g, float b, float a);
40  void setAngularColor(float r, float g, float b, float a);
41  void setLinearScale(float s);
42  void setAngularScale(float s);
43  void setWidth(float w);
44  void setHideSmallValues(bool h);
45  void setVisible(bool visible);
46 
47 private:
48  // The object implementing the circle
55 
56  // A SceneNode whose pose is set to match the coordinate frame of the message header.
57  Ogre::SceneNode* frame_node_;
58  // allow showing/hiding of linear / angular arrows
59  Ogre::SceneNode* linear_node_;
60  Ogre::SceneNode* angular_node_;
61 
62  // The SceneManager, kept here only so the destructor can ask it to destroy the ``frame_node_``.
63  Ogre::SceneManager* scene_manager_;
64 };
65 
66 } // end namespace rviz
67 
68 #endif // SCREW_VISUAL_H
rviz::ScrewVisual::setAngularColor
void setAngularColor(float r, float g, float b, float a)
Definition: screw_visual.cpp:111
rviz::BillboardLine
An object that displays a multi-segment line strip rendered as billboards.
Definition: billboard_line.h:58
rviz::ScrewVisual::ScrewVisual
ScrewVisual(Ogre::SceneManager *scene_manager, Ogre::SceneNode *parent_node)
Definition: screw_visual.cpp:14
rviz::Arrow
An arrow consisting of a cylinder and a cone.
Definition: arrow.h:57
linear
constexpr const char * linear()
Definition: screw_display.cpp:18
rviz::ScrewVisual::arrow_linear_
rviz::Arrow * arrow_linear_
Definition: screw_visual.h:49
s
XmlRpcServer s
rviz::ScrewVisual::frame_node_
Ogre::SceneNode * frame_node_
Definition: screw_visual.h:57
rviz::ScrewVisual::setFrameOrientation
void setFrameOrientation(const Ogre::Quaternion &orientation)
Definition: screw_visual.cpp:100
rviz::ScrewVisual::setScrew
void setScrew(const Ogre::Vector3 &linear, const Ogre::Vector3 &angular)
Definition: screw_visual.cpp:52
rviz::ScrewVisual::angular_scale_
float angular_scale_
Definition: screw_visual.h:53
rviz::ScrewVisual::angular_node_
Ogre::SceneNode * angular_node_
Definition: screw_visual.h:60
rviz::ScrewVisual::linear_node_
Ogre::SceneNode * linear_node_
Definition: screw_visual.h:59
rviz::ScrewVisual::scene_manager_
Ogre::SceneManager * scene_manager_
Definition: screw_visual.h:63
rviz::ScrewVisual::setWidth
void setWidth(float w)
Definition: screw_visual.cpp:128
rviz::ScrewVisual::~ScrewVisual
virtual ~ScrewVisual()
Definition: screw_visual.cpp:34
rviz
Definition: add_display_dialog.cpp:54
rviz::ScrewVisual::setLinearScale
void setLinearScale(float s)
Definition: screw_visual.cpp:118
rviz::ScrewVisual::circle_arrow_angular_
rviz::Arrow * circle_arrow_angular_
Definition: screw_visual.h:52
angular
constexpr const char * angular()
Definition: screw_display.cpp:23
rviz::ScrewVisual::linear_scale_
float linear_scale_
Definition: screw_visual.h:53
rviz::ScrewVisual::hide_small_values_
bool hide_small_values_
Definition: screw_visual.h:54
rviz::ScrewVisual::setHideSmallValues
void setHideSmallValues(bool h)
Definition: screw_visual.cpp:133
rviz::ScrewVisual::circle_angular_
rviz::BillboardLine * circle_angular_
Definition: screw_visual.h:51
rviz::ScrewVisual::width_
float width_
Definition: screw_visual.h:53
rviz::ScrewVisual::setVisible
void setVisible(bool visible)
Definition: screw_visual.cpp:139
rviz::ScrewVisual::setAngularScale
void setAngularScale(float s)
Definition: screw_visual.cpp:123
rviz::ScrewVisual::setLinearColor
void setLinearColor(float r, float g, float b, float a)
Definition: screw_visual.cpp:106
rviz::ScrewVisual
Definition: screw_visual.h:16
rviz::ScrewVisual::setFramePosition
void setFramePosition(const Ogre::Vector3 &position)
Definition: screw_visual.cpp:95
rviz::ScrewVisual::arrow_angular_
rviz::Arrow * arrow_angular_
Definition: screw_visual.h:50


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Aug 2 2024 08:43:10