Skip to content

The coordinate conversion and the data of different topics. #4

@weiweikong

Description

@weiweikong

vi_pose_test-page-001

For understanding the code detail, I draw a diagram to analysis the code.

1. About the data of vehicle_command_ENU_

  • 1.1 vehicle_command_ENU_ and vehicle_setpoint_ENU_ only updated in the initialization part, initilaize_setpoint == true.
  • 1.2 When each direction of joy_sp = 0, the vehicle_setpoint_ENU_ is the same as the initialized one and vehicle_command_ENU_ is simply copy position and attitude from vehicle_setpoint_ENU_. So during the real flight, without RC control, the /mavros/setpoint_position/local are same.

2. About the data of vision/pose

It takes these FLU coordinates and transforms them into ENU coordinates (fixed inertial frame) with the target at the origin.

  • 2.1 the vision_pose/pose describes the vehicle position in target-ENU coordinates, whose origin is the current target. This might be means that, when target is moving, the vision_pose/pose should be changed even though the quadrotor is hovering.
  • 2.2 In this code snip,
  /**
  * This function takes the FLU target pose which is relative to the vehicle and transforms it into
  * the intertial frame with the vehicle at the origin.
  * Possibly a more efficient way to do this with ROS frames
  */
  void convertTargetFLUtoENU();

the position of target convert from FLU coordinate (whose origin is the camera ) to ENU coodrinate. As the code comments said, the ENU coodrinate should be the quadrotor-fixed ENU coodrinate.
Then the updateFCULocation() should be get the quadrotor position in target-ENU coodrinate. But when the target_origin_ENU_ is (0, 0, 0), the publish position through vision_pose should be the same as the quadrotor position as above calculated.

  • Is the coordinate conversion correct ?

3. About the data of vehicle_current_ENU

  • vehicle_current_ENU, which describes the local position (fusioned by the vision and IMU information) in ROS-ENU, was calculated from PX4 modules.

4. The whole process

image 001

4.1 At T = 0

  • the vehicle_command_ENU_ was set after calculated vision_pose_ when the target was detected.
  • the vehicle_current_ENU should not be (0, 0, 0), because it was calculated during the flight after arming the quadrotor.

4.2 At T = 1

  • When the target moved to another position, the related fixed-ROS-ENU coordinate was also changed.
  • However, the vehicle_command_ENU_ was keep the same vector relate to the new ROS-ENU coodrinate.
  • The current /mavros/local_position/local updated as the target_pose_ changed, which is shown in the purple dashed lines.
  • As the all joy_sp=0, the quadrotor should move from the last position to the proposed one, which decpited by green arrow.

I am a little bit confusing about the /mavros/local_position/local. Is the data of this topic mainly influence by /mavros/vision_pose/pose even though fusion with IMU data?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions