I want to spawn own drone in Gazebo but I don’t know how to add it as build target, since trying to do it this way:
make px4_sitl gazebo_iris_with_4sensors ends with error:
ninja: error: unknown target 'gazebo_iris_with_4sensors'
At this moment, I have sdf file and model.config; what else is needed?
Have you added it to the list here?
I just did that and now I have some progress; now it fails with error:
______ __ __ ___
| ___ \ \ \ / / / |
| |_/ / \ V / / /| |
| __/ / \ / /_| |
| | / /^\ \ \___ |
\_| \/ \/ |_/
INFO [px4] Calling startup script: /bin/sh etc/init.d-posix/rcS 0
Error: Unknown model 'iris_with_4sensors'
Ok, you are missing the startup file in
now, since I can spawn a drone I have a question:
I know I can get distance sensor readings from
DISTANCE_SENSOR MAVLink messages, but how to get readings from multiple sensors?
You need to check how the data flows from the simulator via mavlink and then into uORB and trace the instances through. I’m not sure what you have done and what’s missing without seeing your changes.
so, I have 6 sonars (added by
<include> sonar model; pointing front, right, left, rear, up and down). The problem is, simulator seems to get their poses from sonar file, which make me confused:
r p y
sonar_front 0 1.57 0
sonar_right 0 1.57 0
sonar_rear 0 1.57 0
sonar_left 0 1.57 0
sonar_down 0 1.57 0
sonar_up 0 1.57 0
and I expected
r p y
sonar_front 0 0 3.14
sonar_right 0 0 1.57
sonar_rear 0 0 0
sonar_left 0 0 -1.57
sonar_down 0 -1.57 3.14
sonar_up 0 1.57 3.14
which are pose values in UAV SDFormat file…
edit: Displayed values are from
q_ls variable in
gazebo_sonar_plugin.cpp (converted to Euler angles) https://github.com/PX4/sitl_gazebo/blob/master/src/gazebo_sonar_plugin.cpp
edit2: moreover, DISTANCE_SENSOR messages in QGC gives me these results:
which leaves me even more confused…