How to change the yaw angle in ROS
Hi guys, I have been working on the ar.drone flying robot and what I want is to have the ar.drone takeoff, change the yaw angle by 90 degrees while holding that hover position and then land. I tried to write some code to achieve this but what happens is the ar.drone keeps on spinning all throughout the take off and landing. Here is my method:
void DC::Yaw(){
ros::NodeHandle nh;
ros::Publisher flyF = nh.advertise<geometry_msgs::Twist>("/cmd_vel", 1000, true);
geometry_msgs::Twist yaw;
yaw.angular.x =0;
yaw.angular.y = 0;
yaw.angular.z = 1.57;
flyF.publish(yaw);
ros::Duration(1).sleep();
}
My takeoff and land functions work well but it is just this yaw function that is causing me issues.
Thanks!
What if you publish zero velocity after that 1 second?