OpenWalker Project
Documentation of the ROS Packages
cartesian_acceleration.h
Go to the documentation of this file.
1 
34 #ifndef OPEN_WALKER_CORE_CARTESIAN_ACCELERATION_REF_H
35 #define OPEN_WALKER_CORE_CARTESIAN_ACCELERATION_REF_H
36 
39 #include <geometry_msgs/Accel.h>
40 
41 namespace ow_core
42 {
54 template <typename _Scalar>
56  public Eigen::Matrix<_Scalar, 6, 1>
57 {
58 public:
59  typedef _Scalar Scalar;
60  typedef Eigen::Matrix<Scalar, 6, 1> Base;
61 
68  {
69  static const CartesianAcceleration v = Base::Zero();
70  return v;
71  }
72 
73 public:
77  explicit CartesianAcceleration() : Base(Default())
78  {
79  }
80 
87  template <typename OtherDerived>
88  CartesianAcceleration(const Eigen::EigenBase<OtherDerived>& other) :
89  Base(other.derived())
90  {
91  }
92 
96  explicit CartesianAcceleration(const geometry_msgs::Accel& other)
97  {
98  operator=(other);
99  }
100 
104  using Base::operator=;
105 
110  void operator=(const geometry_msgs::Accel& Xpp)
111  {
112  linear() = Xpp.linear;
113  angular() = Xpp.angular;
114  }
115 
121  operator geometry_msgs::Accel() const
122  {
123  geometry_msgs::Accel Xpp;
124  Xpp.linear = linear();
125  Xpp.angular = angular();
126  return Xpp;
127  }
128 
134  geometry_msgs::Accel toAccelMsg() const
135  {
136  return static_cast<geometry_msgs::Accel>(*this);
137  }
138 
143  {
144  return LinearAccelerationRef<Base>(*this);
145  }
146 
151  {
152  return LinearAccelerationRef<const Base>(*this);
153  }
154 
159  {
160  return AngularAccelerationRef<Base>(*this, 3);
161  }
162 
167  {
168  return AngularAccelerationRef<const Base>(*this, 3);
169  }
170 
174  std::string toString() const
175  {
176  std::ostringstream out;
177  out << this->transpose();
178  return out.str();
179  }
180 };
181 
182 } // namespace ow_core
183 
184 #endif // OPEN_WALKER_CORE_CARTESIAN_ACCELERATION_REF_H
geometry_msgs::Accel toAccelMsg() const
Conversion to geometry_msgs::Twist.
Definition: cartesian_acceleration.h:134
LinearAccelerationRef< const Base > linear() const
const access to linear part
Definition: cartesian_acceleration.h:150
std::string toString() const
Conversion to std::string.
Definition: cartesian_acceleration.h:174
AngularAccelerationRef< const Base > angular() const
const access to angular part
Definition: cartesian_acceleration.h:166
CartesianAcceleration(const geometry_msgs::Accel &other)
Copy constructor form geometry_msgs::Accel.
Definition: cartesian_acceleration.h:96
The CartesianAcceleration class.
Definition: cartesian_acceleration.h:55
AngularAccelerationRef< Base > angular()
access to angular part
Definition: cartesian_acceleration.h:158
The AngularAccelerationRef class.
Definition: angular_acceleration_ref.h:53
Definition: angular_acceleration.h:39
CartesianAcceleration(const Eigen::EigenBase< OtherDerived > &other)
Copy constructor.
Definition: cartesian_acceleration.h:88
void operator=(const geometry_msgs::Accel &Xpp)
Assignment form geometry_msgs::Accel.
Definition: cartesian_acceleration.h:110
CartesianAcceleration()
Default Constructor.
Definition: cartesian_acceleration.h:77
The LinearAccelerationRef class.
Definition: linear_acceleration_ref.h:52
static const CartesianAcceleration< Scalar > & Default()
Construct as Default.
Definition: cartesian_acceleration.h:67
LinearAccelerationRef< Base > linear()
access to linear part
Definition: cartesian_acceleration.h:142