安装环境:lubuntu 14.04
安装机器:嵌入式ARM RK box
ROS版本:Jade Turtles
以下两步可选其一:
(1)加入ros ubuntu的源 sources.list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
(2)为了下载速度,在sources.list中加入国内ROS源:
deb http://ros.exbot.net/rospackage/ros/ubuntu/ trusty main
deb-src http://ros.exbot.net/rospackage/ros/ubuntu/ trusty main
Set up your keys
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
更新源:
sudo apt-get update
安装桌面版:
sudo apt-get install ros-jade-desktop
我这边full版本安装一直提示找不到包。
Initialize rosdep
Before you can use ROS, you will need to initialize rosdep. rosdep enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS.
sudo rosdep init
rosdep update
Environment setup
It’s convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched:
echo "source /opt/ros/jade/setup.bash" >> ~/.bashrc
source ~/.bashrc
If you have more than one ROS distribution installed, ~/.bashrc must only source the setup.bash for the version you are currently using.
If you just want to change the environment of your current shell, you can type:
source /opt/ros/jade/setup.bash
这些安装成功后,可以在source。list中去掉国内源,在执行一边
apt-get update
就可以进行下一步:
sudo apt-get install python-rosinstall
到这里ROS的初步环境算是搭建完成了,接下来跑个例子试试看效果。
测试ROS的例程
安装ROS成功后,在Beginner Tutorials中有一个简单的示例程序.
a、在Terminal中输入下诉命令。该命令是初始化ROS环境,全局参数,以及每个节点注册等工作。
roscore
b、再打开一个Terminal,输入命令。开启一个小乌龟界面。
$ rosrun turtlesim turtlesim_node
c、再打开一个Terminal,输入命令。接受键盘输入,控制小乌龟移动。
$ rosrun turtlesim turtle_teleop_key
d、选中最后打开的Terminal,键盘按下上下左右按键,可看到控制小乌龟移动。如下图所示
e、再打开一个Terminal,输入下诉命令,可以看到当前ROS Nodes 以及Topic等图形展示。
$ rosrun rqt_graph rqt_graph