Skip to content
Open
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
50 changes: 20 additions & 30 deletions smach_tutorials/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
cmake_minimum_required(VERSION 2.8.3)
project(smach_tutorials)

# 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)
find_package(catkin REQUIRED COMPONENTS
genmsg
actionlib_msgs
actionlib
geometry_msgs
)

rosbuild_find_ros_package(actionlib_msgs)
include(${actionlib_msgs_PACKAGE_PATH}/cmake/actionbuild.cmake)
genaction()
catkin_python_setup()

rosbuild_init()
add_action_files(
DIRECTORY
action
FILES
Test.action
)

#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})
generate_messages(
DEPENDENCIES
geometry_msgs
actionlib_msgs
)
26 changes: 0 additions & 26 deletions smach_tutorials/manifest.xml

This file was deleted.

19 changes: 19 additions & 0 deletions smach_tutorials/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<package>
<name>smach_tutorials</name>
<version>1.0.0</version>
<description>Action sever to interface between the planning system and the drone</description>

<maintainer email="bcchoi@yujinrobot.com">Bcchoi</maintainer>

<license>BSD</license>

<build_depend>actionlib</build_depend>
<build_depend>actionlib_msgs</build_depend>

<run_depend>actionlib</run_depend>
<run_depend>actionlib_msgs</run_depend>

<buildtool_depend>catkin</buildtool_depend>

</package>
2 changes: 1 addition & 1 deletion smach_tutorials/scripts/usecase_01/executive_step_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
[ERROR] : Container consistency check failed.
"""

import roslib; roslib.load_manifest('smach_tutorials')
# import roslib; roslib.load_manifest('smach_tutorials') use on rosbuild
import rospy
import smach

Expand Down
10 changes: 5 additions & 5 deletions smach_tutorials/scripts/usecase_01/executive_step_02.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

"""

import roslib; roslib.load_manifest('smach_tutorials')
# import roslib; roslib.load_manifest('smach_tutorials') use on rosbuild
import rospy

import threading

import smach
from smach import StateMachine, ServiceState, SimpleActionState
from smach_ros import ServiceState, SimpleActionState

import std_srvs.srv
import turtlesim.srv
Expand All @@ -29,17 +29,17 @@ def main():
rospy.init_node('smach_usecase_step_02')

# Create a SMACH state machine
sm0 = StateMachine(outcomes=['succeeded','aborted','preempted'])
sm0 = smach.StateMachine(outcomes=['succeeded','aborted','preempted'])

# Open the container
with sm0:
# Reset turtlesim
StateMachine.add('RESET',
smach.StateMachine.add('RESET',
ServiceState('reset', std_srvs.srv.Empty),
{'succeeded':'SPAWN'})

# Create a second turtle
StateMachine.add('SPAWN',
smach.StateMachine.add('SPAWN',
ServiceState('spawn', turtlesim.srv.Spawn,
request = turtlesim.srv.SpawnRequest(0.0,0.0,0.0,'turtle2')))

Expand Down
10 changes: 5 additions & 5 deletions smach_tutorials/scripts/usecase_01/executive_step_03.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Usage:
$> roslaunch turtle_nodes.launch
$> ./executive_step_02.py
$> ./executive_step_03.py

Output:
[INFO] : State machine starting in initial state 'RESET' with userdata:
Expand All @@ -14,19 +14,19 @@

"""

import roslib; roslib.load_manifest('smach_tutorials')
# import roslib; roslib.load_manifest('smach_tutorials')
import rospy

import threading

import smach
from smach import StateMachine, ServiceState, SimpleActionState, IntrospectionServer
from smach import StateMachine
from smach_ros import ServiceState, SimpleActionState, IntrospectionServer

import std_srvs.srv
import turtlesim.srv

def main():
rospy.init_node('smach_usecase_step_02')
rospy.init_node('smach_usecase_step_03')

# Create a SMACH state machine
sm0 = StateMachine(outcomes=['succeeded','aborted','preempted'])
Expand Down
10 changes: 5 additions & 5 deletions smach_tutorials/scripts/usecase_01/executive_step_04.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@

"""

import roslib; roslib.load_manifest('smach_tutorials')
# import roslib; roslib.load_manifest('smach_tutorials')
import rospy

import threading

import smach
from smach import StateMachine, ServiceState, SimpleActionState, IntrospectionServer
from smach import StateMachine
from smach_ros import ServiceState, SimpleActionState, IntrospectionServer

import std_srvs.srv
import turtlesim.srv
import turtle_actionlib.msg

from smach_ros import util

def main():
rospy.init_node('smach_usecase_step_04')
Expand Down Expand Up @@ -84,7 +84,7 @@ def main():
sis.start()

# Set preempt handler
smach.set_preempt_handler(sm0)
util.set_preempt_handler(sm0)

# Execute SMACH tree in a separate thread so that we can ctrl-c the script
smach_thread = threading.Thread(target = sm0.execute)
Expand Down
10 changes: 5 additions & 5 deletions smach_tutorials/scripts/usecase_01/executive_step_05.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
[INFO] : State machine terminating 'DRAW_SHAPES':'succeeded':'succeeded'
"""

import roslib; roslib.load_manifest('smach_tutorials')
# import roslib; roslib.load_manifest('smach_tutorials')
import rospy

import threading

import smach
from smach import StateMachine, ServiceState, SimpleActionState, IntrospectionServer, Concurrence
from smach import StateMachine, Concurrence
from smach_ros import ServiceState, SimpleActionState, IntrospectionServer

import std_srvs.srv
import turtlesim.srv
import turtle_actionlib.msg

from smach_ros import util

def main():
rospy.init_node('smach_usecase_step_05')
Expand Down Expand Up @@ -94,7 +94,7 @@ def main():
sis.start()

# Set preempt handler
smach.set_preempt_handler(sm0)
util.set_preempt_handler(sm0)

# Execute SMACH tree in a separate thread so that we can ctrl-c the script
smach_thread = threading.Thread(target = sm0.execute)
Expand Down
2 changes: 1 addition & 1 deletion smach_tutorials/scripts/usecase_01/executive_step_06.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

"""

import roslib; roslib.load_manifest('smach_tutorials')
# import roslib; roslib.load_manifest('smach_tutorials')
import rospy

import threading
Expand Down
2 changes: 1 addition & 1 deletion smach_tutorials/scripts/usecase_01/executive_step_07.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

"""

import roslib; roslib.load_manifest('smach_tutorials')
# import roslib; roslib.load_manifest('smach_tutorials')
import rospy

import threading
Expand Down
10 changes: 10 additions & 0 deletions smach_tutorials/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python

from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup

d = generate_distutils_setup(
packages=['smach_tutorials'],
)

setup(**d)