30 Aralık 2020 Çarşamba

How to Make A Program to Offboard the drone on PX4 gazebo ROS

 Hello, in order to hover the drone like in the simulation like this one: 

https://dev.px4.io/master/en/ros/mavros_offboard.html

you need to firstly clone this repo:

https://github.com/darienmt/px4-sitl-ros-example

on anywhere. Then go into this directory on shell:

$ cd px4-sitl-ros-example

then, catkin make it:

$ catkin_make

then source the devel/setup.bash file:

$ source devel/setup.bash

Then, on another terminal go to PX4 directory(considering you have already installed)

$ cd ~/PX4-Autopilot

This directory may be different on yours. Then run Px4 autopilot:

$ make px4_sitl gazebo

You may need to add sudo in front of this command.

This must run gazebo with a drone.

Then on another terminal run(directory is not important):

$ roslaunch mavros px4.launch fcu_url:="udp://:14540@127.0.0.1:14557"

Then on the first terminal where was in px4-sitl-ros-example directory, or another terminal which you are in px4-sitl-ros-example directory, run:

$ rosrun offb offb_node

The drone must hover


Here is a screenshot where I closed the programs, you can look from here.
Have fun.
You can contact me on: sahinkasap52@gmail.com


Hiç yorum yok:

Yorum Gönder