mzahana / px4_fast_planner

Integration of Fast-Planner with PX4 autopilot for multi-rotor fast navigation with obstacle avoidance
MIT License
220 stars 46 forks source link

Change Drone Start Position #9

Closed lgh5054 closed 4 years ago

lgh5054 commented 4 years ago

Hello

I'd like to start take off the drone at x = -40

arg name="init_pos_x" default="0.0" If you change the arg name="init_pos_x" default="-40.0" , it will fly in the -40 direction after takeoff.

After Launch File

Can a drone start at x= -40?

mzahana commented 4 years ago

@lgh5054 Please check the updated launch file (https://github.com/mzahana/px4_fast_planner/blob/master/launch/px4_fast_planner.launch#L36-L37). Now you can set the initial position of the drone in Gazebo. Please note that this is different from the position estimate provided by PX4 estimator. Although you can arbitrary change the initial position in Gazebo, this is still going to be the zero position of the PX4 local frame.

lgh5054 commented 4 years ago

@mzahana I appreciate you responding

I can set the initial position of the drone in Gazebo

but I need is set the PX4 local frame .... What do I do?

mzahana commented 4 years ago

I don't think there is a direct way to do that.

lgh5054 commented 4 years ago

@mzahana thanks mzahana

mzahana commented 4 years ago

One, indirect, way to do it is to write a node that publishes vision pose estimates based on Gazebo pose of the drone model. This will be passed to MAVROS as vision pose estimate (https://dev.px4.io/v1.10/en/ros/external_position_estimation.html). You will also need to set the EKF2_AID_MASK in the corresponding PX4 startup file appropriately to accept vision estimates instead of GPS. Additionally, you will need to set EKF2_HGT_MODE to use height estimate from vision. For further information, please refer to the related documentation.