update function getYaw template
This commit is contained in:
@@ -12,10 +12,11 @@
|
|||||||
|
|
||||||
namespace data_convert
|
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 siny_cosp = 2.0 * (value.w * value.z + value.x * value.y);
|
||||||
double cosy_cosp = 1.0 - 2.0 * (q.y * q.y + q.z * q.z);
|
double cosy_cosp = 1.0 - 2.0 * (value.y * value.y + value.z * value.z);
|
||||||
return std::atan2(siny_cosp, cosy_cosp);
|
return std::atan2(siny_cosp, cosy_cosp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user