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

Port actionlib_tools to Python 3 #169

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions actionlib_tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ project(actionlib_tools)

find_package(catkin REQUIRED)

catkin_python_setup()

catkin_package()

catkin_install_python(PROGRAMS
# These scripts require Python 2 dependency wx
# scripts/axclient.py
# scripts/axserver.py
scripts/dynamic_action.py
scripts/library.py
scripts/axclient.py
scripts/axserver.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
2 changes: 1 addition & 1 deletion actionlib_tools/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
<exec_depend>actionlib</exec_depend>
<exec_depend>actionlib_msgs</exec_depend>
<!-- Noetic uses Python 3 -->
<!--<exec_depend>python-wxtools</exec_depend>-->
<exec_depend>python3-wxgtk4.0</exec_depend>

</package>
10 changes: 5 additions & 5 deletions actionlib_tools/scripts/axclient.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/python
#!/usr/bin/env python3
# **********************************************************
# Software License Agreement (BSD License)
#
Expand Down Expand Up @@ -48,9 +48,9 @@
import actionlib
import threading
import rostopic
from io import StringIO
from library import to_yaml, yaml_msg_str
from dynamic_action import DynamicAction
from io import BytesIO
from actionlib_tools.library import to_yaml, yaml_msg_str
from actionlib_tools.dynamic_action import DynamicAction
from actionlib_msgs.msg import GoalStatus


Expand Down Expand Up @@ -102,7 +102,7 @@ def on_goal(self, event):
try:
self.goal_msg = yaml_msg_str(self.action_type.goal,
self.goal.GetValue())
buff = StringIO()
buff = BytesIO()
self.goal_msg.serialize(buff)

# send the goal to the action server and register the relevant
Expand Down
12 changes: 6 additions & 6 deletions actionlib_tools/scripts/axserver.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2009, Willow Garage, Inc.
Expand Down Expand Up @@ -43,9 +43,9 @@
import rospy
import actionlib
import threading
from io import StringIO
from library import to_yaml, yaml_msg_str
from dynamic_action import DynamicAction
from io import BytesIO
from actionlib_tools.library import to_yaml, yaml_msg_str
from actionlib_tools.dynamic_action import DynamicAction

SEND_FEEDBACK = 0
SUCCEED = 1
Expand Down Expand Up @@ -139,7 +139,7 @@ def on_feedback(self, event):
try:
self.feedback_msg = yaml_msg_str(self.action_type.feedback,
self.feedback.GetValue())
buff = StringIO()
buff = BytesIO()
self.feedback_msg.serialize(buff)

self.execute_type = SEND_FEEDBACK
Expand All @@ -155,7 +155,7 @@ def on_succeed(self, event):

try:
self.result_msg = yaml_msg_str(self.action_type.result, self.result.GetValue())
buff = StringIO()
buff = BytesIO()
self.result_msg.serialize(buff)

self.execute_type = SUCCEED
Expand Down
11 changes: 11 additions & 0 deletions actionlib_tools/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env python3

from setuptools import setup
from catkin_pkg.python_setup import generate_distutils_setup

d = generate_distutils_setup(
packages=['actionlib_tools'],
package_dir={'': 'src'}
)

setup(**d)
Empty file.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#! /usr/bin/python
# **********************************************************
# Software License Agreement (BSD License)
#
Expand Down