Skip to content

Commit

Permalink
ros2 port
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Lautman authored and Mike Lautman committed Nov 10, 2018
1 parent 4ede47d commit b8798c7
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 32 deletions.
21 changes: 13 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.5)
project(rqt_py_console)
# Load catkin and all dependencies required for this package
find_package(catkin REQUIRED)
catkin_package()
catkin_python_setup()

# Load ament and all dependencies required for this package
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_python REQUIRED)

ament_python_install_package(${PROJECT_NAME}
PACKAGE_DIR src/${PROJECT_NAME})

install(FILES plugin.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
DESTINATION share/${PROJECT_NAME}
)

install(DIRECTORY resource
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
DESTINATION share/${PROJECT_NAME}
)

install(PROGRAMS scripts/rqt_py_console
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
DESTINATION lib/${PROJECT_NAME}
)

ament_package()
18 changes: 9 additions & 9 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<package>
<package format="2">
<name>rqt_py_console</name>
<version>0.4.8</version>
<description>rqt_py_console is a Python GUI plugin providing an interactive Python console.</description>
Expand All @@ -12,18 +12,18 @@

<author>Dorian Scholz</author>

<buildtool_depend>catkin</buildtool_depend>
<buildtool_depend>ament_cmake</buildtool_depend>

<run_depend version_gte="0.2.19">python_qt_binding</run_depend>
<run_depend>python-rospkg</run_depend>
<run_depend>qt_gui</run_depend>
<run_depend>qt_gui_py_common</run_depend>
<run_depend>rospy</run_depend>
<run_depend>rqt_gui</run_depend>
<run_depend>rqt_gui_py</run_depend>
<exec_depend version_gte="0.2.19">python_qt_binding</exec_depend>
<exec_depend>qt_gui</exec_depend>
<exec_depend>qt_gui_py_common</exec_depend>
<exec_depend>rclpy</exec_depend>
<exec_depend>rqt_gui</exec_depend>
<exec_depend>rqt_gui_py</exec_depend>

<export>
<architecture_independent/>
<qt_gui plugin="${prefix}/plugin.xml"/>
<build_type>ament_cmake</build_type>
</export>
</package>
2 changes: 1 addition & 1 deletion scripts/rqt_py_console
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys

Expand Down
11 changes: 0 additions & 11 deletions setup.py

This file was deleted.

9 changes: 6 additions & 3 deletions src/rqt_py_console/py_console_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# POSSIBILITY OF SUCH DAMAGE.

import os
import rospkg
from ament_index_python.resources import get_resource

from python_qt_binding import loadUi
from python_qt_binding.QtWidgets import QWidget
Expand All @@ -42,8 +42,11 @@ class PyConsoleWidget(QWidget):

def __init__(self, context=None):
super(PyConsoleWidget, self).__init__()
rp = rospkg.RosPack()
ui_file = os.path.join(rp.get_path('rqt_py_console'), 'resource', 'py_console_widget.ui')

_, package_path = get_resource('packages', 'rqt_py_console')
ui_file = os.path.join(
package_path, 'share', 'rqt_py_console', 'resource', 'py_console_widget.ui')

loadUi(ui_file, self, {'PyConsoleTextEdit': PyConsoleTextEdit})
self.setObjectName('PyConsoleWidget')

Expand Down

0 comments on commit b8798c7

Please sign in to comment.