Custom SDF file not working

Hi i have created a SDFormat file with using c++ (via sdf and gazebo api). I want it to add Lidar sensor to “x500_vision”.

When i try to build the file I am getting this error:

ERROR [px4] Startup script returned with return value: 512

FAILED: src/modules/simulation/gz_bridge/CMakeFiles/gz_my_vehicle /home/../../../PX4-Autopilot/build/px4_sitl_default/src/modules/simulation/gz_bridge/CMakeFiles/gz_my_vehicle

cd /home/../../../PX4-Autopilot/build/px4_sitl_default/src/modules/simulation/gz_bridge && /usr/bin/cmake -E env PX4_SIM_MODEL=gz_my_vehicle GZ_IP=127.0.0.1 /home/../.././PX4-Autopilot/build/px4_sitl_default/bin/px4

How can i fix that ? Here is the model.sdf:
"

<?xml version="1.0" encoding="UTF-8"?>$

2 $
3 $
4 $
5 x500$
6 $
7 false$
8 <self_collide>false</self_collide>$
9 <allow_auto_disable>true</allow_auto_disable>$
10 <enable_wind>false</enable_wind>$
11 0 0 0 0 0 0$
12 $
13 0 0 0 0 0 0$
14 $
15 0 0 0 0 0 0$
16 1$
17 $
18 1$
19 0$
20 0$
21 1$
22 0$
23 1$
24 $
25 $
26 <enable_wind>false</enable_wind>$
27 $
28 0 0 0 0 0 0$
29 my_lidar$
30 <update_rate>40</update_rate>$
31 <enable_metrics>false</enable_metrics>$
32 $
33 $
34 $
35 640$
36 1$
37 <min_angle>-135</min_angle>$
38 <max_angle>135</max_angle>$
39 $
40 $
41 1$
42 <min_angle>0</min_angle>$
43 <max_angle>45</max_angle>$
44 1$
45 $
46 $
47 $
48 0.10000000000000001$
49 30$
50 0$
51 $
52 $
53 gaussian$
54 0$
55 0.01$
56 $
57 <visibility_mask>4294967295</visibility_mask>$
58 $
59 $
60 $
61 $
62 3$
63 $
64 $
65 $

"

Here is the model.config:
"
1 $
2 $
3 my_vehicle$
4 1.0$
5 model.sdf$
6 $
7 Jaeyoung Lim$
8 jalim@ethz.ch$
9 $
10 Model of the X500 with a odometry/external vision input.$
11 $

"

Here is my ROMFS/px4fmu_common/init.d-posix/airframe file:
"
1 #!/bin/sh$
2 #$
3 # @name my_vehicle$
4 # @type Quadrotor$
5 #$
6 PX4_SIM_MODEL=${PX4_SIM_MODEL:=my_vehicle}$
7 $
8 . ${R}etc/init.d-posix/airframes/4099_gz_my_vehicle$
9 $
"

I have also added my airframe to the CMakeFile.

Sorry for trashy files. Here are the files:
model.sdf
"

<?xml version="1.0" encoding="UTF-8"?> x500 false false true false 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 false 0 0 0 0 0 0 my_lidar 40 false 640 1 -135 135 1 0 45 1 0.10000000000000001 30 0 gaussian 0 0.01 4294967295 3

"
model.config:
"

<?xml version="1.0"?> my_vehicle 1.0 model.sdf Jaeyoung Lim jalim@ethz.ch Model of the X500 with a odometry/external vision input. ”

airframe file:
"
#!/bin/sh

@name my_vehicle

@type Quadrotor

PX4_SIM_MODEL=${PX4_SIM_MODEL:=my_vehicle}

. ${R}etc/init.d-posix/airframes/4099_gz_my_vehicle
"

I have handled the issue. If you have the same problem, you can reach me through this topic :slight_smile: