ROS1(20.04 noetic) + PX4 + AirSim

博客地址:https://www.cnblogs.com/zylyehuo/
参考视频: 保姆级教程~手把手教你实现 ROS2 + PX4 + AirSim 联动
博主使用的版本配置如下:

  • ROS: 20.04 noetic 【echo $ROS_DISTRO】
  • PX4: v1.13.2 【git describe --tags】
  • AirSim: 1.7.0 【找到\Unreal\Plugins\AirSim这个目录,进入后,打开AirSim.uplugin文件查看版本】

安装 ROS

  • 20.04 noetic

参考链接: 小鱼的一键安装系列

bash 复制代码
wget http://fishros.com/install -O fishros && . fishros

PX4 开发环境搭建

  • MAVROS + QGC + PX4

参考链接: PX4 仿真环境开发整理
参考链接: Linux系统 ubuntu20.04 无人机 PX4 开发环境搭建
遇到报错参考链接: make px4_sitl_default gazebo出错
遇到报错参考链接: Gazebo终端显示[Err] [InsertModelWidget.cc:403] Missing model.config for model
遇到报错参考链接: px4 运行mavros仿真

AirSim 仿真平台搭建

  • UE4 + AirSim

参考链接: 在Ubuntu系统中搭建Unreal4和AirSim环境

使用Airsim的ros包

参考链接: ubuntu20.04下载和使用Airsim的ros包
遇到报错参考链接: 解决Ubuntu系统下ROS包找不到问题:环境配置与路径检查详解

AirSim 配置文件修改

settings.json

json 复制代码
{
    "SettingsVersion": 1.2,
    "SimMode": "Multirotor",
    "ClockType": "SteppableClock",
    "Vehicles": {
        "PX4": {
            "VehicleType": "PX4Multirotor",
            "UseSerial": false,
            "LockStep": true,
            "UseTcp": true,
            "TcpPort": 4560,
            "ControlPortLocal": 14030,
            "ControlPortRemote": 14280,
            "ControlIp": "remote",
            "LocalHostIp": "192.168.1.5",
            "Cameras": {
                "CameraDepth": {
                    "CaptureSettings": [
                        {
                        "ImageType": 2,
                        "Width": 800,
                        "Height": 600,
                        "FOV_Degrees": 120,
                        "AutoExposureSpeed": 100,
                        "AutoExposureBias": 0,
                        "AutoExposureMaxBrightness": 0.64,
                        "AutoExposureMinBrightness": 0.03,
                        "MotionBlurAmount": 0,
                        "TargetGamma": 1.0,
                        "ProjectionMode": "",
                        "OrthoWidth": 5.12
                        }
                    ],
                    "NoiseSettings": [
                        {
                        "Enabled": false,
                        "ImageType": 0,

                        "RandContrib": 0.2,
                        "RandSpeed": 100000.0,
                        "RandSize": 500.0,
                        "RandDensity": 2,

                        "HorzWaveContrib":0.03,
                        "HorzWaveStrength": 0.08,
                        "HorzWaveVertSize": 1.0,
                        "HorzWaveScreenSize": 1.0,

                        "HorzNoiseLinesContrib": 1.0,
                        "HorzNoiseLinesDensityY": 0.01,
                        "HorzNoiseLinesDensityXY": 0.5,

                        "HorzDistortionContrib": 1.0,
                        "HorzDistortionStrength": 0.002
                        }
                    ],
                    "Gimbal": {
                        "Stabilization": 0,
                        "Pitch": 0, "Roll": 0, "Yaw": 0
                    },
                    "X": 0, "Y": 0, "Z": -1,
                    "Pitch": 0, "Roll": 0, "Yaw": 0,
                    "UnrealEngine": {
                        "PixelFormatOverride": [
                            {
                                "ImageType": 0,
                                "PixelFormat": 0
                            }
                        ]
                    }
                },
                "CameraImage": {
                    "CaptureSettings": [
                        {
                        "ImageType": 0,
                        "Width": 800,
                        "Height": 600,
                        "FOV_Degrees": 120,
                        "AutoExposureSpeed": 100,
                        "AutoExposureBias": 0,
                        "AutoExposureMaxBrightness": 0.64,
                        "AutoExposureMinBrightness": 0.03,
                        "MotionBlurAmount": 0,
                        "TargetGamma": 1.0,
                        "ProjectionMode": "",
                        "OrthoWidth": 5.12
                        }
                    ],
                    "X": 0, "Y": 0, "Z": -1,
                    "Pitch": 0, "Roll": 0, "Yaw": 0
                }
            },
            "Sensors":{
                "Magnetometer": {
                    "SensorType": 4,
                    "Enabled": true
                },
                "Barometer":{
                    "SensorType": 1,
                    "Enabled": true,
                    "PressureFactorSigma": 0.0001825
                },
                "Imu": {
                    "SensorType": 2,
                    "Enabled" : true,
                    "AngularRandomWalk": 0.3,
                    "GyroBiasStabilityTau": 500,
                    "GyroBiasStability": 4.6,
                    "VelocityRandomWalk": 0.24,
                    "AccelBiasStabilityTau": 800,
                    "AccelBiasStability": 36
                },
                "Gps": {
                    "SensorType": 3,
                    "Enabled" : true,
                    "EphTimeConstant": 0.9,
                    "EpvTimeConstant": 0.9,
                    "EphInitial": 25,
                    "EpvInitial": 25,
                    "EphFinal": 0.1,
                    "EpvFinal": 0.1,
                    "EphMin3d": 3,
                    "EphMin2d": 4,
                    "UpdateLatency": 0.2,
                    "UpdateFrequency": 50,
                    "StartupDelay": 1
                },
                "Lidar": {
                    "SensorType": 6,
                    "Enabled": true,
                    "NumberOfChannels": 16,
                    "RotationsPerSecond": 10,
                    "PointsPerSecond": 100000,
                    "X": 0, "Y": 0, "Z": -1,
                    "Roll": 0, "Pitch": 0, "Yaw": 0,
                    "VerticalFOVUpper": 10,
                    "VerticalFOVLower": -10,
                    "HorizontalFOVStart": -20,
                    "HorizontalFOVEnd": 20,
                    "DrawDebugPoints": true,
                    "DataFrame": "SensorLocalFrame"
                },
                "DistanceDown": {
                    "SensorType": 5,
                    "Enabled" : true,
                    "MinDistance": 0.1,
                    "MaxDistance": 40,
                    "X": 0, "Y": 0, "Z": -0.5,
                    "Yaw": 0, "Pitch": -90, "Roll": 0,
                    "DrawDebugPoints": true,
                    "ExternalController": true
                }
            },
            "Parameters": {
                "NAV_RCL_ACT": 0,
                "NAV_DLL_ACT": 0,
                "COM_OBS_AVOID": 0
            }
        }
    }
}

安装 Micro-XRCE-DDS-Agent

参考链接: Installing the Agent standalone

  • 安装指令
bash 复制代码
$ git clone https://github.com/eProsima/Micro-XRCE-DDS-Client.git

$ cd Micro-XRCE-DDS-Client

$ mkdir build && cd build

$ cmake ..

$ make -j8

$ sudo make install

$ sudo ldconfig /usr/local/lib/

$ MicroXRCEAgent --help
相关推荐
炸裂狸花猫14 天前
开源CI&CD工具-Drone
ci/cd·云原生·容器·kubernetes·开源·drone
暮色念了红尘14 天前
Ros1 Noetic(本地)和Ros2 Humble(docker)之间相互通信及设置初始位姿
docker·容器·ros·humble·noetic·ros1_bridge
Mr.Winter`17 天前
无人船 | 图解基于MPC控制的路径跟踪算法(以全驱动无人艇WAMV为例)
人工智能·算法·机器人·自动驾驶·ros·路径规划
不懂音乐的欣赏者19 天前
Windows 下 ROS/ROS2 开发环境最优解:WSL 比直接安装、虚拟机、双系统更优雅!
linux·windows·ubuntu·ros·wsl·ros2·双系统
Mr.Winter`24 天前
自动驾驶运动规划 | 基于自行车模型的运动学模型和横向动力学模型详细推导图解
人工智能·机器人·自动驾驶·ros
Tipriest_25 天前
自定义ROS topic 的常用消息格式及类型
ros·msg
kalvin_y_liu1 个月前
Lumi 具神智能机器人 SDK说明和ACT算法中的学习与推理
人工智能·ai·ros
lihongli0001 个月前
ros中的Navigation导航系统
自动驾驶·ros
lihongli0001 个月前
ROS与Qt结合开发CAN控制界面(发布自定义的truck_send_can1消息)
开发语言·qt·ros
酌量1 个月前
从 ROS 订阅视频话题到本地可视化与 RTMP 推流全流程实战
经验分享·笔记·ffmpeg·音视频·ros