ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

I need help making/building a catkin package.

asked 2013-04-26 12:54:12 -0600

packrat gravatar image

updated 2014-01-28 17:16:21 -0600

ngrennan gravatar image

Let me start off by saying that I have read the tutorials on how to make a package and how to build it, but I seem to be too stupid to get it right because it never works. I am running ros groovy on Ubuntu 12.04lts. This is what I am trying to do, build a package that can be started by a launch file. The package is a python script that reads a serial line form a arduino and publishes it on a ros topic. The package that I want to make is all based around "encoder_feedback.py". After I build the package, I try to run it with

walle@wallebase:~/catkin_ws$ rosrun encoder_feedback encoder_feedback.py
Traceback (most recent call last):
  File "/home/walle/catkin_ws/src/encoder_feedback/scripts/encoder_feedback.py", line 4, in <module>
    import rospy
  File "/opt/ros/groovy/lib/python2.7/dist-packages/rospy/__init__.py", line 49, in <module>
    from .client import spin, myargv, init_node, \
  File "/opt/ros/groovy/lib/python2.7/dist-packages/rospy/client.py", line 46, in <module>
    import yaml
ImportError: No module named yaml

What do I need to do to build a working package? Let me know if I need to post the .py code or include more info. Thanks for any help you can give.

edit retag flag offensive close merge delete

Comments

Do you have a run_depend for python-yaml in your package.xml?

joq gravatar image joq  ( 2013-04-26 15:48:47 -0600 )edit

No I don't. just <build_depend>std_msgs</build_depend><build_depend>rospy</build_depend><run_depend>std_msgs</run_depend><run_depend>rospy</run_depend>

packrat gravatar image packrat  ( 2013-04-27 07:13:42 -0600 )edit

All I am importing is import serial import time import rospy from std_msgs.msg import Int32

packrat gravatar image packrat  ( 2013-04-27 07:25:35 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-04-26 15:24:34 -0600

Have you seen this question? Try this and comment your results...

edit flag offensive delete link more

Comments

walle@wallebase:~$ sudo apt-get install python-yaml Reading package lists... Done Building dependency tree
Reading state information... Done python-yaml is already the newest version. python-yaml set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

packrat gravatar image packrat  ( 2013-04-27 07:14:31 -0600 )edit

check /usr/lib/python2.7/dist-packages and /usr/lib/python2.6/dist-packages for python-yaml

gustavo.velascoh gravatar image gustavo.velascoh  ( 2013-04-27 17:33:45 -0600 )edit

Both pythons have yaml

packrat gravatar image packrat  ( 2013-04-28 06:29:45 -0600 )edit

Any ideas?

packrat gravatar image packrat  ( 2013-05-04 03:50:21 -0600 )edit

Can I download your code for try to run it... Do you have the package in a repo?

gustavo.velascoh gravatar image gustavo.velascoh  ( 2013-05-04 05:09:11 -0600 )edit

Question Tools

Stats

Asked: 2013-04-26 12:54:12 -0600

Seen: 351 times

Last updated: Apr 26 '13