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

本次学习将通过turtlesim模拟实际机器人,以更好地理解ROS项目的基本元素。要安装turtlesim仿真器,只需运行特定命令。
摘要由CSDN通过智能技术生成

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替换成相应的名字,例如:kinetic
2、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.







评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值