Compare commits
1 Commits
004dd7f0ff
...
1cf62c0856
| Author | SHA1 | Date | |
|---|---|---|---|
| 1cf62c0856 |
@@ -12,10 +12,11 @@
|
||||
|
||||
namespace data_convert
|
||||
{
|
||||
inline double getYaw(const robot_geometry_msgs::Quaternion& q)
|
||||
template<typename T>
|
||||
inline double getYaw(const T& value)
|
||||
{
|
||||
double siny_cosp = 2.0 * (q.w * q.z + q.x * q.y);
|
||||
double cosy_cosp = 1.0 - 2.0 * (q.y * q.y + q.z * q.z);
|
||||
double siny_cosp = 2.0 * (value.w * value.z + value.x * value.y);
|
||||
double cosy_cosp = 1.0 - 2.0 * (value.y * value.y + value.z * value.z);
|
||||
return std::atan2(siny_cosp, cosy_cosp);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user