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

Added UTF-8 support for diagnostic messages to rqt_robot_monitor #80

Closed

Conversation

mitchellwills
Copy link

Fixes #79

@mitchellwills
Copy link
Author

@dirk-thomas Any thoughts on this?

@dirk-thomas
Copy link
Contributor

The code is incompatible with Python 3 which makes me hesitant to merge it as-is.

@mitchellwills
Copy link
Author

Are there any resource on setting up a python 3 ROS installation? I spent a while searching for instructions and have been unable to find any.

@mitchellwills mitchellwills force-pushed the hydro-devel branch 2 times, most recently from 861d534 to d056f66 Compare March 9, 2015 17:06
@dirk-thomas
Copy link
Contributor

No, sadly there are none. The easiest way is to create a Python 3 virtual env, install all ROS Python packages in there and then compile ROS from source using the CMake variable PYTHON_VERSION=3.

@mitchellwills
Copy link
Author

So while i'm still having some issues getting everything running with python3 (tf2 still hasn't been upgraded ros/geometry2#50 so I need to be more fine grain about what I compile) it looks like no modifications should be needed when running under python3. From looking at the generated python message serialization/deserialization code it looks like when running under python3 strings in messages are automatically decoded using UTF8 when they are received (for a simple example see the generated code for std_msgs/String). Would a pull request that uses a similar technique to the message generation to only activate when running under python 2 then be accepted?

@mitchellwills
Copy link
Author

I actually did get rqt_robot_monitor running under python3, but get the following stack trace when running it:

Traceback (most recent call last):
  File "/home/mitchell/python3venv/ros_catkin_ws/install/lib/rqt_robot_monitor/rqt_robot_monitor", line 8, in <module>
    sys.exit(main.main(sys.argv, standalone='rqt_robot_monitor.robot_monitor_plugin.RobotMonitorPlugin'))
  File "/home/mitchell/python3venv/ros_catkin_ws/install/lib/python3/dist-packages/rqt_gui/main.py", line 59, in main
    return super(Main, self).main(argv, standalone=standalone, plugin_argument_provider=plugin_argument_provider, plugin_manager_settings_prefix=str(hash(os.environ['ROS_PACKAGE_PATH'])))
  File "/home/mitchell/python3venv/ros_catkin_ws/install/lib/python3/dist-packages/qt_gui/main.py", line 336, in main
    from python_qt_binding import QT_BINDING
  File "/home/mitchell/python3venv/ros_catkin_ws/install/lib/python3/dist-packages/python_qt_binding-0.2.14-py3.4.egg/python_qt_binding/__init__.py", line 55, in <module>
  File "/home/mitchell/python3venv/ros_catkin_ws/install/lib/python3/dist-packages/python_qt_binding-0.2.14-py3.4.egg/python_qt_binding/binding_helper.py", line 33, in <module>
ImportError: No module named '__builtin__'

@dirk-thomas
Copy link
Contributor

That is weird. The code should include builtins for Python 3 and __builtin__ as builtins for Python 2: https://github.com/ros-visualization/python_qt_binding/blob/9912a6dbde43f75b8fc877e082469e9d6bf625e6/src/python_qt_binding/binding_helper.py#L33-L36

@mitchellwills
Copy link
Author

Don't know if there is something funky with my virtual env cause the directory python_qt_binding-0.2.14-py3.4.egg does not even exist in /home/mitchell/python3venv/ros_catkin_ws/install/lib/python3/dist-packages/

@mitchellwills
Copy link
Author

I'm going to close this because I don't really have a need for it any more and I think this may be better suited for the rospy core anyway (so it applies to all strings)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants