Skip to content

Basic command to simulate UAV on Gazebo using PX4 with MAVROS node

Notifications You must be signed in to change notification settings

pintu-iitbhu/ROS_Gazebo_Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

ROS_Gazebo_Simulation

ROS (Robot Operating System) can be used with PX4 and the Gazebo simulator. It uses the MAVROS MAVLink node to communicate with PX4.

Before coming to ROS with Gaszebo Simulation you need prior setting.You can find here Autonomous_Quadcopter

Installation

Gazebo 7 setup is included in our standard build instructions.

  • Linux: Development Environment on Linux (Ubuntu 16.04) > jMAVSim/Gazebo Simulation

To install the Gazebo7 and Gazebo/jMAVSim simulators:

  1. Download ubuntu_sim.sh.
  2. Run the script in a bash shell:
source ubuntu_sim.sh

To install the development toolchain:

  1. Download ubuntu_sim_ros_gazebo.sh.
  2. Run the script in a bash shell:
source ubuntu_sim_ros_gazebo.sh

PX4 installation

mkdir -p ~/src
cd ~/src
git clone https://github.com/pkyadav73199/Firmware.git
cd Firmware
git submodule update --init --recursive

Install PX4 Dependencies

Install PX4 "common" dependencies.

cd ~/src/Firmware
./Tools/setup/ubuntu.sh --no-sim-tools --no-nuttx

Gstreamer plugins (for Gazebo camera)

sudo apt install gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly libgstreamer-plugins-base1.0-dev

Running UAV Simulation with px4 firmware

cd ~/src/Firmware
make px4_sitl gazebo

Putting it all together

  1. Start ROS master as mentioned above
  2. Start gazebo
cd ~/src/Firmware
make px4_sitl gazebo
  1. Launch px4 with mavros
roslaunch mavros px4.launch fcu_url:="udp://:14540@127.0.0.1:14540"
  1. Running ros node for created task
cd ~/catkin_ws
source ./devel/setup.bash 
rosrun offb uav

About

Basic command to simulate UAV on Gazebo using PX4 with MAVROS node

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages