PX4仿真出现报错:raise OsNotDetected(“Could not detect OS, tried %s“ % attempted)rospkg.os_detect.OsNotDet

1.问题

在执行PX4程序时,GAZEBO界面中没有生成无人机,终端出现下列报错(这部分报错是常规的字体颜色,所以很容易忽略):

raise OsNotDetected("Could not detect OS, tried %s" % attempted)
rospkg.os_detect.OsNotDetected: Could not detect OS, tried ['zorin', 'windows', 'nixos', 'clearlinux', 'ubuntu', 'slackware', 'rocky', 'rhel', 'qnx', 'pop', 'osx', 'sailfishos', 'tizen', 'oracle', 'opensuse', 'opensuse', 'opensuse', 'opensuse', 'opensuse', 'openembedded', 'neon', 'mx', 'mint', 'linaro', 'gentoo', 'funtoo', 'freebsd', 'fedora', 'elementary', 'elementary', 'debian', 'cygwin', 'euleros', 'centos', 'manjaro', 'buildroot', 'arch', 'amazon', 'alpine', 'almalinux']

还会有一串红色的报错:

[vehicle_spawn_melodic_19724_6703108910889243421-5] process has died [pid 19785, exit code 1, cmd /opt/ros/melodic/lib/gazebo_ros/spawn_model -sdf -file /home/oyy/Prometheus/Simulator/gazebo_simulator/amov_models/p450/p450.sdf -model p450 -x 0.0 -y 0.0 -z 0.2 -R 0.0 -P 0.0 -Y 0.0 __name:=vehicle_spawn_melodic_19724_6703108910889243421 __log:=/home/oyy/.ros/log/ef2c26a8-2d79-11ef-abd6-10f60a777545/vehicle_spawn_melodic_19724_6703108910889243421-5.log].
log file: /home/oyy/.ros/log/ef2c26a8-2d79-11ef-abd6-10f60a777545/vehicle_spawn_melodic_19724_6703108910889243421-5*.log

2.解决办法

关闭程序,在终端中执行下列指令:

sudo gedit /etc/lsb-release

查看文档信息是否如下所示:

DISTRIB_ID=Kylin
DISTRIB_RELEASE=V10
DISTRIB_CODENAME=kylin
DISTRIB_DESCRIPTION="Kylin V10 SP1"
DISTRIB_KYLIN_RELEASE=V10
DISTRIB_VERSION_TYPE=enterprise
DISTRIB_VERSION_MODE=normal

这是由于最近安装的一些.deb是来自于kylin的,比如微信。导致改变了里面原来的信息,现在重新修改回去如下(我的系统为Ubuntu18.04):

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.6 LTS"

执行完毕后重启电脑即可

  • 8
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Y程序源

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值