|
From: <stu...@us...> - 2009-05-12 20:11:11
|
Revision: 15263
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=15263&view=rev
Author: stuglaser
Date: 2009-05-12 20:10:57 +0000 (Tue, 12 May 2009)
Log Message:
-----------
Separated each safety action into its own binary
Modified Paths:
--------------
pkg/trunk/demos/milestone2/milestone2_actions/milestone2.launch
pkg/trunk/highlevel/safety/safety_core/CMakeLists.txt
pkg/trunk/highlevel/safety/safety_core/src/action_runner.cpp
Added Paths:
-----------
pkg/trunk/highlevel/safety/safety_core/src/run_detect_plug_on_base.cpp
pkg/trunk/highlevel/safety/safety_core/src/run_doors_tuck_arms.cpp
pkg/trunk/highlevel/safety/safety_core/src/run_tuck_arms.cpp
Modified: pkg/trunk/demos/milestone2/milestone2_actions/milestone2.launch
===================================================================
--- pkg/trunk/demos/milestone2/milestone2_actions/milestone2.launch 2009-05-12 19:53:22 UTC (rev 15262)
+++ pkg/trunk/demos/milestone2/milestone2_actions/milestone2.launch 2009-05-12 20:10:57 UTC (rev 15263)
@@ -26,7 +26,10 @@
<!-- Safety -->
- <node machine="four" pkg="safety_core" type="action_runner" output="screen" respawn="true" />
+ <!--<node machine="four" pkg="safety_core" type="action_runner" output="screen" respawn="true" />-->
+ <node machine="four" pkg="safety_core" type="run_detect_plug_on_base" output="screen" respawn="true" />
+ <node machine="four" pkg="safety_core" type="run_doors_tuck_arms" output="screen" respawn="true" />
+ <node machine="four" pkg="safety_core" type="run_tuck_arms" output="screen" respawn="true" />
<!-- joystick -->
Modified: pkg/trunk/highlevel/safety/safety_core/CMakeLists.txt
===================================================================
--- pkg/trunk/highlevel/safety/safety_core/CMakeLists.txt 2009-05-12 19:53:22 UTC (rev 15262)
+++ pkg/trunk/highlevel/safety/safety_core/CMakeLists.txt 2009-05-12 20:10:57 UTC (rev 15263)
@@ -8,7 +8,20 @@
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
-rospack_add_executable(action_runner src/action_detect_plug_on_base.cpp
+rospack_add_executable(action_runner src/action_detect_plug_on_base.cpp
src/action_tuck_arms.cpp
- src/action_doors_tuck_arms.cpp
+ src/action_doors_tuck_arms.cpp
src/action_runner.cpp)
+
+rospack_add_executable(run_detect_plug_on_base
+ src/run_detect_plug_on_base.cpp
+ src/action_detect_plug_on_base.cpp
+ )
+rospack_add_executable(run_doors_tuck_arms
+ src/run_doors_tuck_arms.cpp
+ src/action_doors_tuck_arms.cpp
+ )
+rospack_add_executable(run_tuck_arms
+ src/run_tuck_arms.cpp
+ src/action_tuck_arms.cpp
+ )
Modified: pkg/trunk/highlevel/safety/safety_core/src/action_runner.cpp
===================================================================
--- pkg/trunk/highlevel/safety/safety_core/src/action_runner.cpp 2009-05-12 19:53:22 UTC (rev 15262)
+++ pkg/trunk/highlevel/safety/safety_core/src/action_runner.cpp 2009-05-12 20:10:57 UTC (rev 15263)
@@ -63,12 +63,12 @@
DetectPlugOnBaseAction detect(node);
TuckArmsAction tuck_arms;
DoorsTuckArmsAction doors_tuck_arms;
-
+
robot_actions::ActionRunner runner(10.0);
runner.connect<std_msgs::Empty, pr2_robot_actions::DetectPlugOnBaseState, robot_msgs::PlugStow>(detect);
runner.connect<std_msgs::Empty, robot_actions::NoArgumentsActionState, std_msgs::Empty>(tuck_arms);
runner.connect<std_msgs::Empty, robot_actions::NoArgumentsActionState, std_msgs::Empty>(doors_tuck_arms);
-
+
runner.run();
//robot_msgs::PlugStow feedback;
Copied: pkg/trunk/highlevel/safety/safety_core/src/run_detect_plug_on_base.cpp (from rev 15260, pkg/trunk/highlevel/safety/safety_core/src/action_runner.cpp)
===================================================================
--- pkg/trunk/highlevel/safety/safety_core/src/run_detect_plug_on_base.cpp (rev 0)
+++ pkg/trunk/highlevel/safety/safety_core/src/run_detect_plug_on_base.cpp 2009-05-12 20:10:57 UTC (rev 15263)
@@ -0,0 +1,68 @@
+/*********************************************************************
+ * Software License Agreement (BSD License)
+ *
+ * Copyright (c) 2008, Willow Garage, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of Willow Garage nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *********************************************************************/
+
+// Msgs
+#include <robot_msgs/PlugStow.h>
+#include <std_msgs/Empty.h>
+
+// Actions
+#include <safety_core/action_detect_plug_on_base.h>
+
+// State Msgs
+#include <robot_actions/NoArgumentsActionState.h>
+#include <pr2_robot_actions/DetectPlugOnBaseState.h>
+
+#include <robot_actions/action.h>
+#include <robot_actions/action_runner.h>
+
+using namespace safety_core;
+
+// -----------------------------------
+// MAIN
+// -----------------------------------
+
+int main(int argc, char** argv)
+{
+ ros::init(argc,argv);
+
+ ros::Node node("safety_core_actions");
+ DetectPlugOnBaseAction detect(node);
+
+ robot_actions::ActionRunner runner(10.0);
+ runner.connect<std_msgs::Empty, pr2_robot_actions::DetectPlugOnBaseState, robot_msgs::PlugStow>(detect);
+ runner.run();
+
+ node.spin();
+ return 0;
+}
Copied: pkg/trunk/highlevel/safety/safety_core/src/run_doors_tuck_arms.cpp (from rev 15260, pkg/trunk/highlevel/safety/safety_core/src/action_runner.cpp)
===================================================================
--- pkg/trunk/highlevel/safety/safety_core/src/run_doors_tuck_arms.cpp (rev 0)
+++ pkg/trunk/highlevel/safety/safety_core/src/run_doors_tuck_arms.cpp 2009-05-12 20:10:57 UTC (rev 15263)
@@ -0,0 +1,67 @@
+/*********************************************************************
+ * Software License Agreement (BSD License)
+ *
+ * Copyright (c) 2008, Willow Garage, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of Willow Garage nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *********************************************************************/
+
+// Msgs
+#include <robot_msgs/PlugStow.h>
+#include <std_msgs/Empty.h>
+
+// Actions
+#include <safety_core/action_doors_tuck_arms.h>
+
+// State Msgs
+#include <robot_actions/NoArgumentsActionState.h>
+
+#include <robot_actions/action.h>
+#include <robot_actions/action_runner.h>
+
+using namespace safety_core;
+
+// -----------------------------------
+// MAIN
+// -----------------------------------
+
+int main(int argc, char** argv)
+{
+ ros::init(argc,argv);
+
+ ros::Node node("safety_core_actions");
+ DoorsTuckArmsAction doors_tuck_arms;
+
+ robot_actions::ActionRunner runner(10.0);
+ runner.connect<std_msgs::Empty, robot_actions::NoArgumentsActionState, std_msgs::Empty>(doors_tuck_arms);
+ runner.run();
+
+ node.spin();
+ return 0;
+}
Copied: pkg/trunk/highlevel/safety/safety_core/src/run_tuck_arms.cpp (from rev 15260, pkg/trunk/highlevel/safety/safety_core/src/action_runner.cpp)
===================================================================
--- pkg/trunk/highlevel/safety/safety_core/src/run_tuck_arms.cpp (rev 0)
+++ pkg/trunk/highlevel/safety/safety_core/src/run_tuck_arms.cpp 2009-05-12 20:10:57 UTC (rev 15263)
@@ -0,0 +1,67 @@
+/*********************************************************************
+ * Software License Agreement (BSD License)
+ *
+ * Copyright (c) 2008, Willow Garage, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of Willow Garage nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *********************************************************************/
+
+// Msgs
+#include <robot_msgs/PlugStow.h>
+#include <std_msgs/Empty.h>
+
+// Actions
+#include <safety_core/action_tuck_arms.h>
+
+// State Msgs
+#include <robot_actions/NoArgumentsActionState.h>
+
+#include <robot_actions/action.h>
+#include <robot_actions/action_runner.h>
+
+using namespace safety_core;
+
+// -----------------------------------
+// MAIN
+// -----------------------------------
+
+int main(int argc, char** argv)
+{
+ ros::init(argc,argv);
+
+ ros::Node node("safety_core_actions");
+ TuckArmsAction tuck_arms;
+
+ robot_actions::ActionRunner runner(10.0);
+ runner.connect<std_msgs::Empty, robot_actions::NoArgumentsActionState, std_msgs::Empty>(tuck_arms);
+ runner.run();
+
+ node.spin();
+ return 0;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|