# How to do a ROS2 and px4 with Gazebo integration similar to the Ros1 and gazebo example

**URL:** <https://discuss.px4.io/t/how-to-do-a-ros2-and-px4-with-gazebo-integration-similar-to-the-ros1-and-gazebo-example/26582>\
**Category:** ROS 1 / ROS 2\
**Created:** [March 14, 2022, 7:50pm UTC](https://discuss.px4.io/t/how-to-do-a-ros2-and-px4-with-gazebo-integration-similar-to-the-ros1-and-gazebo-example/26582 "2022-03-14T19:50:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![steven4life](https://discuss.px4.io/user_avatar/discuss.px4.io/steven4life/32/10149_2.png) [@steven4life](https://discuss.px4.io/u/steven4life)\
**Post date:** [March 14, 2022, 7:50pm UTC](https://discuss.px4.io/t/how-to-do-a-ros2-and-px4-with-gazebo-integration-similar-to-the-ros1-and-gazebo-example/26582/1 "2022-03-14T19:50:52Z")

</div>

I want to replicate the same to run ros2 and px4 with gazebo as shown in the example in this link: [ROS with Gazebo Simulation | PX4 User Guide](https://docs.px4.io/master/en/simulation/ros_interface.html).  
Specifically this section of code.

```auto
cd <PX4-Autopilot_clone>
DONT_RUN=1 make px4_sitl_default gazebo
source ~/catkin_ws/devel/setup.bash # (optional)
source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)/Tools/sitl_gazebo
roslaunch px4 posix_sitl.launch

```
