-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with customized message #37
Comments
First of all the msg file you posted seems to be invalid. The field types need to be either:
or:
Can you please post detailed instructions (e.g. commands to run in the shell) what you are trying to do, what the current behavior is and what you expect it to be after your patch? |
I wrote a sample package in https://github.com/groundmelon/my_message_package. And the README.md shows how to use this package to raise the bug. Thanks for your help. |
Thank you for providing the detailed example. I will look into it next week. |
I was able to reproduce your problem. I also found another case where I was running into the same issue. When opening your bag file with rqt_bag, opening a raw view for the custom Odometry topic and trying to play a message. Based on that I created a new patch (#39) which does not need to parse the message text to extract the current message information. Can you please give it a try and confirm that it fixes the problem for you too? |
Yes, the problem is fixed. Thanks. |
I meet a bug when using rosbag filter with a customized message. I've located the bug to this function: https://github.com/ros/genpy/blob/indigo-devel/src/genpy/dynamic.py#L81
I have a customized message like this:
Unfortunately, as is shown above, my customized message is my_message_package/Odometry, while there is a standard nav_msgs/Odometry. The package names are different, but the type names are the same.
The generated .py script is attached:
The function
def _gen_dyn_modify_references(py_text, types)
just simply substitutes the class name. In my situation, theclass Odometry(genpy.Message)
should be substituted with_my_message_package__Odometry
, but the nav_msgs/Odometry is first touched during iteration, so it is substituted with_nav_msgs__Odometry
In order to solve the problem, I add few lines to tell this function what is the current working package. See this pull request. That means that after the comment line
"""autogenerated by genpy from my_message_package/Odometry.msg. Do not edit."""
, now_pkg is my_message_package, not nav_msgs/Odometry, such that it would not substitute this Odometry with _nav_msgs__Odometry. When the next comment line is detected, the now_pkg will change. The detection is simply a re-expression.But the solution is not so "elegant". I'd like to see if anyone has more elegant way to fix this.
The text was updated successfully, but these errors were encountered: