mavros/local_position/pose only giving altitude

asked 2019-04-17 09:48:52 -0500

Luxiam gravatar image

updated 2021-04-24 03:13:18 -0500

miura gravatar image


  • List item
  • Linux ubuntu 16.04.
  • ROS kinetic
  • Mavros PX4 on a pixhawk 3 pro.

I'm reading out the data from the /mavros/local_position/pose to get a estimated location. The gazebo simulation runs the code fine. and returns all values as expected. When the IRL drone is running the topic gets updated like normal but the code only get a Z_alt value when reading the topic (code below), all the other values are 0.000000f or -0.0000000f. The only difference I can see is that the IRL drone sends data to the /mavros/vision_pose/pose topic to estimate its location.

geometry_msgs::PoseStamped edge;

    while (ros::ok())
        sharedEdge = ros::topic::waitForMessage<geometry_msgs::PoseStamped>("/mavros/local_position/pose", n);

        if (sharedEdge != NULL)
            edge = *sharedEdge;
            ROS_INFO("x:%f y:%f z:%f", edge.pose.position, edge.pose.position.y, edge.pose.position.z);

edit retag flag offensive close merge delete


Hi, did you solve the problem? I have the same issue. I only get valuses of orientation and z from /mavros/local_position/pose

饭团ft gravatar image 饭团ft  ( 2020-03-28 12:41:16 -0500 )edit