1 #include <OGRE/OgreVector3.h> 2 #include <OGRE/OgreSceneNode.h> 3 #include <OGRE/OgreSceneManager.h> 49 int directions = msg->directions;
50 std::vector<float> powers = msg->powers;
63 if ( powers[0] == 0.0 ){
return;}
69 for (
int i = 0; i <= directions ; i++) {
70 float biased_power = (powers[(i%directions)] -
bias_) *
grad_;
71 if (biased_power <= 0.0) { biased_power = 0.001; }
72 Ogre::Vector3 point = Ogre::Vector3((biased_power*
scale_)*
cos(i*(2*M_PI/directions)- M_PI), (biased_power*scale_)*
sin(i*(2*M_PI/directions) - M_PI), 0);
Ogre::SceneNode * frame_node_
virtual ~AmbientSoundVisual()
void addPoint(const Ogre::Vector3 &point)
void setFramePosition(const Ogre::Vector3 &position)
Ogre::Quaternion orientation_
void setFrameOrientation(const Ogre::Quaternion &orientation)
Ogre::SceneManager * scene_manager_
void setColor(float r, float g, float b, float a)
void setColor(float r, float g, float b, float a) override
rviz::BillboardLine * ambient_sound_power_line_
void setMessage(const jsk_hark_msgs::HarkPower::ConstPtr &msg)
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
AmbientSoundVisual(Ogre::SceneManager *scene_manager, Ogre::SceneNode *parent_node)
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
void setLineWidth(float width)