Cannot start SITL as docker ENTRYPOINT

Hello!

I am trying to create a SITL docker image with MAVROS + Arducopter SITL.

Managed to install everything successfully, but I cannot get SITL to run on startup. I have created a simple script start-ardupilot.bash:

#!/bin/bash

export PATH=$PATH:/ardupilot/Tools/autotest

cd /ardupilot/ArduCopter && sim_vehicle.py

If I try to run this as the container ENTRYPOINT by putting

ENTRYPOINT =["/bin/bash", "start-ardupilot.bash"]

in my Dockerfile the SITL startup fails with the following error:

/ardupilot/Tools/autotest/run_in_terminal_window.sh: line 54:   228 Terminated              "$cmd" $* &> "$filename" < /dev/null

However, if I start a container instance and launch a bash shell, running the script from this shell works fine.

Any ideas on what might be the issue are greatly appreciated!

Resolved by using docker run with the -t flag.

Does our documentation need fixing?

It might be helpful to point out that the simulator for some reason cannot be run as a forked process, which seems to be the actual issue here.

Starting the script with & or not using the -t flag seems to produce the same issue.

1 Like