10 for(
unsigned int i = 0; i < edges.size(); ++i)
12 unsigned int i_plus = (i + 1) % edges.size();
13 if ((edges[i].second <= y && edges[i_plus].second > y) ||
14 (edges[i].second > y && edges[i_plus].second <= y))
16 if (fabs(edges[i_plus].second - edges[i].second) >
FLOAT_CMP_THR)
18 float vt = (float)(y - edges[i].second) / (edges[i_plus].second - edges[i].second);
19 if (x < edges[i].first + vt * (edges[i_plus].first - edges[i].first))
27 void getDeltaStep(
const msgs::Foot& current,
const msgs::Foot& next, geometry_msgs::Pose& dstep)
40 if (current.foot_index != next.foot_index && current.foot_index ==
msgs::Foot::LEFT)
42 dstep.position.y = -dstep.position.y;
57 dstep = current.
inverse() * next;
84 void normalToQuaternion(
const geometry_msgs::Vector3& n,
double yaw, geometry_msgs::Quaternion& q)
91 void RPYToNormal(
double r,
double p,
double y, geometry_msgs::Vector3& n)
93 double sin_roll = sin(r);
94 double sin_pitch = sin(p);
95 double sin_yaw = sin(y);
96 double cos_yaw = cos(y);
99 n.x = cos_yaw*sin_pitch + sin_yaw*sin_roll;
100 n.y = sin_yaw*sin_pitch - cos_yaw*sin_roll;
101 n.z = sqrt(1.0 - n.x*n.x + n.y*n.y);
104 void normalToRP(
const geometry_msgs::Vector3& n,
double yaw,
double& r,
double& p)
107 double sin_yaw = sin(-yaw);
108 double cos_yaw = cos(-yaw);
110 r = -asin(sin_yaw*n.x + cos_yaw*n.y);
111 p = asin(cos_yaw*n.x - sin_yaw*n.y);
static void poseMsgToTF(const geometry_msgs::Pose &msg, Pose &bt)
TFSIMD_FORCE_INLINE const tfScalar & y() const
static void quaternionMsgToTF(const geometry_msgs::Quaternion &msg, Quaternion &bt)
void getRPY(tfScalar &roll, tfScalar &pitch, tfScalar &yaw, unsigned int solution_number=1) const
static void poseTFToMsg(const Pose &bt, geometry_msgs::Pose &msg)
static geometry_msgs::Quaternion createQuaternionMsgFromRollPitchYaw(double roll, double pitch, double yaw)