40 geometry_msgs::PoseStamped desiredPosition;
43 double distanceRelation, dx, dy, dz, desiredAngle, desiredAngleRaw, desiredW, yawValid, aCat, oCat, positionX, positionY, positionZ;
49 desiredAngleRaw =
atan(oCat/aCat);
51 desiredAngleRaw = desiredAngleRaw - M_PI;
53 angleQuaternion.
setRPY(0, 0, desiredAngleRaw);
54 desiredAngle = angleQuaternion.getZ();
55 desiredW = angleQuaternion.
getW();
57 desiredPosition.pose.orientation.w = desiredW;
58 desiredPosition.pose.orientation.z = desiredAngle;
64 yawValid = fabs(fabs(
currentPosition.pose.orientation.z) - fabs(desiredPosition.pose.orientation.z));
67 }
while (yawValid >= 0.1);
69 desiredPosition.pose.position.x = msg.position.x;
70 desiredPosition.pose.position.y = msg.position.y;
71 desiredPosition.pose.position.z = msg.position.z;
79 positionX = fabs(fabs(
currentPosition.pose.position.x) - fabs(desiredPosition.pose.position.x));
80 positionY = fabs(fabs(
currentPosition.pose.position.y) - fabs(desiredPosition.pose.position.y));
81 positionZ = fabs(fabs(
currentPosition.pose.position.z) - fabs(desiredPosition.pose.position.z));
84 }
while (positionX >= 0.1 && positionY >= 0.1 && positionZ >= 0.1);
void cbPoseCommander(const geometry_msgs::Pose &msg)
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
void cbOdomUAV(const geometry_msgs::PoseStampedConstPtr &msg)
ros::Publisher pubDesiredPosition
ros::Publisher pubMissionStop
geometry_msgs::PoseStamped currentPosition
ros::Subscriber subPoseCommander
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
void publish(const boost::shared_ptr< M > &message) const
TFSIMD_FORCE_INLINE const tfScalar & getW() const
ROSCPP_DECL const std::string & getNamespace()
INLINE Rall1d< T, V, S > atan(const Rall1d< T, V, S > &x)
ros::Subscriber subOdomUAV
void setRPY(const tfScalar &roll, const tfScalar &pitch, const tfScalar &yaw)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ros::Publisher pubMissionStart
ROSCPP_DECL void spinOnce()