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

dynamic_reconfigure: cfg file generation not producing __init__.py file correctly

asked 2011-11-01 23:23:30 -0600

haroldsoh gravatar image

updated 2014-01-28 17:10:41 -0600

ngrennan gravatar image

I've encountered an issue with dynamic_reconfigure (working with python) not producing an __init__.py in the configuration module directory:

As expected, the generator produces a new directory my_module (with a cfg directory within) in my src directory. It does create an __init__.py file within the cfg directory but not within my_module itself. Python doesn't recognize this as a module and I get the following error:

ImportError: No module named my_module.cfg

Manually creating an __init__.py file within the my_module directory solves this problem. Is anyone else encountering this issue? Is it a bug or do I have a setting wrong somewhere? Thanks in advance!

System: Ubuntu 10.10, Python Version: 2.7.1, ROS Electric and Diamondback

edit retag flag offensive close merge delete

Comments

I have the same issue here (Ubuntu 11.04; Python 2.7.1; ROS electric).
Sabrina gravatar image Sabrina  ( 2011-11-03 20:29:40 -0600 )edit
We have the same issue here. It seems the cause is `rosed dynamic_reconfigure parameter_generator.py` fail to generate the necessary __init__.py. Ticket submitted https://code.ros.org/trac/ros-pkg/ticket/5259
tingfan gravatar image tingfan  ( 2011-11-22 11:07:34 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2012-04-26 08:13:43 -0600

ssafarik gravatar image

If you suffer from this in, e.g., mypackage, go to mypackage/src/mypackage, and touch __init__.py

For example:

rosmake mypackage
roscd mypackage/src/mypackage 
touch __init__.py

Then it should run.

Steve.

edit flag offensive delete link more

Comments

This is a useful temporary workaround, but not a fix for the problem, which will recur when someone else checks out mypackage.

joq gravatar image joq  ( 2012-06-08 04:41:17 -0600 )edit
1

answered 2012-04-26 09:22:08 -0600

joq gravatar image

This may be a bug. Please open a ticket.

I have not seen it, perhaps because I already had a src/my_package/__init__.py for other reasons.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-11-01 23:23:30 -0600

Seen: 1,667 times

Last updated: Apr 26 '12