Beispiel #1
0
  Eigen::Vector3d pose3Dto2D (geometry_msgs::Point const & translation,
			      geometry_msgs::Quaternion const & orientation)
  {
    // Can somebody please explain to me why Eigen has chosen to store
    // the parameters in (x,y,z,w) order, but provide a ctor in
    // (w,x,y,z) order? What have they been smoking?
    //
    Eigen::Quaternion<double> const rot (orientation.w,
					 orientation.x,
					 orientation.y,
					 orientation.z);
    Eigen::Vector3d ux;
    ux << 1.0, 0.0, 0.0;
    ux = rot._transformVector (ux);
    Eigen::Vector3d pose (translation.x, translation.y, atan2 (ux.y(), ux.x()));
    return pose;
  }