SITL Building issues

#1

Hello,

I’m having some issues with the SITL simulation. I’m not sure how I broke it, but somehow I have. It was working previously. Without reinstalling ubuntu and starting from scratch, I’m stumped on how to fix this.

When I run this command “make px4_sitl_default gazebo” I get this message (note I killed it at the end after the real error):

sk@sk-Precision-5520:~/Firmware$ make px4_sitl_default gazebo
[2/6] Performing configure step for 'sitl_gazebo'
-- install-prefix: /usr/local
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   system
--   thread
--   timer
--   filesystem
--   chrono
--   date_time
--   atomic
-- Boost version: 1.58.0
-- Building klt_feature_tracker without catkin
-- Building OpticalFlow with OpenCV
-- catkin DISABLED
Gazebo version: 7.0
-- Using C++14 compiler
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sk/Firmware/build/px4_sitl_default/build_gazebo
[3/6] Performing build step for 'sitl_gazebo'
ninja: no work to do.
[6/6] cd /home/sk/Firmware/build/px4_sitl_default/tmp && /home/sk/Firmware/Tools/sitl_run.sh /home/sk/Firmware/build/px4_sitl_default/bin/px4 none gazebo none /home/sk/Firmware /home/sk/Firmware/build/px4_sitl_default
SITL ARGS
sitl_bin: /home/sk/Firmware/build/px4_sitl_default/bin/px4
debugger: none
program: gazebo
model: none
src_path: /home/sk/Firmware
build_path: /home/sk/Firmware/build/px4_sitl_default
empty model, setting iris as default
GAZEBO_PLUGIN_PATH :/home/sk/Firmware/build/px4_sitl_default/build_gazebo:/home/sk/Firmware/build/px4_sitl_default/build_gazebo
GAZEBO_MODEL_PATH :/home/sk/catkin_ws/src/avoidance/sim/models:/home/sk/Firmware/Tools/sitl_gazebo/models:/home/sk/Firmware/Tools/sitl_gazebo/models
LD_LIBRARY_PATH /home/sk/catkin_ws/devel/lib:/opt/ros/kinetic/lib:/opt/ros/kinetic/lib/x86_64-linux-gnu:/home/sk/Firmware/build/px4_sitl_default/build_gazebo:/home/sk/Firmware/build/px4_sitl_default/build_gazebo
Gazebo multi-robot simulator, version 7.0.0
Copyright (C) 2012-2016 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 10.3.18.229
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[0] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[1] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[2] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[3] no joint control will be performed for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:126] joint [zephyr_delta_wing::propeller_joint] not found for channel[4] no joint control for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:126] joint [zephyr_delta_wing::flap_left_joint] not found for channel[5] no joint control for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:126] joint [zephyr_delta_wing::flap_right_joint] not found for channel[6] no joint control for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[7] no joint control will be performed for this channel.
[Msg] Conecting to PX4 SITL using TCP
[Msg] Lockstep is enabled
[Msg] Speed factor set to: 1
SITL COMMAND: "/home/sk/Firmware/build/px4_sitl_default/bin/px4" "/home/sk/Firmware"/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -t "/home/sk/Firmware"/test_data
INFO  [px4] Creating symlink /home/sk/Firmware/ROMFS/px4fmu_common -> /home/sk/Firmware/build/px4_sitl_default/tmp/rootfs/etc
ERROR [px4_daemon] error binding socket
0 WARNING: setRealtimeSched failed (not run as root?)

______  __   __    ___ 
| ___ \ \ \ / /   /   |
| |_/ /  \ V /   / /| |
|  __/   /   \  / /_| |
| |     / /^\ \ \___  |
\_|     \/   \/     |_/

px4 starting.

INFO  [px4] Calling startup script: /bin/sh etc/init.d-posix/rcS 0
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
ERROR [px4_daemon] error connecting to socket
Error: no autostart file found (etc/init.d-posix/ERROR [px4_daemon] error connecting to socket_*)
ERROR [px4] Startup script returned with return value: 256
pxh> Gazebo multi-robot simulator, version 7.0.0
Copyright (C) 2012-2016 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 10.3.18.229
[Wrn] [Event.cc:87] Warning: Deleteing a connection right after creation. Make sure to save the ConnectionPtr from a Connect call

Exiting...
pxh> Shutting down
/home/sk/Firmware/Tools/sitl_run.sh: line 151: kill: (666) - No such process
ninja: build stopped: interrupted by user.
Makefile:190: recipe for target 'px4_sitl_default' failed
make: *** [px4_sitl_default] Interrupt

If I run that same command with sudo in front I have no issues. I have tried adding the user to the dialout group, however this didn’t help.

I’m not sure what I’ve managed to break. I’ve tried recloning the firmware with no success, as well as make clean too.

Any suggestions on what the issue might be would be really helpful.
Thanks!

#2

Same issue here.

For the record I’m on Ubuntu 18.04. I was messing with some files trying to add a new model but now I’m trying on a reset master and I have the same outcome as you. Using sudo works so atleast we have that.

#3

Hm, that’s odd. Can you check if you have permissions to /tmp?

#4

yap by using /tmp it just moves me to that directory so yea all good

#5

What’s the output of this?

ls -ld /tmp
#6

drwxrwxrwt 17 root root 12288 Mar 15 13:36 /tmp

#7

Ok, that’s the same that I have, so shouldn’t be the problem.

#8

Can you change this line:

to:

PX4_ERR("error connecting to socket: %s", strerror(errno));

and see what the output is?

#9

Hi, I met the same problem and I tried to let it report the problem. it showed “ERROR [px4_daemon] error connecting to socket: Permission denied”

#10

Since it’s a permission problem, can you try if it works with sudo?