Problem with yaml
Hi, I use ROS Indigo on Raspbian. When I try turn on a program, I have got error:
Traceback (most recent call last):
File "/home/pi/ros_catkin_ws/src/hil/scripts/hil.py", line 2, in <module>
import rospy
File "/home/pi/ros_catkin_ws/devel/lib/python2.7/dist-packages/rospy/__init__.py", line 35, in <module>
exec(__fh.read())
File "<string>", line 49, in <module>
File "/home/pi/ros_catkin_ws/src/ros_comm/rospy/src/rospy/client.py", line 47, in <module>
import yaml
ImportError: No module named 'yaml'
My program code is:
#!/usr/bin/python3
import rospy
from std_msgs.msg import String
#added
from geometry_msgs.msg import Twist
def callback(data):
global msg
if data.data=="Unknown":
pub = rospy.Publisher('cmd_vel', Twist)
rospy.loginfo("Classifiers output: %s in unknown" % data.data)
msg.linear.x = 2
msg.linear.y = 2
msg.angular.z = 0
speed = 0.4
rospy.loginfo("checking for cmd" + str(msg.linear))
pub.publish(msg)
elif data.data=="Check":
rospy.loginfo("Classifiers output: %s in check" % data.data)
else:
rospy.loginfo("Classifiers output: %s and not unknown or check" % data.data)
def listener():
global msg
rospy.init_node('listener', anonymous=True)
msg = Twist()
rospy.Subscriber("ccc", String, callback)
rospy.spin()
if __name__ == '__main__':
listener()
I tried
sudo apt-get install python-yaml
yaml is installed, but error still appears
Thanks