ros基本板块
ros初始化
sudo rosdep init
rosdep update
source制定二进制文件 为了给系统说明可执行文件一级其他文件位置,第二条命令是为了每次加载bashrc配置,第三条是为了使配置生效
source /opt/ros/kinetic/setup.bash
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
emmm 如果你搞坏了bashrc文件
cd /etc/skel
cp .bashrc ~/ (覆盖了搞坏的文件
或者catkin_make成功之后
source devel/setup.bash
gedit ~/.bashrc
加入
source ~/catkin_ws/devel/setup.bash
安装python下载工具
只需要ros安装首次运行即可
sudo apt-get install python-rosinstall
ros 创建工作空间
注意catkin_init_workspace 是在src下,
cd ~
mkdir catkin_ws
cd catkin_ws
mkdir src
cd src
catkin_init_workspace
cd ..
catkin_make
创建工作空间报错 见错误2
ros纠误板块
错误1
bash: /home/apin/catkin_ws/devel/setup.bash: No such file or directory
解决
getdit ~/.bashrc
错误2 catkin_make报错合集
2.1 Make sure that you have installed “catkin_pkg”, it is up to date and on the PYTHONPATH. 问题分析 install文件缺失,
是python文件,结合上文中安装的python安装工具,给出以下命令: solution:
cd catkin_ws
pip install catkin_pkg
重新catkin_make 得到以下内容,得不到100%进度条,但不会报错.
2.2 Could not find the required component ‘move_base_msgs’ move_base_msgs缺失,安装即可
sudo apt-get install ros-kinetic-move-base-msgs
2.3 缺失rospkg
cd catkin_ws
pip install rospkg
错误3 roscore报错
3.1 the network is not configured properly.
解决
打开setup.sh
sudo vim /opt/ros/kinetic/setup.sh
加入下面两行
export ROS_HOSTNAME=localhost
export ROS_MASTER_URI=http://localhost:11311
使配置生效
source /opt/ros/kinetic/setup.sh