# Controlling gimbal with ros node in sitl for typhoon h480

**URL:** <https://discuss.px4.io/t/controlling-gimbal-with-ros-node-in-sitl-for-typhoon-h480/17365>\
**Category:** PX4 Autopilot\
**Created:** [June 27, 2020, 10:33am UTC](https://discuss.px4.io/t/controlling-gimbal-with-ros-node-in-sitl-for-typhoon-h480/17365 "2020-06-27T10:33:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jaroan](https://discuss.px4.io/user_avatar/discuss.px4.io/jaroan/32/6961_2.png) [@Jaroan](https://discuss.px4.io/u/Jaroan)\
**Post date:** [June 27, 2020, 10:33am UTC](https://discuss.px4.io/t/controlling-gimbal-with-ros-node-in-sitl-for-typhoon-h480/17365/1 "2020-06-27T10:33:31Z")

</div>

Hey all,

I want to control the gimbal mounted on the hexacopter Typhoon H480 in gazebo px4 sitl using a ros node. I have already looked in [this documentation](https://discuss.px4.io/t/developing-a-custom-flight-mode-in-px4/16916) for gimbal but it doesn’t tell about controlling using a ros node. I need this for tracking a moving object with the camera on the gimbal. Any help will be appreciated.

Thank you,

---

<div class="post-metadata">

**Author:** ![Jaeyoung-Lim](https://discuss.px4.io/user_avatar/discuss.px4.io/jaeyoung-lim/32/10829_2.png) [@Jaeyoung-Lim](https://discuss.px4.io/u/Jaeyoung-Lim)\
**Post date:** [June 27, 2020, 10:14pm UTC](https://discuss.px4.io/t/controlling-gimbal-with-ros-node-in-sitl-for-typhoon-h480/17365/2 "2020-06-27T22:14:35Z")

</div>

Example: [https://github.com/Jaeyoung-Lim/mavros\_humantracking](https://github.com/Jaeyoung-Lim/mavros_humantracking)

---

<div class="post-metadata">

**Author:** ![Jaroan](https://discuss.px4.io/user_avatar/discuss.px4.io/jaroan/32/6961_2.png) [@Jaroan](https://discuss.px4.io/u/Jaroan)\
**Post date:** [June 28, 2020, 5:59pm UTC](https://discuss.px4.io/t/controlling-gimbal-with-ros-node-in-sitl-for-typhoon-h480/17365/3 "2020-06-28T17:59:08Z")

</div>

Thank you very much!

---

<div class="post-metadata">

**Author:** ![Jaroan](https://discuss.px4.io/user_avatar/discuss.px4.io/jaroan/32/6961_2.png) [@Jaroan](https://discuss.px4.io/u/Jaroan)\
**Post date:** [June 29, 2020, 6:27pm UTC](https://discuss.px4.io/t/controlling-gimbal-with-ros-node-in-sitl-for-typhoon-h480/17365/4 "2020-06-29T18:27:24Z")

</div>

@Jaeyoung-Lim I went through the example and it is wonderful. I am able to control a single vehicle Typhoon H480 hexacopter’s mounts using the given topic.  
I wanted to use the gimbal mechanism on a custom multirotor design and use the gimbal from Typhoon H480’s sdf file following the previous discussion linked below:

> [@\[SITL\] Add gimbal and RGB camera to IRIS for Gazebo](https://discuss.px4.io/t/sitl-add-gimbal-and-rgb-camera-to-iris-for-gazebo/16587/3):
>
> Thank you @Jaeyoung-Lim, very interesting work. Correct me if I’m wrong, but as far as i’ve seen I have to add, from the [typhoon\_h480 model](https://github.com/PX4/sitl_gazebo/blob/fc6aa3e3629e08756c18dd8865d3f025fdfa2f67/models/typhoon_h480/typhoon_h480.sdf), the following set of lines: [L152-205](https://github.com/PX4/sitl_gazebo/blob/fc6aa3e3629e08756c18dd8865d3f025fdfa2f67/models/typhoon_h480/typhoon_h480.sdf#L152) (gimbal link), [L330-463](https://github.com/PX4/sitl_gazebo/blob/fc6aa3e3629e08756c18dd8865d3f025fdfa2f67/models/typhoon_h480/typhoon_h480.sdf#L330) (camera link + plugin), [L1492-1522](https://github.com/PX4/sitl_gazebo/blob/fc6aa3e3629e08756c18dd8865d3f025fdfa2f67/models/typhoon_h480/typhoon_h480.sdf#L1492) (gimbal’s mavlink channels), and [L1574-1618](https://github.com/PX4/sitl_gazebo/blob/fc6aa3e3629e08756c18dd8865d3f025fdfa2f67/models/typhoon_h480/typhoon_h480.sdf#L1574) (gimbal controller) to the Iris model, but using the gazebo\_ros\_camera as it says that the gstreamer version requieres more CPU power. The only issue I’m facing is that one file is in sdf format and the other i…

However, for multiple vehicles, I wanted help in how to configure the mavlink interface plugin: [https://github.com/PX4/sitl\_gazebo/blob/master/models/typhoon\_h480/typhoon\_h480.sdf#L1351](https://github.com/PX4/sitl_gazebo/blob/master/models/typhoon_h480/typhoon_h480.sdf#L1351)  
to be able to interface with multiple vehicles? I am thankful for any guidance.

---

<div class="post-metadata">

**Author:** ![citrusboy1997](https://discuss.px4.io/user_avatar/discuss.px4.io/citrusboy1997/32/6927_2.png) [@citrusboy1997](https://discuss.px4.io/u/citrusboy1997)\
**Post date:** [August 30, 2020, 9:42am UTC](https://discuss.px4.io/t/controlling-gimbal-with-ros-node-in-sitl-for-typhoon-h480/17365/5 "2020-08-30T09:42:44Z")

</div>

Hi, I am also working with adding a gimbal to a custom vehicle. According to the example of typhoon\_h480, I created a copy of 1030\_plane and and a copy of 6011\_typhoon.post in /Firmware/ROMFS/px4fmu\_common/init.d-posix. Then I created a copy of plane directroy in /Firmware/Tools/sitl\_gazebo/models with adding H480’s gimbal parts(link and plugins) to the plane’s sdf document. I can control the gimbal on H480 with ros message /mavros/mount\_control/command but it doesn’t work on my own vehicle. Is there something I missed?

---

<div class="post-metadata">

**Author:** ![Jaroan](https://discuss.px4.io/user_avatar/discuss.px4.io/jaroan/32/6961_2.png) [@Jaroan](https://discuss.px4.io/u/Jaroan)\
**Post date:** [September 4, 2020, 6:43am UTC](https://discuss.px4.io/t/controlling-gimbal-with-ros-node-in-sitl-for-typhoon-h480/17365/6 "2020-09-04T06:43:28Z")

</div>

Hi @citrusboy1997 Maybe the plugins aren’t connected/being called appropriately? I am using them on the Typhoon model itself. If you detect the problem anytime please let me know as well.

---

<div class="post-metadata">

**Author:** ![citrusboy1997](https://discuss.px4.io/user_avatar/discuss.px4.io/citrusboy1997/32/6927_2.png) [@citrusboy1997](https://discuss.px4.io/u/citrusboy1997)\
**Post date:** [September 18, 2020, 10:38am UTC](https://discuss.px4.io/t/controlling-gimbal-with-ros-node-in-sitl-for-typhoon-h480/17365/7 "2020-09-18T10:38:30Z")

</div>

Hi, I just figured it out [how to add a gimbal to iris](https://discuss.px4.io/t/add-a-gimbal-to-iris-in-gazebo/18638), but it still doesn’t work with my custom fw model.
