euler_property.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016, Bielefeld University, CITEC
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  *
29  * Author: Robert Haschke <rhaschke@techfak.uni-bielefeld.de>
30  */
31 
32 #ifndef EULER_PROPERTY_H
33 #define EULER_PROPERTY_H
34 
35 #include <Eigen/Geometry>
36 #include <stdexcept>
37 
39 
40 namespace rviz
41 {
42 
43 class FloatProperty;
44 
45 class EulerProperty: public Property
46 {
47  Q_OBJECT
48 public:
49  class invalid_axes : public std::invalid_argument {
50  public:
51  invalid_axes(const std::string &msg);
52  };
53 
54  EulerProperty(Property* parent = 0,
55  const QString& name = QString(),
56  const Eigen::Quaterniond& value = Eigen::Quaterniond::Identity(),
57  const char *changed_slot = 0,
58  QObject* receiver = 0);
59 
60  Eigen::Quaterniond getQuaternion() const {return quaternion_;}
61  virtual bool setValue(const QVariant& value);
62 
65  virtual void load(const Config& config);
66  virtual void save(Config config) const;
67 
69  virtual void setReadOnly(bool read_only);
71 
72 public Q_SLOTS:
73  void setQuaternion(const Eigen::Quaterniond &q);
74  void setEulerAngles(double euler[3], bool normalize);
75  void setEulerAngles(double e1, double e2, double e3, bool normalize);
80  void setEulerAxes(const QString &axes_spec);
81 
82 private Q_SLOTS:
83  void updateFromChildren();
84  void emitAboutToChange();
85 
86 Q_SIGNALS:
88  void quaternionChanged(Eigen::Quaterniond q);
90  void statusUpdate(int, const QString&, const QString&);
91 
92 private:
93  void updateAngles(const Eigen::Quaterniond &q);
94  void updateString();
95 
96  Eigen::Quaterniond quaternion_;
97  QString axes_string_;
98  uint axes_[3]; // unit axis index for i-th rotation
99  bool fixed_;
103  bool update_string_; // do we have any changes triggering an updateString()?
104 };
105 
106 } // end namespace rviz
107 
108 #endif // EULER_PROPERTY_H
virtual bool setValue(const QVariant &value)
Eigen::Quaterniond getQuaternion() const
virtual void setReadOnly(bool read_only)
Overridden from Property to propagate read-only-ness to children.
void quaternionChanged(Eigen::Quaterniond q)
Eigen::Quaterniond quaternion_
config
void setEulerAngles(double euler[3], bool normalize)
invalid_axes(const std::string &msg)
void updateAngles(const Eigen::Quaterniond &q)
void setQuaternion(const Eigen::Quaterniond &q)
void setEulerAxes(const QString &axes_spec)
FloatProperty * euler_[3]
TFSIMD_FORCE_INLINE Vector3 & normalize()
virtual void save(Config config) const
virtual void load(const Config &config)
Load the value of this property and/or its children from the given Config node.
EulerProperty(Property *parent=0, const QString &name=QString(), const Eigen::Quaterniond &value=Eigen::Quaterniond::Identity(), const char *changed_slot=0, QObject *receiver=0)
void statusUpdate(int, const QString &, const QString &)


agni_tf_tools
Author(s): Robert Haschke
autogenerated on Fri Jun 7 2019 22:04:59