1.当ros在运行rosrun的时候出现如上错误。

解决方法:

sudo apt-get install rosbash

如下图:

bash: rosrun: command not found_ubuntu

2.然后再运行rosrun命令,又出现如下错误?

/usr/bin/rosrun: line 56: rospack: command not found

bash: rosrun: command not found_bash_02

那是因为ros安装的时候没有添加路径:

echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc

然后继续就可以了