# Add lidar on X500

**URL:** <https://discuss.px4.io/t/add-lidar-on-x500/35268>\
**Category:** PX4 Autopilot\
**Created:** [November 13, 2023, 8:59am UTC](https://discuss.px4.io/t/add-lidar-on-x500/35268 "2023-11-13T08:59:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cristian-wp](https://discuss.px4.io/user_avatar/discuss.px4.io/cristian-wp/32/6403_2.png) [@Cristian-wp](https://discuss.px4.io/u/Cristian-wp)\
**Post date:** [November 13, 2023, 8:59am UTC](https://discuss.px4.io/t/add-lidar-on-x500/35268/1 "2023-11-13T08:59:37Z")

</div>

Hello, I am planning to use Gazebo Garden to perform a ROS2 simulation with a 3D lidar on the X500 model.  
I have search some documentation about it, but I can not find any example about how to add the new sensor on the X500 sdf file.  
There is any example about it?  
Plus I have found only the lidar with GPU, on Gazebo 11 is was possible to choose between the two types. Is possible to use it without any GPU? It can work with ATI or Intel GPU or it need an NVIDEA?

---

<div class="post-metadata">

**Author:** ![Sri\_drmavan](https://discuss.px4.io/user_avatar/discuss.px4.io/sri_drmavan/32/14805_2.png) [@Sri\_drmavan](https://discuss.px4.io/u/Sri_drmavan)\
**Post date:** [November 14, 2023, 5:31am UTC](https://discuss.px4.io/t/add-lidar-on-x500/35268/2 "2023-11-14T05:31:09Z")

</div>

> - [https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&ved=2ahUKEwiHyu\_M3MKCAxXdTWwGHbR8C6YQFnoECBEQAQ&url=https%3A%2F%2Fwilselby.com%2F2019%2F05%2Fsimulating-an-ouster-os-1-lidar-sensor-in-ros-gazebo-and-rviz%2F&usg=AOvVaw0na15tPBk4AiftwgJXFczK&opi=89978449](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&ved=2ahUKEwiHyu_M3MKCAxXdTWwGHbR8C6YQFnoECBEQAQ&url=https%3A%2F%2Fwilselby.com%2F2019%2F05%2Fsimulating-an-ouster-os-1-lidar-sensor-in-ros-gazebo-and-rviz%2F&usg=AOvVaw0na15tPBk4AiftwgJXFczK&opi=89978449)
> - [GitHub - Gepetto/ouster-gazebo-simulation: Mirror of https://gepgitlab.laas.fr/gepetto/ouster-gazebo-simulation](https://github.com/Gepetto/ouster-gazebo-simulation)

Hey, you can go through the above link to check how to add lidar to x500, I have been also trying the same.

---

<div class="post-metadata">

**Author:** ![Cristian-wp](https://discuss.px4.io/user_avatar/discuss.px4.io/cristian-wp/32/6403_2.png) [@Cristian-wp](https://discuss.px4.io/u/Cristian-wp)\
**Post date:** [November 14, 2023, 8:46am UTC](https://discuss.px4.io/t/add-lidar-on-x500/35268/3 "2023-11-14T08:46:52Z")

</div>

Which version of Gazebo are you using?  
The links you sent me refer to Gazebo-Classic, not to the new Gazebo(Gz)

---

<div class="post-metadata">

**Author:** ![Sri\_drmavan](https://discuss.px4.io/user_avatar/discuss.px4.io/sri_drmavan/32/14805_2.png) [@Sri\_drmavan](https://discuss.px4.io/u/Sri_drmavan)\
**Post date:** [November 14, 2023, 5:34pm UTC](https://discuss.px4.io/t/add-lidar-on-x500/35268/4 "2023-11-14T17:34:54Z")

</div>

I have also the same setup, you can convert the files as per the gz needs.

---

<div class="post-metadata">

**Author:** ![SebastienL](https://discuss.px4.io/letter_avatar_proxy/v4/letter/s/77aa72/32.png) [@SebastienL](https://discuss.px4.io/u/SebastienL)\
**Post date:** [November 15, 2023, 10:55am UTC](https://discuss.px4.io/t/add-lidar-on-x500/35268/5 "2023-11-15T10:55:05Z")

</div>

In case you did not succeed, I work with a simulation in Gazebo Garden with a X500 + lidar. I do not masterize the techno, but if it can help (I left my comments) :

```auto
<?xml version='1.0'?>
<sdf version="1.10">
  <model name="x500_lidar"> <!-- with this the drone is right under the ground, without it is a little under the ground -->
    <include merge="true"> <!-- merge=true is necessary to make PX4 preflight check pass -->
      <uri>model://x500</uri>
    <!--add lidar-->
    <include merge="true">
      <uri>model://models/lidar_sensor.sdf</uri>
    </include>

    <joint name="lidar_joint" type="fixed">
      <parent>base_link</parent>
      <!-- without 'include merge', a new element lidar_sensor is created.
          It leads to publish /pose twice, once with the world name, and the other with the drone name.
          This make mess in the frame_id.
      -->
      <child>lidar_link</child>
    </joint>

  </model>
</sdf>

```

And the lidar\_sensor.sdf

```auto
<?xml version='1.0'?>
<sdf version="1.10">
  <model name="lidar_sensor">
    <link name="lidar_link">
      <!-- pose, collision, etc. -->
      <sensor name='gpu_lidar' type='gpu_lidar'>
        <!-- lidar conf -->
      </sensor>
    </link>
  </model>
</sdf>

```

---

<div class="post-metadata">

**Author:** ![Cristian-wp](https://discuss.px4.io/user_avatar/discuss.px4.io/cristian-wp/32/6403_2.png) [@Cristian-wp](https://discuss.px4.io/u/Cristian-wp)\
**Post date:** [November 16, 2023, 8:53am UTC](https://discuss.px4.io/t/add-lidar-on-x500/35268/6 "2023-11-16T08:53:37Z")

</div>

> [@SebastienL](#):
>
> d, I work with a simulation in Gazebo Garden with a X500 + lidar. I do not

Hi @SebastienL , thank you for sharing your sdf.  
Are you running your simulation on a PC mounting a GPU? Actually I am working on an Intel NUC that have only the integrated.

Did you manage to add a gimball and a camera also?

---

<div class="post-metadata">

**Author:** ![SebastienL](https://discuss.px4.io/letter_avatar_proxy/v4/letter/s/77aa72/32.png) [@SebastienL](https://discuss.px4.io/u/SebastienL)\
**Post date:** [November 16, 2023, 9:22am UTC](https://discuss.px4.io/t/add-lidar-on-x500/35268/7 "2023-11-16T09:22:24Z")

</div>

Yes, I have a GeForce. I did not use a camera yet, it is scheduled for 2024 (without a gimball).
