Ask Your Question
0

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

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

edit retag flag offensive close merge delete

Comments

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

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

1 Answer

Sort by ยป oldest newest most voted
1

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

Comments

Any clue about sending data to control the quad ?

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

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 imageHumberto Beltrao ( 2015-06-19 09:11:54 -0500 )edit

Ah - awesome - thanks :)

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 1,006 times

Last updated: Jun 15 '15