Skip to content

Commit

Permalink
Adding initial (empty) rqt_smach plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jbohren committed Dec 14, 2012
1 parent 1f8f911 commit 83817a4
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 0 deletions.
30 changes: 30 additions & 0 deletions rqt_smach/CMakeLists.txt
@@ -0,0 +1,30 @@
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

# Set the build type. Options are:
# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage
# Debug : w/ debug symbols, w/o optimization
# Release : w/o debug symbols, w/ optimization
# RelWithDebInfo : w/ debug symbols, w/ optimization
# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)

rosbuild_init()

#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

#uncomment if you have defined messages
#rosbuild_genmsg()
#uncomment if you have defined services
#rosbuild_gensrv()

#common commands for building c++ executables and libraries
#rosbuild_add_library(${PROJECT_NAME} src/example.cpp)
#target_link_libraries(${PROJECT_NAME} another_library)
#rosbuild_add_boost_directories()
#rosbuild_link_boost(${PROJECT_NAME} thread)
#rosbuild_add_executable(example examples/example.cpp)
#target_link_libraries(example ${PROJECT_NAME})
1 change: 1 addition & 0 deletions rqt_smach/Makefile
@@ -0,0 +1 @@
include $(shell rospack find mk)/cmake.mk
14 changes: 14 additions & 0 deletions rqt_smach/mainpage.dox
@@ -0,0 +1,14 @@
/**
\mainpage
\htmlinclude manifest.html

\b rqt_smach

<!--
Provide an overview of your package.
-->

-->


*/
21 changes: 21 additions & 0 deletions rqt_smach/manifest.xml
@@ -0,0 +1,21 @@
<package>
<description brief="rqt_smach">

rqt_smach

</description>
<author>Jonathan Bohren</author>
<license>BSD</license>
<review status="unreviewed" notes=""/>
<url>http://ros.org/wiki/rqt_smach</url>
<depend package="rospy"/>
<depend package="rqt_gui"/>
<depend package="rqt_gui_py"/>

<export>
<rqt_gui plugin="${prefix}/plugin.xml"/>
</export>

</package>


20 changes: 20 additions & 0 deletions rqt_smach/plugin.xml
@@ -0,0 +1,20 @@
<library path="src">
<class name="SMACH Visualization" type="rqt_smach.rqt_smach.SMACHVisualization" base_class_type="rqt_gui_py::Plugin">
<description>
An RQT plugin to visualize SMACH plans.
</description>
<qtgui>
<!-- optional grouping...
<group>
<label>Group</label>
</group>
<group>
<label>Subgroup</label>
</group>
-->
<label>SMACH</label>
<icon type="theme">system-help</icon>
<statustip>SMACH Visualization</statustip>
</qtgui>
</class>
</library>
Empty file.
57 changes: 57 additions & 0 deletions rqt_smach/src/rqt_smach/rqt_smach.py
@@ -0,0 +1,57 @@
import os
import roslib
roslib.load_manifest('rqt_smach')
import rospy

from qt_gui.plugin import Plugin
from python_qt_binding import loadUi
from python_qt_binding.QtGui import QWidget

class SMACHVisualization(Plugin):

def __init__(self, context):
super(SMACHVisualization, self).__init__(context)
# Give QObjects reasonable names
self.setObjectName('SMACHVisualization')

# Process standalone plugin command-line arguments
from argparse import ArgumentParser
parser = ArgumentParser()
# Add argument(s) to the parser.
parser.add_argument("-q", "--quiet", action="store_true",
dest="quiet",
help="Put plugin in silent mode")
args, unknowns = parser.parse_known_args(context.argv())
if not args.quiet:
print 'arguments: ', args
print 'unknowns: ', unknowns

# Create QWidget
self._widget = QWidget()
# Get path to UI file which is a sibling of this file
# in this example the .ui and .py file are in the same folder
ui_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'SMACHVisualization.ui')
# Extend the widget with all attributes and children from UI file
loadUi(ui_file, self._widget)
# Give QObjects reasonable names
self._widget.setObjectName('SMACHVisualizationUi')
# Add widget to the user interface
context.add_widget(self._widget)

def shutdown_plugin(self):
# TODO unregister all publishers here
pass

def save_settings(self, plugin_settings, instance_settings):
# TODO save intrinsic configuration, usually using:
# instance_settings.set_value(k, v)
pass

def restore_settings(self, plugin_settings, instance_settings):
# TODO restore intrinsic configuration, usually using:
# v = instance_settings.value(k)
pass

#def trigger_configuration(self):
# Comment in to signal that the plugin has a way to configure it
# Usually used to open a configuration dialog

0 comments on commit 83817a4

Please sign in to comment.