Robotics StackExchange | Archived questions

mavros/local_position/pose only giving altitude

Setup:

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);
        }
        ros::spinOnce();

}

Asked by Luxiam on 2019-04-17 09:48:52 UTC

Comments

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

Asked by 饭团ft on 2020-03-28 12:41:16 UTC

Answers