Skip to content
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

rosbag migration does not work for messages outside of catkin #293

Closed
kwatts opened this issue Oct 9, 2013 · 3 comments
Closed

rosbag migration does not work for messages outside of catkin #293

kwatts opened this issue Oct 9, 2013 · 3 comments
Labels

Comments

@kwatts
Copy link
Contributor

kwatts commented Oct 9, 2013

I noticed that rosbag "migration.py" does not work for messages outside of catkin.

Specifically, this is because the "genpy" module does not load message classes unless the message class is loaded in "/opt/ros/groovy/lib/python-2.7". After calling "roslib.load_manifest" for the package, the message will be loaded.

Example (using JoQ's "ackermann_msgs" package, but you get the idea):

import genpy

# Loading std_msgs is no problem
hdr_cls = genpy.message.get_message_class("std_msgs/Header")

# Returns None for valid message instance
returns_none = genpy.message.get_message_class("ackermann_msgs/AckermannDrive")

# load_manifest, then it will actually work
import roslib; roslib.load_manifest("ackermann_msgs")
ackermann_cls = genpy.message.get_message_class("ackermann_msgs/AckermannDrive")

This is easy to duplicate using any ROS message that exists outside of "/opt/ros/groovy/lib".

Because rosbag's "migration.py" system uses this method of generating message classes, bag migration will not work for any message that is not installed.

@kwatts
Copy link
Contributor Author

kwatts commented Oct 10, 2013

@dirk-thomas
Copy link
Member

migration.py will have to check the type of the package and invoke roslib.load_manifest() for dry packages.

Can you please attach an example migration rule and the command sequence which you used? That will make it easier to get this fixed.

@kwatts
Copy link
Contributor Author

kwatts commented Oct 18, 2013

I created a simple test package that demonstrates this problem:
https://github.com/kwatts/ros_comm/blob/groovy-devel/migration_msgs.tgz
(github does not allow file attachments in issues, wtf)

Details

  • Package contains a simple message, which has an "old" and "new" version in the "msg/" directory
  • "old_message.bag" is a bag recorded with a single old message
  • "migration_msgs.saved" is a saved copy of the old message
  • "migration_rules/migration_msg.bmr" is a ''Bag Migration Rule'' file that should allow you to migrate messages

To duplicate:

rosmake migration_msgs

# Try to make a bag migration rule
rosrun rosbag makerule.py migration_msgs.saved test_bmr_file.bmr -n
# This fails because of the same problem with genpy message loading

# Use the working bag migration rule to migrate the bag file
rosrun rosbag fixbag.py old_message.bag new_message.bag migration_rules/migration_msg.bmr -n
# Fails because of genpy message problem

I used the "-n" option to for both rosbag tools (no plugins) because it will reduce problems to look at. It doesn't prevent any problems.

@dirk-thomas dirk-thomas added the bug label May 5, 2014
dirk-thomas added a commit to ros/genpy that referenced this issue May 5, 2014
resolve message classes from dry packages (fix ros/ros_comm#293)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants