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 update4、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.
本次学习将通过turtlesim模拟实际机器人,以更好地理解ROS项目的基本元素。要安装turtlesim仿真器,只需运行特定命令。
1885

被折叠的 条评论
为什么被折叠?



