0
$\begingroup$

Rosanswers logo

Hi

I am running hector quadrotor demo with two spawn quadrotors and get two questions:

  1. How to read quadrotor's position? I asked it to show topics "/uav/uav1/fix" and it was supposed to show (latitude,longitude, altitude). However, when I move the UAV, only altitude change with the moving. Latitude and longitude don't change. Thus, I don't know how to read position (x,y).
  2. Cannot control its pitch angle and roll angle. I published "geometry_msgs/Twist" to "cmd_vel",and I can control its yaw angle. But whatever value I chosen for message to publish, pitch angle and roll angle don't change.

I appreciate any advice.

Thanks Glen


Originally posted by Glen on ROS Answers with karma: 40 on 2014-07-13

Post score: 0


Original comments

Comment by ZP on 2016-05-31:
Have you solved the second question about the pitch angle and roll angle? I have the same problem.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Position messages are PoseStamped kind of messages. You can subscribe to the /uav1/ground_truth_to_tf/pose topic to get quadrotor's position. Then you can display its axes values using a callback function.

void callback_u1(const geometry_msgs::PoseStamped& ps) { ROS_INFO_STREAM(ps.pose.position.x); ROS_INFO_STREAM(ps.pose.position.y); ROS_INFO_STREAM(ps.pose.position.z); }


Originally posted by Humberto Beltrao with karma: 30 on 2015-06-15

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by AbdealiJK on 2015-06-19:
Any clue about sending data to control the quad ?

Comment by Humberto Beltrao on 2015-06-19:
You can use the publisher-subscriber data exchanging for this purpose. Once you know the desired (x, y, z) point you want the quad to go you can:

  1. Publish velocity commands to the quad using uav/cmd_vel;
  2. Check the distance between quad's position and the desired point using subscriber policy

Comment by AbdealiJK on 2015-06-19:
Ah - awesome - thanks :)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.