1 #include <OgreVector3.h> 2 #include <OgreSceneNode.h> 3 #include <OgreSceneManager.h> 53 Ogre::Vector3 force(wrench.force.x, wrench.force.y, wrench.force.z);
54 Ogre::Vector3 torque(wrench.torque.x, wrench.torque.y, wrench.torque.z);
63 bool show_force = (force_length >
width_);
64 bool show_torque = (torque_length >
width_);
74 Ogre::Vector3 axis_z(0,0,1);
75 Ogre::Quaternion orientation = axis_z.getRotationTo(torque);
76 if ( std::isnan(orientation.x) ||
77 std::isnan(orientation.y) ||
78 std::isnan(orientation.z) ) orientation = Ogre::Quaternion::IDENTITY;
85 for (
int i = 4; i <= 32; i++) {
86 Ogre::Vector3 point = Ogre::Vector3((torque_length/4)*cos(i*2*M_PI/32),
87 (torque_length/4)*sin(i*2*M_PI/32),
rviz::BillboardLine * circle_torque_
void setFrameOrientation(const Ogre::Quaternion &orientation)
void setTorqueScale(float s)
rviz::Arrow * circle_arrow_torque_
Ogre::SceneManager * scene_manager_
void addPoint(const Ogre::Vector3 &point)
Ogre::SceneNode * frame_node_
An object that displays a multi-segment line strip rendered as billboards.
void setDirection(const Ogre::Vector3 &direction)
Set the direction of the arrow.
void setTorqueColor(float r, float g, float b, float a)
void setFramePosition(const Ogre::Vector3 &position)
Ogre::SceneNode * force_node_
void set(float shaft_length, float shaft_diameter, float head_length, float head_diameter)
Set the parameters for this arrow.
virtual void setColor(float r, float g, float b, float a)
Set the color of the object. Values are in the range [0, 1].
Ogre::SceneNode * torque_node_
void setWrench(const Ogre::Vector3 &force, const Ogre::Vector3 &torque)
void setForceScale(float s)
virtual void setPosition(const Ogre::Vector3 &position)
Set the position of the base of the arrow.
virtual void setScale(const Ogre::Vector3 &scale)
Set the scale of the object. Always relative to the identity orientation of the object.
void setVisible(bool visible)
virtual void setColor(float r, float g, float b, float a)
Set the color of this arrow. Sets both the head and shaft color to the same value. Values are in the range [0, 1].
rviz::Arrow * arrow_torque_
void setForceColor(float r, float g, float b, float a)
rviz::Arrow * arrow_force_
An arrow consisting of a cylinder and a cone.
WrenchVisual(Ogre::SceneManager *scene_manager, Ogre::SceneNode *parent_node)
void setLineWidth(float width)