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);
78 Ogre::Vector3 axis_z(0, 0, 1);
79 Ogre::Quaternion orientation = axis_z.getRotationTo(torque);
80 if (std::isnan(orientation.x) || std::isnan(orientation.y) || std::isnan(orientation.z))
81 orientation = Ogre::Quaternion::IDENTITY;
86 Ogre::Vector3(torque_length / 4, 0, torque_length / 2));
89 for (
int i = 4; i <= 32; i++)
92 Ogre::Vector3((torque_length / 4) *
cos(i * 2 * M_PI / 32),
93 (torque_length / 4) *
sin(i * 2 * M_PI / 32), torque_length / 2);
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 setPosition(const Ogre::Vector3 &position) override
Set the position of the base 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.
Ogre::SceneNode * torque_node_
void setWrench(const Ogre::Vector3 &force, const Ogre::Vector3 &torque)
void setForceScale(float s)
void setVisible(bool visible)
void setColor(float r, float g, float b, float a) override
Set the color of the object. Values are in the range [0, 1].
void setScale(const Ogre::Vector3 &scale) override
Set the scale of the object. Always relative to the identity orientation of the object.
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.
void setHideSmallValues(bool h)
void setColor(float r, float g, float b, float a) override
Set the color of this arrow. Sets both the head and shaft color to the same value. Values are in the range [0, 1].
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
WrenchVisual(Ogre::SceneManager *scene_manager, Ogre::SceneNode *parent_node)
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
void setLineWidth(float width)