- Debugging/Logging - 飞行日志分析
- Debugging/Logging - ULog文件格式
- 教程
- 教程 - 地面站
- 教程 - 编写应用程序
- 教程 - QGC的视频流
- 教程 - 远距离视频流
- 教程 - u-blox M8P RTK
- 新手上路
- 新手上路 - 初始设置
- 新手上路 - 安装工具链
- 安装工具链 - Mac OS
- 安装工具链 - Linux
- Linux - Advanced Linux
- 安装工具链 - Windows
- 新手上路 - Fast RTPS installation
- 新手上路 - 代码编译
- 新手上路 - 高级配置
- 新手上路 - 贡献& 开发者电话会议
- 贡献& 开发者电话会议 - GIT例程
- 贡献& 开发者电话会议 - Documentation
- 新手上路 - Licenses
- 概念解读
- 概念解读 - 飞行模式
- 概念解读 - 结构概述
- 概念解读 - 飞行控制栈
- 概念解读 - 中间件
- 概念解读 - 混控和执行器
- 概念解读 - PWM限制状态机
- Hardware
- Hardware - 自驾仪硬件
- 机型 - 统一的基础代码
- 机型 - 参考机型
- 机型 - 添加一个新的机型
- Data Links - SiK Radio
- Data Links - Wifi数传
- Data Links - 数传
- I2C总线 - SF1XX lidar
- 传感器和执行机构总线 - UAVCAN总线
- UAVCAN总线 - UAVCAN Bootloader
- UAVCAN总线 - UAVCAN固件升级
- UAVCAN总线 - UAVCAN配置
- UAVCAN总线 - UAVCAN 的各种笔记
- 传感器和执行机构总线 - UART
- UART - uLanding Radar
- 传感器和执行机构总线 - 设置云台控制
- 传感器和执行机构总线 - 相机触发器
- Hardware - 协同电脑
- 仿真
- 仿真 - 基本仿真
- 仿真 - Gazebo仿真
- 仿真 - HITL仿真
- 仿真 - 连接到ROS
- 仿真 - AirSim仿真
- 仿真 - 多机仿真
- 中间件及架构
- 中间件及架构 - uORB消息机制
- 中间件及架构 - MAVLink消息机制
- 中间件及架构 - 守护程序
- 中间件及架构 - 驱动框架
- 模块 & 命令
- 模块 & 命令 - 命令
- 模块 & 命令 - 通信
- 模块 & 命令 - 驱动
- 模块 & 命令 - 系统
- Robotics
- Robotics - 用Linux进行外部控制
- Robotics - ROS
- ROS - 在RPi上安装ROS
- ROS - MAVROS (ROS上的MAVLink)
- ROS - MAVROS外部控制例程
- ROS - 外部位置估计
- ROS - Gazebo Octomap
- Robotics - DroneKit
- Debugging/Logging
- Debugging/Logging - FAQ
- Debugging/Logging - 系统控制台
- Debugging/Logging - 自驾仪调试
- Debugging/Logging - Sensor/Topic Debugging
- Debugging/Logging - 仿真调试
- Debugging/Logging - System-wide Replay
- Debugging/Logging - 发送调试的值
- Debugging/Logging - Profiling
- Debugging/Logging - 日志记录
- 教程 - 光流
- 教程 - ecl EKF
- 教程 - 飞行前检查
- 教程 - 着陆检测
- 教程 - Linux系统下使用S.Bus驱动
- Advanced Topics
- Advanced Topics - 系统启动
- Advanced Topics - 参数&配置
- Advanced Topics - 参考参数
- Advanced Topics - 安装Intel RealSense R200的驱动
- Advanced Topics - 切换状态估计器
- Advanced Topics - 外部模块
- Advanced Topics - STM32 Bootloader
- 测试和持续集成
- 测试和持续集成 - 持续集成
- 测试和持续集成 - Jenkins持续集成环境
- 测试和持续集成 - 综合测试
- 测试和持续集成 - Docker容器
- 测试和持续集成 - 维护
测试和持续集成 - Docker容器
Docker containers are available that contain the complete PX4 development toolchain including Gazebo and ROS simulation:
- px4io/px4-dev: toolchain including simulation
- px4io/px4-dev-ros: toolchain including simulation and ROS (incl. MAVROS)
Pull one of the tagged assets if you’re after a container that just works, for instance px4io/px4-dev-ros:v1.0
, the latest
container is usually changing a lot.
Dockerfiles and README can be found here: https://github.com/PX4/containers/tree/master/docker/px4-dev
They are build automatically on Docker Hub: https://hub.docker.com/u/px4io/
Prerequisites
Install Docker from here https://docs.docker.com/installation/, preferably use one of the Docker-maintained package repositories to get the latest version.
Containers are currently only supported on Linux. If you don’t have Linux you can run the container inside a virtual machine, see further down for more information. Do not use boot2docker
with the default Linux image because it contains no X-Server.
Use the Docker container
The following will run the Docker container including support for X forwarding which makes the simulation GUI available from inside the container. It also maps the directory <local_src>
from your computer to <container_src>
inside the container and forwards the UDP port needed to connect QGC. Please see the Docker docs for more information on volume and network port mapping.
With the -–privileged
option it will automatically have access to the devices on your host (e.g. a joystick and GPU). If you connect/disconnect a device you have to restart the container.
# enable access to xhost from the container
xhost +
docker run -it --privileged
-v <local_src>:<container_src>:rw
-v /tmp/.X11-unix:/tmp/.X11-unix:ro
-e DISPLAY=:0
-p 14556:14556/udp
--name=container_name px4io/px4-dev bash
If everything went well you should be in a new bash shell now. Verify if everything works by running SITL for example:
cd <container_src>
make posix_sitl_default gazebo
Graphics driver issues
It’s possible that running Gazebo will result in a similar error message like the following:
libGL error: failed to load driver: swrast
In that case the native graphics driver for your host system must be installed. Download the right driver and install it inside the container. For Nvidia drivers the following command should be used (otherwise the installer will see the loaded modules from the host and refuse to proceed):
./NVIDIA-DRIVER.run -a -N --ui=none --no-kernel-module
More information on this can be found here: http://gernotklingler.com/blog/howto-get-hardware-accelerated-opengl-support-docker/
Re-enter the container
If you exit the container, your changes are left in this container. The above “docker run” command can only be used to create a new container. To get back into this container simply do:
# start the container
sudo docker start container_name
# open a new bash shell in this container
sudo docker exec -it container_name bash
If you need multiple shells connected to the container, just open a new shell and execute that last command again.
Virtual machine support
Any recent Linux distribution should work.
The following configuration is tested:
- OS X with VMWare Fusion and Ubuntu 14.04 (Docker container with GUI support on Parallels make the X-Server crash).
Memory
Use at least 4GB memory for the virtual machine.
Compilation problems
If compilation fails with errors like this:
The bug is not reproducible, so it is likely a hardware or OS problem.
c++: internal compiler error: Killed (program cc1plus)
Try disabling parallel builds.
Allow Docker Control from the VM Host
Edit /etc/defaults/docker
and add this line:
DOCKER_OPTS="${DOCKER_OPTS} -H unix:///var/run/docker.sock -H 0.0.0.0:2375"
You can then control docker from your host OS:
export DOCKER_HOST=tcp://<ip of your VM>:2375
# run some docker command to see if it works, e.g. ps
docker ps
Legacy
The ROS multiplatform containers are not maintained anymore: https://github.com/PX4/containers/tree/master/docker/ros-indigo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论