Let's install turtlesim packages(Ros 仿真包安装)

来源:互联网 发布:网络动漫黑名单第二批 编辑:程序博客网 时间:2024/04/29 18:16

1、In this learning session we will use turtlesim to simulate an actual robot. It will teach us necessary parts of a ROS project in a better way. To install the turtlesim simulator you need to give the command(安装仿真器)

 Sudo apt-get install ros-indigo-turtlesim 

安装不同的Ros系统用indigo替换成相应的名字,例如:kinetic2、After installing the turtlesim package we will initialize rosdep which is a onetime initialization step. If the ROS works correctly we don’t need to initialize it again. The command will be
 sudo rosdep init

3、you can update the rosdep using the command
rosdep update

4、when you run ROS commands in your terminal, it needs to know where the necessary files are.
 To make ROS know about your installation file locations you need to execute the setup.bash file script that ros provides, using the command
 source/opt/ros/indigo/setup.bash 

同第一步,安装的是kinetic就用kinetic替换掉indigo
5、It will help you getting rid of the error “command not found”.

Let’s start with the turtlesimOpen three separate terminals and execute these three commands(实际验证开两个terminal就可以)

第一个terminal输入命令:

roscore rosrun turtlesim turtlesim_node
第二个terminal输入命令:

rosrun turtlesim turtle_teleop_key(用键盘方向键控制小乌龟,鼠标一定要点击这个terminal否则不能控制小乌龟)

6、总结

three terminals will allow all three commands to execute simultaneously. The first command will start the ROS server,

which will make communication between nodes if needed. Second command will execute a node named turtlesim_node and third will execute another node named turtle_teleop_key.

Both the nodes are from turtlesim package. So it is clear that to run a node we simply need the command

 rosrun package-name node-name (命令格式)
it should be said that rosrun doesn’t do anything magical here. It is a system of ros which help us to find packages and node from ROS workspace.
If you know the full directory of the nodes you can run it from there directly.


                                             
0 0
原创粉丝点击