Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 #ifndef ROTATION_PROPERTY_H
00033 #define ROTATION_PROPERTY_H
00034 
00035 #include <Eigen/Geometry>
00036 #include <stdexcept>
00037 
00038 #include <rviz/properties/string_property.h>
00039 #include <rviz/properties/quaternion_property.h>
00040 #include "euler_property.h"
00041 
00042 namespace agni_tf_tools
00043 {
00044 
00045 class RotationProperty: public rviz::StringProperty
00046 {
00047 Q_OBJECT
00048 public:
00049   RotationProperty(Property* parent = 0,
00050                    const QString& name = QString(),
00051                    const Eigen::Quaterniond& value = Eigen::Quaterniond::Identity(),
00052                    const char *changed_slot = 0,
00053                    QObject* receiver = 0);
00054 
00055   Eigen::Quaterniond getQuaternion() const;
00056   virtual bool setValue(const QVariant& value);
00057 
00059   virtual void load(const rviz::Config& config);
00060   virtual void save(rviz::Config config) const;
00061 
00063   virtual void setReadOnly(bool read_only);
00064 
00065 public Q_SLOTS:
00066   void setQuaternion(const Eigen::Quaterniond &q);
00067   void setEulerAngles(double euler[3], bool normalize);
00068   void setEulerAngles(double e1, double e2, double e3, bool normalize);
00069   void setEulerAxes(const QString &axes);
00070 
00071 private Q_SLOTS:
00072   void updateFromEuler();
00073   void updateFromQuaternion();
00074 
00075 Q_SIGNALS:
00077   void quaternionChanged(Eigen::Quaterniond q);
00079   void statusUpdate(int, const QString&, const QString&);
00080 
00081 private:
00082   void updateString();
00083 
00084   rviz::EulerProperty *euler_property_;
00085   rviz::QuaternionProperty *quaternion_property_;
00086   bool ignore_quaternion_property_updates_;
00087   bool show_euler_string_;
00088 };
00089 
00090 } 
00091 
00092 #endif // ROTATION_PROPERTY_H