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.
Autonomous_Quadcopter
Before coming to ROS with Gaszebo Simulation you need prior setting.You can find hereInstallation
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:
- Download ubuntu_sim.sh.
- Run the script in a bash shell:
source ubuntu_sim.sh
To install the development toolchain:
- Download ubuntu_sim_ros_gazebo.sh.
- 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
- Start ROS master as mentioned above
- Start gazebo
cd ~/src/Firmware
make px4_sitl gazebo
- Launch px4 with mavros
roslaunch mavros px4.launch fcu_url:="udp://:14540@127.0.0.1:14540"
- Running ros node for created task
cd ~/catkin_ws
source ./devel/setup.bash
rosrun offb uav