# Adding custom model in Gazebo classic

**URL:** <https://discuss.px4.io/t/adding-custom-model-in-gazebo-classic/43858>\
**Category:** PX4 Autopilot\
**Created:** [February 20, 2025, 12:39pm UTC](https://discuss.px4.io/t/adding-custom-model-in-gazebo-classic/43858 "2025-02-20T12:39:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![OKsusu1411](https://discuss.px4.io/user_avatar/discuss.px4.io/oksusu1411/32/15827_2.png) [@OKsusu1411](https://discuss.px4.io/u/OKsusu1411)\
**Post date:** [February 20, 2025, 12:39pm UTC](https://discuss.px4.io/t/adding-custom-model-in-gazebo-classic/43858/1 "2025-02-20T12:39:13Z")

</div>

I’m using Ubuntu 22.04, ROS2 Humble, Gazebo classic for developing environment.  
And have some trouble with adding own custom tiltrotor model.  
This files below is what i modified it

```bash
/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/models/ # put my custom model sdf file   
/PX4-Autopilot/ROMFS/px4fmu_common/init.d-posix/airframes # add custom model's parameters and modify CMakeLists.txt

```

After that i just type ‘make px4\_sitl command’ and result is

```bash
ubuntu@ubuntu-laptop:~/PX4-Autopilot$ make px4_sitl gazebo-classic_titan_hornet
ninja: error: unknown target 'gazebo-classic_titan_hornet'
make: *** [Makefile:232: px4_sitl] Error 1

```

My custom model’s name is titan\_hornet and **i would appreciate it if let me know which files should i modify to use custom model on gazebo classic.**  
Also other models on gazebo classic works well.

---

<div class="post-metadata">

**Author:** ![mohamdlog](https://discuss.px4.io/user_avatar/discuss.px4.io/mohamdlog/32/18582_2.png) [@mohamdlog](https://discuss.px4.io/u/mohamdlog)\
**Post date:** [February 24, 2025, 5:50am UTC](https://discuss.px4.io/t/adding-custom-model-in-gazebo-classic/43858/2 "2025-02-24T05:50:25Z")

</div>

To add a custom vehicle for use with Gazebo Classic SITL, follow these steps:

1. Navigate to the directory:  
`PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/models`.
2. Create a new directory for your model. For example:  
`titan_hornet`.
3. Inside your model directory, create two files:
  - An SDF (Simulation Description Format) file.
  - A model configuration file.

4. Navigate to the directory:  
`PX4-Autopilot/ROMFS/px4fmu_common/init.d-posix/airframes`.
5. Create a new airframe for your model, prefacing the filename with `gazebo-classic`. For example:  
`5001_gazebo-classic_titan_hornet`.
6. In the same directory, add your airframe to the CMake file by including it in the `px4_add_romfs_files()` function.
7. Navigate to:  
`PX4-Autopilot/src/modules/simulation/simulator_mavlink`.
8. Add your vehicle to the sitl\_targets\_gazebo-classic configuration (e.g., `set(models ...)`).
9. After completing these steps, you can launch Gazebo Classic with your custom model using the following command:  
`make px4_sitl gazebo-classic_titan_hornet`.

---

<div class="post-metadata">

**Author:** ![crazy-robotics](https://discuss.px4.io/user_avatar/discuss.px4.io/crazy-robotics/32/21620_2.png) [@crazy-robotics](https://discuss.px4.io/u/crazy-robotics)\
**Post date:** [February 25, 2025, 7:40am UTC](https://discuss.px4.io/t/adding-custom-model-in-gazebo-classic/43858/3 "2025-02-25T07:40:58Z")

</div>

You can look the following [Create custom model for SITL](https://discuss.px4.io/t/create-custom-model-for-sitl/6700) for more details

---

<div class="post-metadata">

**Author:** ![mohamdlog](https://discuss.px4.io/user_avatar/discuss.px4.io/mohamdlog/32/18582_2.png) [@mohamdlog](https://discuss.px4.io/u/mohamdlog)\
**Post date:** [March 8, 2025, 5:46am UTC](https://discuss.px4.io/t/adding-custom-model-in-gazebo-classic/43858/4 "2025-03-08T05:46:36Z")

</div>

The information in that thread is outdated.

---

<div class="post-metadata">

**Author:** ![mohamdlog](https://discuss.px4.io/user_avatar/discuss.px4.io/mohamdlog/32/18582_2.png) [@mohamdlog](https://discuss.px4.io/u/mohamdlog)\
**Post date:** [March 18, 2025, 9:43pm UTC](https://discuss.px4.io/t/adding-custom-model-in-gazebo-classic/43858/5 "2025-03-18T21:43:01Z")

</div>

Slight correction: [22000, 22999] are reserved for custom models, so it is recommended to use these numbers as a prefix (e.g., `22000_gazebo-classic_titan_hornet`).

---

<div class="post-metadata">

**Author:** ![system](https://discuss.px4.io/uploads/default/original/3X/7/3/73ce918bdcd64854de904f0c8d9ab70ca9723f2a.png) [@system](https://discuss.px4.io/u/system)\
**Post date:** [June 16, 2025, 9:43pm UTC](https://discuss.px4.io/t/adding-custom-model-in-gazebo-classic/43858/6 "2025-06-16T21:43:59Z")

</div>

Closed on June 16, 2025, 9:43pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
