ROS上手测试小乌龟程序

1.输入roscore后报错:

Traceback (most recent call last):
File “/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/init.py”, line 257, in main
write_pid_file(options.pid_fn, options.core, options.port)
File “/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/init.py”, line 110, in write_pid_file
with open(pid_fn, “w”) as f:
IOError: [Errno 13] Permission denied: ‘/home/hdh/.ros/roscore-11311.pid’

解决方法:由于权限问题

sudo chmod 777 -R ~/.ros/

2.测试小乌龟

sudo apt-get install ros-kinetic-turtlesim 

然后在打开三个不同的终端,分别输入指令:

roscore
rosrun turtlesim turtlesim_node
rosrun turtlesim turtle_teleop_key

然后就可以用键盘控制小乌龟移动了,效果如图:
ROS上手测试小乌龟程序_第1张图片

你可能感兴趣的:(ROS)