ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Read hector quadrotor position and control its yaw angles

asked 2014-07-13 20:52:42 -0500

Glen gravatar image

updated 2014-07-13 21:01:49 -0500


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

edit retag flag offensive close merge delete


Have you solved the second question about the pitch angle and roll angle? I have the same problem.

ZP gravatar image ZP  ( 2016-05-31 14:46:45 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-06-15 08:07:12 -0500

Humberto Beltrao gravatar image

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); }

edit flag offensive delete link more


Any clue about sending data to control the quad ?

AbdealiJK gravatar image AbdealiJK  ( 2015-06-19 04:11:14 -0500 )edit

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

Humberto Beltrao gravatar image Humberto Beltrao  ( 2015-06-19 09:11:54 -0500 )edit

Ah - awesome - thanks :)

AbdealiJK gravatar image AbdealiJK  ( 2015-06-19 21:50:06 -0500 )edit

Question Tools



Asked: 2014-07-13 20:52:42 -0500

Seen: 1,640 times

Last updated: Jun 15 '15