当前位置: 首页 > 工具软件 > sou > 使用案例 >

sou problem

薄兴昌
2023-12-01

PX4安装过程中遇到的问题及解决

执行make px4_sitl_default gazebo遇到的问题
问题1:No package 'gstreamer-base-1.0' found解决如下:

sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
    1

问题2:No module named 'jinja2'解决如下:

pip3 install jinja2 -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
    1

执行 roslaunch px4 mavros_posix_sitl.launch遇到的问题

    RLException: [mavros_posix_sitl.launch] is neither a launch file in package [px4] nor is [px4] a launch file name. The traceback for the exception was written to the log file

原因:缺少环境变量,在~/.bashrc文件增加以下代码,前两个source顺序能写反

source ~/catkin_ws/devel/setup.bash
source ~/PX4_Firmware/Tools/setup_gazebo.bash ~/PX4_Firmware/ ~/PX4_Firmware/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4_Firmware
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4_Firmware/Tools/sitl_gazebo
    1
    2
    3
    4

 执行rostopic echo /mavros/state若出现connected: True,则说明MAVROS与SITL通信成功。
    1

执行roslaunch px4 indoor1.launch 遇到的问题

    [ 问题1 ] RLException: while processing /home/karasi/PX4_Firmware/launch/single_vehicle_spawn_xtd.launch:Invalid tag: Cannot load command parameter [model_description]: no such command [[‘xmlstarlet’, ‘ed’, ‘-d’, ‘//plugin[@name=“mavlink_interface”]/mavlink_tcp_port’, ‘-s’, ‘//plugin[@name=“mavlink_interface”]’, ‘-t’, ‘elem’, ‘-n’, ‘mavlink_tcp_port’, ‘-v’, ‘4560’, ‘/home/karasi/PX4_Firmware/Tools/sitl_gazebo/models/iris_stereo_camera/iris_stereo_camera.sdf’]]. Param xml is The traceback for the exception was written to the log file

原因:依赖没装全,解决如下

 sudo apt install xmlstarlet
    1

    [ 问题2 ] Traceback (most recent call last): File “multirotor_communication.py”, line 8, in
    from pyquaternion import Quaternion ImportError: No module named pyquaternion

原因:python程序在执行的时候缺少py库造成的,若python3安装完,依旧存在缺少问题,说明这里要给python2装。
当电脑同时安装了 python 2.x 和 python3.x时,给Python2.x环境安装包要用pip命令,给python3.x环境安装包要用pip3命令。安装命令如下:

sudo pip3 install pyquaternion
sudo pip install pyquaternion
    1
    2

    [ 问题3 ] [gazebo-2] process has died [pid 24460, exit code 255, cmd /opt/ros/melodic/lib/gazebo_ros/gzserver -e ode
    /home/karasi/PX4_Firmware/Tools/sitl_gazebo/worlds/indoor1.world __name:=gazebo __log:=/home/karasi/.ros/log/7812be94-7370-11ec-9bb2-98541b170070/gazebo-2.log]. log file: /home/karasi/.ros/log/7812be94-7370-11ec-9bb2-98541b170070/gazebo-2*.log

原因: 怀疑是gazebo进程的问题,可以试一下消灭gazebo所有进程,再重新roslaunch

killall -9 gzclient
killall -9 gzserver

————————————————
版权声明:本文为CSDN博主「karasi_」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_45574260/article/details/122442832

 类似资料:

相关阅读

相关文章

相关问答