Giter Site home page Giter Site logo

px4-containers's Introduction

PX4 Containers

Contains Dockerfiles for Docker containers to build and test PX4, with and without ROS and ROS2.

License: according to LICENSE in the root directory of the PX4 Firmware repository.

Build Status

Container Hierarchy

Running

If you like to run the container and use the Firmware source from outside of the container, use the following command and specify the appropriate volume mapping.

docker run -it --rm \
    -v <local_src>:/home/user/Firmware:rw \
    -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
    -e DISPLAY=${DISPLAY} \
    -e LOCAL_USER_ID="$(id -u)" \
    --name=container_name px4io/px4-dev-simulation-bionic /bin/bash

Or use docker_run.sh.

Building

cd docker
docker build -t px4io/px4-dev-ros-melodic -f Dockerfile_ros-melodic .

or:

cd docker
make px4-dev-ros-melodic

px4-containers's People

Contributors

andreasantener avatar bkueng avatar coderkalyan avatar dagar avatar dependabot[bot] avatar eyeam3 avatar hamishwillee avatar hxdnshx avatar jaeyoung-lim avatar jemoster avatar jlecoeur avatar johannesbrand avatar julianoes avatar lamping7 avatar lorenzmeier avatar maetugr avatar martinlowinski avatar mayanez avatar mcharleb avatar mrivi avatar mrpollo avatar nicolaerosia avatar petervdperk-nxp avatar salimterryli avatar saosebastiao avatar tfoote avatar thomasdebrunner avatar thomasgubler avatar tprasadtp avatar tsc21 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

px4-containers's Issues

Structuring Docker containers

@dagar @julianoes @LorenzMeier the container hierarchy topic. My suggestion:

  • base (determines latest supported OS plus base apps, 'make posix' and jMAVSim)
    • nuttx
    • snappy
    • raspberry
    • gazebo
    • gazebo-ros

Furthermore I'd suggest once we have it setup we do a one-off build with a 14.04 base (tag the images) and then switch to 16.04. The same with ROS Jade and Gazebo 6, then switch to Kinetic and Gazebo 7. If we're really crazy later we can start generating the Docker files from a matrix to support various envs but I don't think it's worth it anytime soon.

Questions

  • do we need to separate Snappy/RPI toolchains from Dev?
  • do we need SITL/ROS on top of the other toolchain containers or could we have them just inherit from base?

Inaccurate Documentation

Hello,

I was following the instructions in this link. Looking at this table my understanding is that "px4-dev-ros" can do everything "px4-dev-nuttx" does, plus extra ROS and simulation applications, but it is not the case. "px4-dev-ros" doesn't include arm tool-chain and nuttx environment setup.

I am new to PX4 and Docker, so please forgive me, if this is a false alarm or this git repository is not the right place.

Thanks,
Ahmad

Protobuf version issues in latest px4-dev-simulation build

Hi,

It seems the latest px4-dev-simulation image in Docker Hub contains a custom build of protobuf installed in /usr/local. This causes the Firmware (concretely sitl_gazebo) build to fail, since gazebo messages are generated with a different version of protobuf (the one in the ubuntu repository).

This is the output of pulling this image and showing the contents of /usr/local in the container:

$ docker run -it px4io/px4-dev-simulation:latest /bin/bash
Unable to find image 'px4io/px4-dev-simulation:latest' locally
latest: Pulling from px4io/px4-dev-simulation
50aff78429b1: Already exists 
f6d82e297bce: Already exists 
275abb2c8a6f: Already exists 
9f15a39356d6: Already exists 
fc0342a94c89: Already exists 
cc216fcc1d2b: Pull complete 
cc9528aeebd2: Pull complete 
c9df7377b2b3: Pull complete 
b0391a942697: Pull complete 
Digest: sha256:75b6da223d372325a336e2f8fcc3b44bcdb51a1216d4b9d2b6a5b72016d4ac12
Status: Downloaded newer image for px4io/px4-dev-simulation:latest
Starting with UID : 9001
user@751f7fa9d4be:/$ ls /usr/local/include/
capstone  gmock  google  gtest  re2
user@751f7fa9d4be:/$ ls /usr/local/include/google/
protobuf

If I build the px4-dev-simulation image manually from its Dockerfile everything is fine. Nothing goes to /usr/local and I can build the Firmware and sitl_gazebo. Moreover, it seems that the docker image tagged 2017-12-08 is also fine, and that custom version of protobuf is not installed.

This is the output generated if I build manually the latest image or pull the 2017-12-08 tag from Docker Hub:

$ docker run -it px4io/px4-dev-simulation:2017-12-08 /bin/bash
Unable to find image 'px4io/px4-dev-simulation:2017-12-08' locally
2017-12-08: Pulling from px4io/px4-dev-simulation
660c48dd555d: Already exists 
4c7380416e78: Already exists 
421e436b5f80: Already exists 
e4ce6c3651b3: Already exists 
be588e74bd34: Already exists 
2bc59ce98daa: Pull complete 
42e74bf18fff: Pull complete 
fbd23a1fa1d0: Pull complete 
9a35517cad60: Pull complete 
Digest: sha256:bcab67bc24f94e0c64495024eee0ba4f16219e75ab5d4836d1a993119ff15671
Status: Downloaded newer image for px4io/px4-dev-simulation:2017-12-08
Starting with UID : 9001
user@2b235e7500da:/$ ll /usr/local/include/
total 8
drwxr-xr-x  2 root root 4096 Nov 14 13:48 ./
drwxr-xr-x 17 root root 4096 Dec  9 02:10 ../

Although there are no problems building the image manually, my problem comes when I try to build px4-dev-ros, which pulls px4-dev-simulation from Docker Hub and becomes unusable.

I believe these files were added with #87. However, I can also see that the make install step was removed in commit 98400b3 to keep only the bloaty binary, so I am assuming they are not necessary.

Could you update the image in Docker Hub?

bash: xhost: command not found

I am trying to run xhost + inside the container but I am getting this error.

~/src/Firmware$ sudo ./Tools/docker_run.sh 'bash'
root@9c1395be4cae:/home/yograj/src/Firmware# xhost + 
bash: xhost: command not found

And if I run the xhost before docker run I get

access control disabled, clients can connect from any host

PX4 Upload

Is it possible to upload the code within a container. Build work fine.

thanks in advance

Running PX4 containers on raspberry pi 3 caused "exec format error"

I tried to run the px4 autopilot in a container on raspberry pi 3. However, every time I tried to build it shows
standard_init_linux.go:195: exec user process caused "exec format error"
I installed docker on raspbian using the convenience script. I then followed steps described in this page. https://dev.px4.io/en/test_and_ci/docker.html

I've tried different make command, such as make posix_rpi_native, make posix_sitl_default, and make posix_sitl_default gazebo, but all gave the same results.

I thought it might be caused by the OS I'm running. So I've used raspbian stretch lite download from raspberrypi.com, two versions of Emlid image (stretch and jessie) from emlid website. But none of these works.

Below are some information that might help debug.

The output of the command is:

guessing PX4_DOCKER_REPO based on input
PX4_DOCKER_REPO: px4io/px4-dev-raspi:2017-12-30
standard_init_linux.go:195: exec user process caused "exec format error"

Running docker images it shows the correct container has been downloaded:

REPOSITORY                TAG                 IMAGE ID            CREATED             SIZE
px4io/px4-dev-base        latest              0787831f3c53        12 days ago         695MB
px4io/px4-dev-raspi       2017-12-30          67f37542d7bf        2 weeks ago         969MB
python                    2.7-slim            957faace74fa        4 weeks ago         124MB
hello-world               latest              75280d40a50b        7 weeks ago         1.69kB
px4io/px4-dev-nuttx       2017-10-23          eb7bfffbcfb0        2 months ago        1.17GB

Output of docker version:

Client:
 Version:	18.01.0-ce
 API version:	1.35
 Go version:	go1.9.2
 Git commit:	03596f5
 Built:	Wed Jan 10 20:25:15 2018
 OS/Arch:	linux/arm
 Experimental:	false
 Orchestrator:	swarm

Server:
 Engine:
  Version:	18.01.0-ce
  API version:	1.35 (minimum version 1.12)
  Go version:	go1.9.2
  Git commit:	03596f5
  Built:	Wed Jan 10 20:21:22 2018
  OS/Arch:	linux/arm
  Experimental:	false

Output of docker info:

Containers: 6
 Running: 0
 Paused: 0
 Stopped: 6
Images: 11
Server Version: 18.01.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 89623f28b87a6004d4b785663257362d1658a729
runc version: b2567b37d7b75eb4cf325b77297b140ea686ce8f
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.65-rt57-v7+
Operating System: Raspbian GNU/Linux 9 (stretch)
OSType: linux
Architecture: armv7l
CPUs: 4
Total Memory: 927.3MiB
Name: raspberrypi
ID: L2SN:3DEE:FHCX:K3SA:DMHD:3KLR:Z4TE:UB4R:GMZM:VYTW:STDS:LOPG
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: jedichen121
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No memory limit support
WARNING: No swap limit support
WARNING: No kernel memory limit support
WARNING: No oom kill disable support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support

Create specific build tests for ROS containers

  • ROS Kinetic & Melodic: catkin tools.
    Already supported build in PX4, though currently failing when used - needs to be fixed (PX4/PX4-Autopilot#9679).
  • ROS2 Ardent: ament tools.
    To test with px4_ros_com when it is made public.
  • ROS2 Bouncy: colcon tools.
    To test with px4_ros_com when it is made public.

Containers don't work in Ubuntu due to permission errors

As per PX4/PX4-Devguide#232 ...
I followed the instructions in devguide here, setting up docker in a clean Ubuntu 16.04 running on a VM (in Windows). Including post instructions to ensure I didn't have to execute docker as sudo.

I added /src dir and cloned Firmware in it. I can see that the parent above src belongs to root, and that src and below belong to my logged in user (via ls -la)

Then I tried to run the image in our docs:

xhost +
docker run -it --privileged \
-v <src_to_local_firmware>:/src/firmware/:rw \
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
-e DISPLAY=:0 \
-p 14556:14556/udp \
--name=px4_ros_sim px4io/px4-dev-ros:2017-05-31 bash

This "worked". I can log in and see /src/firmware, and the contents I have cloned. When I try to run make posix_sitl_default gazebo I get permission errors because docker can't create the build directory. The reason being that docker sets itself up as root user by default, which does not appear to have access.

If I go back to ubuntu and make access on the git tree "open" (e.g. chmod -R 7777 .) then I can build from docker and everything works. However this is a pretty bad recommendation to give users.

I have tried to send in another user via the -u flag (e.g. my current VM host user id "1000"). This does not work (user is not found). I tried the flag with the user's name too, but got told there is a missing password file. I think the problem is that the VM does not know about any users outside of itself other than root.

Any suggestions on "right way to fix". I'm hoping for instructions that don't require a user to do anything to their machine other than run a docker command.


FYI, this is the setup script:

# Install Docker CE for Ubuntu script - for Xenial 16.04 (LTS)
## https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/

##uninstall old versions
sudo apt-get remove docker docker-engine docker.io -y
##Update the apt package index:
sudo apt-get update
##Install packages to allow apt to use a repository over HTTPS:
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y
## Add Dockerโ€™s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
##Verify that the key fingerprint is 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88.
sudo apt-key fingerprint 0EBFCD88
##We're not doing any actual verification!
## Set up stable repository
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

##Update the apt package index.
sudo apt-get update
##Install the latest version of Docker CE. Any existing installation of Docker is replaced.
sudo apt-get install docker-ce -y

# Create the docker group and add your user:
sudo groupadd docker
sudo usermod -aG docker $USER

Then restarted and verified using docker run hello-world

Gazebo fails to run on bionic (18.04) while using nvidia drivers

This issue is caused by two problems.

I have tested it only with px4io/px4-dev-ros:latest

Issue:

  1. Nvidia drivers not installed in the container
  2. Nvidia version on host and in container should match exactly.

Cause:

  1. Nvidia drivers should be installed inside the container, failing to do so would result in errors like this
root@78f1b36c0806:/# gazebo --verbose
Gazebo multi-robot simulator, version 7.14.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
Gazebo multi-robot simulator, version 7.14.0
Copyright (C) 2012 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: 172.17.0.2
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
[Err] [RenderEngine.cc:749] Unable to create glx visual
[Wrn] [RenderEngine.cc:97] Unable to create X window. Rendering will be disabled
[Wrn] [RenderEngine.cc:301] Cannot initialize render engine since render path type is NONE. Ignore this warning ifrendering has been turned off on purpose.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 172.17.0.2
[Wrn] [GuiIface.cc:256] Couldn't locate specified .ini. Creating file at "/home/user/.gazebo/gui.ini"
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
[Err] [RenderEngine.cc:749] Unable to create glx visual
[Wrn] [RenderEngine.cc:97] Unable to create X window. Rendering will be disabled
[Wrn] [RenderEngine.cc:301] Cannot initialize render engine since render path type is NONE. Ignore this warning ifrendering has been turned off on purpose.
[Err] [GLWidget.cc:179] GLWidget could not create a scene. This will likely result in a blank screen.
[Err] [ModelEditor.cc:75] User camera is NULL. Non-editable models will keep their original material
  1. Even after installing the driver, Because Version of docker image on docker hub is still based on xenial. So the driver version are different in host and container it will still error out something like this
root@78f1b36c0806:/# gazebo --verbose
Gazebo multi-robot simulator, version 7.14.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
Gazebo multi-robot simulator, version 7.14.0
Copyright (C) 2012 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: 172.17.0.2
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  154 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  24
  Current serial number in output stream:  25

Perhaps include in README about this? I am not sure whether creating Dockerfile/image for every nvidia version would be reasonable? But nvidia does provide docker images may be they can be used?

Edit: #172 might help in this regard. But it still would require matching nvidia drivers on host and container.

MAVROS update

MAVROS breaks CI for attitude control test since version 0.28 (current release). Need to update once the next release is published to include mavlink/mavros#1161.

Images on Dockerhub

  • ros-kinetic image is not building (last update 14 days ago) even if a new build was triggered today (29/7) and three days ago
  • px4-dev-melodic is failing to build becase px4io/px4-dev-simulation:2019-07-26 is not found

Running Gazebo with camera plugin on headless machine

Hi guys!
I am trying to setup CI for px4 + ROS simulation in Gazebo with on-board depth camera. My platform is standalone Ubuntu 16.04 machine without monitor but with nvidia card and I use ROS Kinetic with Gazebo 7. No Docker.

First I want to run simulation over ssh connection. Basic simulation works fine, but I am having hard time getting to work depth camera. Gazebo output smth like this

(1565868372 991876482) [Err] [RenderEngine.cc:699] Can't open display
(1565868372 991904052) [Wrn] [RenderEngine.cc:97] Unable to create X window. Rendering will be disabled
(1565868372 991936077) [Wrn] [RenderEngine.cc:301] Cannot initialize render engine since render path type is NONE. Ignore this warning ifrendering has been turned off on purpose.
(1565868373 531271974) [Err] [DepthCameraSensor.cc:82] Unable to create DepthCameraSensor. Rendering is disabled.

After searching internet I found one solution
http://answers.gazebosim.org/question/14625/running-a-camera-sensor-headless/
which is to use xvbf

$ Xvfb :1 -screen 0 1600x1200x16  &
$ export DISPLAY=:1.0
$ roslaunch etc etc.launch

also I have noticed that you use the same in your docker setup
https://github.com/PX4/containers/blob/master/docker/px4-dev/scripts/entrypoint.sh

But this solution doesn't work for me, after I give such commands Gazebo fails to start with error

> $ gzserver                                                                                       
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  151 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  18
  Current serial number in output stream:  19

I think that might be somehow related to nvidia driver.

Sorry for offtopic but any suggestions would be very much appreciated.

Unmappable characters when building jMAVSim

Hi,

after setting up the px4io/px4-dev-ros docker image on a clean Ubuntu 17.04 running in a VM, I get errors that there are unmappable characters for the given encoding from the java compiler.

The container is created like this:

xhost +
docker run -it -d --privileged \
    -v /home/$USER/Firmware:/job:rw \
    -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
    -e DISPLAY=:0 \
    -p 14556:14556/udp \
    --name=px4-dev-ros px4io/px4-dev-ros /bin/bash

jMAVSim was build using make posix_sitl_default jmavsim which produces said unmappable character errors in the jMAVSim source code.

According to stackoverflow, this is an encoding issue that can be fixed by running export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8 before make. Does it make sense to configure the source code encoding in the dockerfile, e.g. via ENV?

Docker container - issue without permission errors

Hi!

I saw that you have another issue with docker containers but as I do not get any permission errors I opened another issue. I actually get to the point where gazebo opens for a brief period and then shuts down. I cannot even find the error message...

Here are my installation steps. I'm using Ununtu Xenial and followed docker's instructions for installation.

  1. create a folder inside home for the git clone of the Firmware (this might seem obvious to you but as a first time user of both docker and Px4, it was not at all obvious to me).
cd ~
mkdir docker_px4_gazebo
cd docker_px4_gazebo
git clone https://github.com/PX4/Firmware.git
  1. Get the docker part. I get around the permission issue (I think) by exiting and then entering as root.
docker run -it --privileged -v `pwd`:`pwd`:rw -v /tmp/.X11-unix:/tmp/.X11-unix:ro -e DISPLAY=:0 -p 14556:14556/udp --name=px4_gazebo px4io/px4-dev-ros:2017-05-31 bash
exit
docker exec -u 0 -it px4_gazebo bash
make posix_sitl_default gazebo

I can see the Gazebo window flash by, and it's gone.
Here is the output dockerGazebo_output.txt
Thanks for any feedback.

Coverity image broken

@dagar The image in use for Coverity in Travis is broken:

[  3%] Generating uORB topic headers
python import error:  No module named em
Required python packages not installed.
On a Debian/Ubuntu system please run:
  sudo apt-get install python-empy
  sudo pip install catkin_pkg
On MacOS please run:
  sudo pip install empy catkin_pkg
On Windows please run:
  easy_install empy catkin_pkg
make[3]: *** [src/modules/uORB/topics/actuator_armed.h] Error 1
make[2]: *** [CMakeFiles/msg_gen.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
[  3%] Building CXX object 

DockerfileSnapdragon too big for semaphoreci

The snappy build on semaphoreci was failing due to the size of the docker image. Unfortunately semaphoreci doesn't keep build history for deleted branches.

It's been deleted from the PX4 semaphore configuration for now.

docker-cache restore
docker pull julianoes/px4-snappy-2016-10-16
docker run --rm -v `pwd`:`pwd`:rw -v $SEMAPHORE_CACHE_DIR/ccache:$HOME/.ccache:rw -e CCACHE_DIR=$HOME/.ccache -e CCACHE_SLOPPINESS=time_macros -w=`pwd` --user=root -it julianoes/px4-snappy-2016-10-16 /bin/bash -c "make eagle_default"

FYI @julianoes @mcharleb

matplotlib version problem

We're blindly upgrading packages with pip install --upgrade. I'm not particularly happy with this, but because versions change without testing, but it also helps us find problems like the current one.

With the current tag of the ros-melodic image we have the build failing with:

Downloading https://files.pythonhosted.org/packages/51/fe/84ab101f8ab543d89b6a128326f62adcdafd2781ab8362a737e6ce78eea7/matplotlib-3.1.0.tar.gz (37.2MB)
Complete output from command python setup.py egg_info:
Beginning with Matplotlib 3.1, Python 3.6 or above is required.

I'm not sure why we have the --upgrade flag specified. The PR that introduced this has no motivation for it. We have a couple options to fix this. #122. Possibly:

  1. remove --upgrade
  2. make a requirements.txt to lock down what we know works

libGL error: No matching fbConfigs or visuals found when running make px4_sitl gazebo

Hi, trying to use the px4io/px4-dev-ros-melodic container to simulate a quad-copter with the following input:

make px4_sitl gazebo

I get the following output:

...
empty world, setting empty.world as default
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error of failed request: GLXBadContext
Major opcode of failed request: 151 (GLX)
Minor opcode of failed request: 6 (X_GLXIsDirect)
Serial number of failed request: 38
Current serial number in output stream: 37

I was running the container with the command described in the README

docker run -it --rm
-v <local_src>:/home/user/Firmware:rw
-v /tmp/.X11-unix:/tmp/.X11-unix:ro
-e DISPLAY=${DISPLAY}
-e LOCAL_USER_ID="$(id -u)"
--name=container_name px4io/px4-dev-ros-melodic/bin/bash

I'm using nvdia-driver-440 on my machine. Am i missing something?

Default ccache directory is owned by root

Prevents compilation as normal user.
Having to specify -e CCACHE_DIR=${HOME}/.ccache \ doesn't make sense to me. @dagar is it just owned by root because everything gets installed by root during the container build?

px4io/px4-dev-ros-kinetic catkin build failed

  • pull docker image
    docker pull px4io/px4-dev-ros-kinetic

  • create container

docker run -it --privileged \
    -v /home/a:/root/ros_dev:rw \
    -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
    -e DISPLAY=$DISPLAY \
    --name=container_name px4io/px4-dev-ros-kinetic /bin/bash
  • login to container
    docker run -it --user root dev_ros_kinetic

  • create ros package through catkin
    catkin_create_pkg beginer std_msgs --rosdistro Kinetic

  • build
    catkin build

  • error is

root@48ad1e172536:/catkin_ws# catkin build
-----------------------------------------------
Profile:                     default
Extending:                   None
Workspace:                   /catkin_ws
-----------------------------------------------
Source Space:       [exists] /catkin_ws/src
Log Space:          [exists] /catkin_ws/logs
Build Space:        [exists] /catkin_ws/build
Devel Space:        [exists] /catkin_ws/devel
Install Space:      [unused] /catkin_ws/install
DESTDIR:            [unused] None
-----------------------------------------------
Devel Space Layout:          linked
Install Space Layout:        None
-----------------------------------------------
Additional CMake Args:       None
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
-----------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
-----------------------------------------------


-----------------------------------------------
WARNING: Your workspace is not extending any
other result space, but it is set to use a
`linked` devel space layout. This requires the
`catkin` CMake package in your source space in
order to be built.
-----------------------------------------------

[build] Found '1' packages in 0.0 seconds.                                                                         
[build] Package table is up to date.                                                                               
Warning: generated devel space setup files have been deleted.
Starting  >>> catkin_tools_prebuild                                                                                
___________________________________________________________________________________________________________________
Errors     << catkin_tools_prebuild:cmake /catkin_ws/logs/catkin_tools_prebuild/build.cmake.002.log                
CMake Error at /catkin_ws/build/catkin_tools_prebuild/CMakeLists.txt:12 (message):
  The catkin CMake module was not found, but it is required to build a linked
  workspace.  To resolve this, please do one of the following, and try
  building again.



   1. Source the setup.sh file from an existing catkin workspace:
      source SETUP_FILE



   2. Extend another catkin workspace's result (install or devel) space:
      catkin config --extend RESULT_SPACE



   3. Set `catkin_DIR` to the directory containing `catkin-config.cmake`:
      catkin config --cmake-args -Dcatkin_DIR=CATKIN_CMAKE_CONFIG_PATH



   4. Add the catkin source package to your workspace's source space:
      cd SOURCE_SPACE && git clone https://github.com/ros/catkin.git


cd /catkin_ws/build/catkin_tools_prebuild; catkin build --get-env catkin_tools_prebuild | catkin env -si  /usr/bin/cmake /catkin_ws/build/catkin_tools_prebuild --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/catkin_ws/devel/.private/catkin_tools_prebuild -DCMAKE_INSTALL_PREFIX=/catkin_ws/install; cd -
...................................................................................................................
Failed     << catkin_tools_prebuild:cmake          [ Exited with code 1 ]                                          
Failed    <<< catkin_tools_prebuild                [ 0.0 seconds ]                                                 
Abandoned <<< beginer                              [ Unrelated job failed ]                                        
[build] Summary: 0 of 2 packages succeeded.                                                                        
[build]   Ignored:   None.                                                                                         
[build]   Warnings:  None.                                                                                         
[build]   Abandoned: 1 packages were abandoned.                                                                    
[build]   Failed:    1 packages failed.                                                                            
[build] Runtime: 0.0 seconds total.    

PX4Flow build is broken in latest px4io/px4-dev-ros image

PX4Flow build is broken in the latest px4io/px4-dev-ros image. Here's the output of make :

user@82f375162c2c:/src/px4flow/Flow$ make px4flow-v2_default
Checked mavlink submodule, correct version found
%%%%
%%%% Building px4flow-v2_default on baremetal in /src/px4flow/Flow/Build/px4flow-v2_default.build/
%%%%
make[1]: Entering directory '/src/px4flow/Flow/Build/px4flow-v2_default.build'
% PX4_BASE = /src/px4flow/Flow/
% GIT_DESC = 1bb4e50d305ebd952851e8cbea4b3312e9744360
% BUILD_URI = "localhost"
% CONFIG = px4flow-v2_default
% PX4_TARGET_OS = baremetal
make[1]: arm-none-eabi-gcc: Command not found
make[1]: arm-none-eabi-gcc: Command not found
/src/px4flow/Flow/makefiles/baremetal/toolchain_gnu-arm-eabi.mk:57: *** Unsupported version of arm-none-eabi-gcc, found: instead of one in: 4.7.4 4.7.5 4.7.6 4.8.4 4.9.3 5.4.1. Stop.
make[1]: Leaving directory '/src/px4flow/Flow/Build/px4flow-v2_default.build'
/src/px4flow/Flow/makefiles/baremetal/firmware_baremetal.mk:30: recipe for target '/src/px4flow/Flow/Build/px4flow-v2_default.build/firmware.px4' failed
make: *** [/src/px4flow/Flow/Build/px4flow-v2_default.build/firmware.px4] Error 2

I tried to pull the docker image that @Alexey-Kamenev referenced in this issue #40 and was able to build the px4flow firmware successfully.
docker pull px4io/px4-dev-ros@sha256:b9c4f3c4c1d021db42815a9eecd8e65fc72008033eec83cd7608e6c6c43601d7

Containers organization

Looking at the px4-dev-* images, I feels like they quickly install many things, which makes them difficult to use as a basis for new images.

For instance, px4-dev-base installs packages such as gcc or vim-common or astyle, that I don't necessarily need in all the px4 containers I can imagine (e.g. mavros). Same thing for px4-dev-simulation which installs dronekit-python and pymavlink. More than that, exposing ports 14556 and 14557 should not be in the base image.

To me, this shows more a philosophy of "making a container in which a developer can work instead of installing everything on his host" than microservices. Both are useful, but different.

Thinking about modifying the hierarchy and discussing this with @dagar, I would see it more like described below. However, I don't know how those containers are used right now, so feel free to comment!

Goal of the containers

The containers are not meant to be used as a development environment. Developers can make their own image deriving from one of those if they want to develop from docker, but we don't want to make those images ourselves (which IDE would we include? QtCreator? Sublime? Vim with some plugins?). We could have an image that has most packages required to build anything from the px4 ecosystem (I call it px4-posix-dev-full), possibly.

However, the containers are meant to be used as microservices, which can be used to setup an development environment. Below are some use-cases for containers as microservices:

  • Integration on drones (e.g. px4-posix-mavros could be used directly inside the Intel Aero, or a special node deriving from px4-raspi-ros-base could be deployed on a raspberry pi).
  • Continuous integration (e.g. test a specific ros node with px4-posix-ros-gazebo and px4-posix-mavros).
  • Development environment. Imagine a developer working on a specific ROS node. He could run px4-posix-ros-gazebo and px4-posix-mavros on his machine, and then connect his node from the host. This way he doesn't have to know how to install gazebo or mavros and can concentrate on his node only.
  • Quick start guide: have a docker-compose configuration starting multiple containers in order to run a simulation, so that the new developer can familiarize with it without having to install everything on his system.

Naming conventions

  • All container names start with px4- (e.g. px4io/px4-base).
  • Using -dev- in a name means that it includes development tools (i.e. the image could be used by a developer for actual development instead of only being a microservice).

Folders organization

  • Each dockerfile is in its own directory, together with a README explaining its purpose.
  • There may be other files at the same level as the dockerfile and README, for instance resource files that need to be copied in the image.
  • There is a flat folder hierarchy between docker files (e.g. even though px4-base-posix derives from px4-base, they both have their own directory at the same level in the hierarchy).
  • We should consider having a "samples" directory with docker configurations showing how to interconnect different containers (e.g. px4-posix-ros-gazebo with px4-posix-mavros.

Containers hierarchy

  • px4-base
    • px4-base-posix
      • px4-posix-ros-core
        • px4-posix-ros-base
          • px4-posix-mavros
          • px4-posix-ros-gazebo
            • px4-posix-dev-full
      • px4-posix-sim
        • px4-posix-gazebo
        • px4-posix-jmavsim
    • px4-base-nuttx
    • px4-base-raspi

Comments

  • px4-base only contains what is used by everything in the px4 ecosystem. It might end up being exactly the same as ubuntu.
  • px4-posix-ros-core installs ros-kinetic-ros-core.
  • px4-posix-ros-base installs ros-kinetic-ros-base.
  • px4-posix-dev-full has everything a developer would need to develop on the px4. It could be used to "get started" without installing everything on the host, for instance. It is NOT meant to be used as a microservice.
  • Images meant for microservices in this repo should stay quite general. For instance, having ninja instead of make or clang instead of gcc is maybe not a general requirement. If a specific container somewhere needs them, then it can derive from one of the images of this repo and add them.

Trying to build the docker images and run gazebo simulation but fails

Hello,

So I pulled and use this docker image: px4io/px4-dev-simulation-focal:2020-04-01.

Cloned https://github.com/PX4/Firmware, checked out to v1.9.0.

Went into the firmware folder and ran:

docker run -it --privileged \
--env=LOCAL_USER_ID="$(id -u)" \
-v $(pwd):/src/firmware/:rw \
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
-e DISPLAY=:0 \
-p 14556:14556/udp \
--name=mycontainer px4io/px4-dev-simulation-focal:2020-04-01 bash

Once inside, I did: make px4_sitl_default gazebo

Long story short is doesn't build correctly. I have those errors:

FAILED: CMakeFiles/gazebo_opticalflow_plugin.dir/src/gazebo_opticalflow_plugin.cpp.o
....
FAILED: external/Stamp/sitl_gazebo/sitl_gazebo-build 
....
ninja: build stopped: subcommand failed.
...

And it stops.

I just want to run the suite px4 + gazebo in a container. How can I do that ?

JSBSim 404

Step 7/8 : RUN wget https://github.com/JSBSim-Team/jsbsim/releases/download/Linux/JSBSim-devel_1.1.0.dev1-85.bionic.amd64.deb
 ---> Running in 0ae73f121c75
--2020-11-02 07:28:00--  https://github.com/JSBSim-Team/jsbsim/releases/download/Linux/JSBSim-devel_1.1.0.dev1-85.bionic.amd64.deb
Resolving github.com (github.com)... 140.82.113.4
Connecting to github.com (github.com)|140.82.113.4|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2020-11-02 07:28:00 ERROR 404: Not Found.

The command '/bin/sh -c wget https://github.com/JSBSim-Team/jsbsim/releases/download/Linux/JSBSim-devel_1.1.0.dev1-85.bionic.amd64.deb' returned a non-zero code: 8
Makefile:85: recipe for target 'px4-dev-simulation-bionic' failed
make: *** [px4-dev-simulation-bionic] Error 8
Error: Process completed with exit code 2.

gst_camera_plugin problem on newer px4io/px4-dev-ros

I have tried to run a simulation with gst_camera_plugin based on px4io/px4-dev-ros:2019-01-17 and ended up with while building the firmware:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
GSTREAMER_LIBRARIES (ADVANCED)

After trying to install gstreamer as described in https://dev.px4.io/en/simulation/gazebo.html:

sudo apt-get install $(apt-cache --names-only search ^gstreamer1.0-* | awk '{ print $1 }' | grep -v gstreamer1.0-hybris) -y

...I got this error:

gstreamer1.0-plugins-base is already the newest version (1.14.1-1ubuntu1~ubuntu18.04.1).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 gstreamer1.0-python3-dbg-plugin-loader : Conflicts: gstreamer1.0-python3-plugin-loader but 1.14.1-1~ubuntu18.04.1 is to be installed
 gstreamer1.0-python3-plugin-loader : Conflicts: gstreamer1.0-python3-dbg-plugin-loader but 1.14.1-1~ubuntu18.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.

On the default tag of px4io/px4-dev-ros, which is px4io/px4-dev-ros:latest, I am able to run sudo apt-get install $(apt-cache --names-only search ^gstreamer1.0-* | awk '{ print $1 }' | grep -v gstreamer1.0-hybris) -y and use this plugin. I think that you have recently changed the version of Ubuntu or something different that created this problem.

I want to use newer px4io/px4-dev-ros because it's using a ros melodic instead of kinetic.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.