< >
Home » PX4与仿真入门教程 » PX4与仿真入门教程-安装ros melodic

PX4与仿真入门教程-安装ros melodic

PX4与仿真入门教程-安装ros melodic

说明:

  • 介绍如何安装ros melodic

步骤:

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
  • 增加key
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
  • 更新软件包
sudo apt update
  • 安装的ros
sudo apt-get install ros-melodic-desktop-full
  • 添加路径到bashrc
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
  • 安装ros下gazebo9相关的包
sudo apt install ros-melodic-gazebo9*
  • 初始化rosdep
sudo apt install python-rosdep
sudo rosdep init
sudo rosdep update
  • 安装catkin编译器.
sudo apt-get install ros-melodic-catkin python-catkin-tools
  • 测试ros
roscore 
  • 效果
SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.11

NODES

auto-starting new master
process[master]: started with pid [8007]
ROS_MASTER_URI=http://ubuntu:11311/

setting /run_id to 5680b4ca-f0da-11eb-9467-000c296f2327
process[rosout-1]: started with pid [8018]
started core service [/rosout]
  • 测试运行gazebo
gazebo 
  • 效果,正常打开gazebo界面

  • 增加gazebo变量到vim ~/.basrhc

export GAZEBO_MASTER_URI=http://localhost:11345
export GAZEBO_MODEL_DATABASE_URI=
export GAZEBO_RESOURCE_PATH=/usr/share/gazebo-9:${GAZEBO_RESOURCE_PATH}
export GAZEBO_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/gazebo-9/plugins:${GAZEBO_PLUGIN_PATH}
export GAZEBO_MODEL_PATH=/usr/share/gazebo-9/models:${GAZEBO_MODEL_PATH}
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib/x86_64-linux-gnu/gazebo-9/plugins
export OGRE_RESOURCE_PATH=/usr/lib/x86_64-linux-gnu/OGRE-1.9.0
  • 修复gazebo模型一些错误
vim ~/.ignition/fuel/config.yaml
  • 变更为
#url: https://api.ignitionfuel.org
url: https://fuel.ignitionrobotics.org

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: px4与仿真入门教程