ambient_sound_visual.h
Go to the documentation of this file.
1 #ifndef __AMBIENT_SOUND_VISUAL__
2 #define __AMBIENT_SOUND_VISUAL__
3 
4 #include <jsk_hark_msgs/HarkPower.h>
5 #include <OGRE/OgreVector3.h>
6 #include <OGRE/OgreQuaternion.h>
7 
8 namespace Ogre
9 {
10 class SceneManager;
11 class SceneNode;
12 //class Vector3;
13 //class Quaternion;
14 }
15 
16 namespace rviz
17 {
18 class BillboardLine;
19 //class Axes;
20 }
21 
22 namespace jsk_rviz_plugins
23 {
24 
25 // BEGIN_TUTORIAL
26 // Declare the visual class for this display.
27 //
28 // Each instance of AmbientSoundVisual represents the visualization of a single
29 // sensor_msgs::Imu message. Currently it just shows an arrow with
30 // the direction and magnitude of the acceleration vector, but could
31 // easily be expanded to include more of the message data.
33 {
34 public:
35  // Constructor. Creates the visual stuff and puts it into the
36  // scene, but in an unconfigured state.
37  AmbientSoundVisual( Ogre::SceneManager* scene_manager, Ogre::SceneNode* parent_node );
38 
39  // Destructor. Removes the visual stuff from the scene.
40  virtual ~AmbientSoundVisual();
41 
42  // Configure the visual to show the data in the message.
43  void setMessage( const jsk_hark_msgs::HarkPower::ConstPtr& msg );
44 
45  // Set the pose of the coordinate frame the message refers to.
46  // These could be done inside setMessage(), but that would require
47  // calls to FrameManager and error handling inside setMessage(),
48  // which doesn't seem as clean. This way AmbientSoundVisual is only
49  // responsible for visualization.
50  void setFramePosition( const Ogre::Vector3& position );
51  void setFrameOrientation( const Ogre::Quaternion& orientation );
52 
53  // Set the color and alpha of the visual, which are user-editable
54  // parameters and therefore don't come from the Imu message.
55  void setColor( float r, float g, float b, float a );
56 
57  void setWidth( float w );
58  void setScale( float s );
59  void setBias( float b );
60  void setGrad( float g );
61 
62 private:
63  // The object implementing the actual arrow shape
65  //rviz::Axes* axes_;
66 
67  // A SceneNode whose pose is set to match the coordinate frame of
68  // the Imu message header.
69  Ogre::SceneNode* frame_node_;
70 
71  // The SceneManager, kept here only so the destructor can ask it to
72  // destroy the ``frame_node_``.
73  Ogre::SceneManager* scene_manager_;
74 
75  Ogre::Vector3 position_;
76  Ogre::Quaternion orientation_;
77 
78  //std::map<std::string, Ogre::Vector3> position_;
79  //std::map<std::string, Ogre::Quaternion> orientation_;
80  float width_,scale_,bias_,grad_;
81 };
82 // END_TUTORIAL
83 
84 } // end namespace jsk_rviz_plugins
85 
86 #endif // __AMBIENT_SOUND_VISUAL__
msg
rviz::BillboardLine * ambient_sound_power_line_


jsk_rviz_plugins
Author(s): Kei Okada , Yohei Kakiuchi , Shohei Fujii , Ryohei Ueda
autogenerated on Sat Mar 20 2021 03:03:18