normal_visual.cpp
Go to the documentation of this file.
1 // -*- mode:c++ -*-
2 #include "normal_visual.h"
3 
4 namespace jsk_rviz_plugins
5 {
6 
7  NormalVisual::NormalVisual( Ogre::SceneManager* scene_manager, Ogre::SceneNode* parent_node )
8  {
9  scene_manager_ = scene_manager;
10  frame_node_ = parent_node->createChildSceneNode();
12  }
13 
15  {
16  scene_manager_->destroySceneNode( frame_node_ );
17  }
18 
19  void NormalVisual::setValues( float x, float y, float z, float normal_x, float normal_y, float normal_z)
20  {
21 
22  Ogre::Vector3 dir( normal_x, normal_y, normal_z);
23  Ogre::Vector3 pos( x, y, z);
24 
25  float length = dir.length()/10;
26 
27  Ogre::Vector3 scale( length, length, length );
28  normal_arrow_->setScale( scale );
29  normal_arrow_->setDirection( dir );
30  normal_arrow_->setPosition(pos);
31  }
32 
33  void NormalVisual::setFramePosition( const Ogre::Vector3& position )
34  {
35  frame_node_->setPosition( position );
36  }
37 
38  void NormalVisual::setFrameOrientation( const Ogre::Quaternion& orientation )
39  {
40  frame_node_->setOrientation( orientation );
41  }
42 
43  void NormalVisual::setColor( float r, float g, float b, float a )
44  {
45  normal_arrow_->setColor( r, g, b, a );
46  }
47 
49  {
50  normal_arrow_->setScale( Ogre::Vector3( scale, scale, scale ) );
51  }
52 
53 }
jsk_rviz_plugins::NormalVisual::scene_manager_
Ogre::SceneManager * scene_manager_
Definition: normal_visual.h:37
contact_state_marker.scale
scale
Definition: contact_state_marker.py:91
rviz::Arrow
tf_diff_text.pos
pos
Definition: tf_diff_text.py:18
bounding_box_sample.z
z
Definition: bounding_box_sample.py:28
jsk_rviz_plugins::NormalVisual::frame_node_
Ogre::SceneNode * frame_node_
Definition: normal_visual.h:36
jsk_rviz_plugins::NormalVisual::~NormalVisual
virtual ~NormalVisual()
Definition: normal_visual.cpp:14
jsk_rviz_plugins::NormalVisual::NormalVisual
NormalVisual(Ogre::SceneManager *scene_manager, Ogre::SceneNode *parent_node)
Definition: normal_visual.cpp:7
jsk_rviz_plugins::NormalVisual::setColor
void setColor(float r, float g, float b, float a)
Definition: normal_visual.cpp:43
jsk_rviz_plugins::NormalVisual::setScale
void setScale(float scale)
Definition: normal_visual.cpp:48
overlay_menu_sample.b
b
Definition: overlay_menu_sample.py:20
jsk_rviz_plugins::NormalVisual::setFrameOrientation
void setFrameOrientation(const Ogre::Quaternion &orientation)
Definition: normal_visual.cpp:38
bounding_box_sample.x
x
Definition: bounding_box_sample.py:26
bounding_box_sample.r
r
Definition: bounding_box_sample.py:10
bounding_box_sample.y
y
Definition: bounding_box_sample.py:27
overlay_menu_sample.g
g
Definition: overlay_menu_sample.py:19
length
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)
jsk_rviz_plugins::NormalVisual::setValues
void setValues(float x, float y, float z, float normal_x, float normal_y, float normal_z)
Definition: normal_visual.cpp:19
jsk_rviz_plugins::NormalVisual::setFramePosition
void setFramePosition(const Ogre::Vector3 &position)
Definition: normal_visual.cpp:33
jsk_rviz_plugins::NormalVisual::normal_arrow_
boost::shared_ptr< rviz::Arrow > normal_arrow_
Definition: normal_visual.h:34
jsk_rviz_plugins
Definition: __init__.py:1
normal_visual.h


jsk_rviz_plugins
Author(s): Kei Okada , Yohei Kakiuchi , Shohei Fujii , Ryohei Ueda
autogenerated on Fri Aug 2 2024 08:50:14