Docker Setup

Hello everyone,
I started working on the Docker version of the PX4 and have some questions:

A) The Container Hierarchy mentioned here means that the most right image depends on the upper left?

B) What is the local src> and what is the <container src>? Does it mean the Firmware folder?

C) Has anyone successfully made a simulation flight using the image?

So far I have downloaded the docker images :base, nuttx ,simulation. When I enter the container (I didnt use the -v flag) I can’t find anything related to the Firmware when searching the directories . I guess i have to download it from inside the container right?

I would be glad if someone who has a previous experience with the topic could help. Thanks!

There’s no Firmware in the container. I personally have the source outside and bring it into the container with --volume. The comment in the README needs some updating.

There’s a convenience script in Firmware for launching straight into the appropriate container. From the top level of the Firmware run ./Tools/ ‘make nuttx_px4fmu-v2_default’.

Yes you can run the simulation within the container, although it doesn’t have the dependencies from the GUI.

Ok I would appreciate your help: So according to the guide this should spin up the simulation container

sudo docker run -it --privileged -v /Git/Firmware:/Firmware:rw -e DISPLAY=:0 
-p 14556:14556/udp -v /tmp/.X11-unix:/tmp/.X11-unix:ro px4io/px4-dev-simulation bash

I have linked my src of the Firmware to the container. But when i go the Firware folder of the container it is empty and of course i cant run the simulation.

Now ,in my computer if I go the folder of the Firmware and type

make posix_sitl_default gazebo

The simulation starts without any problem. I guess something is wrong with the container

Thanks for your time once more I really appreciate as I am getting deeper in this whole simulation thing :slight_smile:

Are you sure that’s the correct path to your source? /Git/Firmware

well sorry about my question i had the mounting part resolved now. But a new problem occurs.

 make posix_sitl_default gazebo

gives out this error

cannot remove '/Firmware/build/posix_sitl_default/msg/Makefile': Permission denied
Makefile:147: recipe for target 'posix_sitl_default' failed
make: *** [posix_sitl_default] Error 1

Check the file ownership. Depending on how you ran docker the build artifacts (build/*) end up owned as root.

I didnt build the images from the repo. I got them through the docker hub running for ex.

docker pull px4io/px4-dev-ros

Should I build them from the source repo?

Also I don’t execute docker with sudo as I have added it to the usermod

No, that’s just fine. I was talking about the PX4 Firmware build artifacts.