diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4ca7147..79a56ff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,7 +7,6 @@ project(paramdump)
find_package(catkin REQUIRED COMPONENTS
rospy
std_msgs
- message_generation
)
## System dependencies are found with CMake's conventions
@@ -44,10 +43,9 @@ find_package(catkin REQUIRED COMPONENTS
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
## Generate messages in the 'msg' folder
-add_message_files(
- FILES
- paramdump.msg
-)
+#add_message_files(
+# FILES
+#)
## Generate services in the 'srv' folder
# add_service_files(
@@ -64,10 +62,10 @@ add_message_files(
# )
## Generate added messages and services with any dependencies listed here
-generate_messages(
- DEPENDENCIES
- paramdump
-)
+#generate_messages(
+# DEPENDENCIES
+# paramdump
+#)
################################################
## Declare ROS dynamic reconfigure parameters ##
@@ -103,7 +101,7 @@ catkin_package(
# LIBRARIES paramdump
# CATKIN_DEPENDS rospy std_msgs
# DEPENDS system_lib
- CATKIN_DEPENDS message_runtime
+# CATKIN_DEPENDS message_runtime
)
###########
diff --git a/launch/speech.launch~ b/launch/speech.launch~
deleted file mode 100644
index f543474..0000000
--- a/launch/speech.launch~
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/launch/testspeech.launch~ b/launch/testspeech.launch~
deleted file mode 100644
index 75819b8..0000000
--- a/launch/testspeech.launch~
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/msg/paramdump.msg b/msg/paramdump.msg
deleted file mode 100644
index de7097c..0000000
--- a/msg/paramdump.msg
+++ /dev/null
@@ -1,2 +0,0 @@
-string data
-
diff --git a/msg/paramdump.msg~ b/msg/paramdump.msg~
deleted file mode 100644
index e69de29..0000000
diff --git a/scripts/.paramdump.py.swp b/scripts/.paramdump.py.swp
deleted file mode 100644
index e4cc16a..0000000
Binary files a/scripts/.paramdump.py.swp and /dev/null differ
diff --git a/scripts/gains.yaml b/scripts/gains.yaml
deleted file mode 100644
index b9e8de5..0000000
--- a/scripts/gains.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-{kitchen: '{"translation":{"x":5.1833105702435915,"y":2.082637159055699,"z":0},"rotation":{"x":0,"y":0,"z":0.09438183129967245,"w":0.9955360716320228}}',
- office: '{"translation":{"x":2.105399372963034,"y":2.01924054354302,"z":0},"rotation":{"x":0,"y":0,"z":0.009769720701596717,"w":0.9999522751398753}}'}
diff --git a/scripts/paramdump.py b/scripts/paramdump.py
old mode 100644
new mode 100755
index 9dd0e15..61aa813
--- a/scripts/paramdump.py
+++ b/scripts/paramdump.py
@@ -1,34 +1,34 @@
#!/usr/bin/env python
-## Simple program that listens to std_msgs/Strings published
-## to the 'paramdump' topic. Upon receiving one that says "dump waypoints", it executes
-## the rosparam command to dump the waypoint parameters. This allows them to be persistent.
+## Simple program that listens to std_srv/Trigger messages
+## on the /save_waypoints service. Upon receiving one it calles
+## the rosparam command to save the waypoint parameters to a file.
+## Waypoints are currently saved to ~/waypoints.yaml
import rospy
import subprocess
-from std_msgs.msg import String
+from std_srvs.srv import Trigger
+from std_srvs.srv import TriggerResponse
from os.path import expanduser
-def callback(data):
- # rospy.loginfo(rospy.get_caller_id() + ' I heard %s', data.data)
+def save_waypoints(req):
+ try:
+ home = expanduser("~")
+ subprocess.check_output(
+ ["rosparam", "dump", home + "/waypoints.yaml", "/waypoint"],
+ stderr=subprocess.STDOUT
+ )
+ # parameter -v after "dump" will give verbose output
+ except subprocess.CalledProcessError as cpe:
+ return TriggerResponse(False, "Error saving waypoints: %s" % cpe.output)
- if data.data == "dump waypoints":
- home = expanduser("~")
- subprocess.call(["rosparam", "dump", home + "/waypoints.yaml", "/waypoint"])
- # parameter -v after "dump" will give verbose output
-
-def paramdump():
-
- # rospy.loginfo(rospy.get_caller_id() + 'paramdump is running')
+ return TriggerResponse(True, "")
+if __name__ == '__main__':
rospy.init_node('paramdump')
+ rospy.Service('save_waypoints', Trigger, save_waypoints)
- rospy.Subscriber('paramdump', String, callback)
-
- # spin() simply keeps python from exiting until this node is stopped
rospy.spin()
-if __name__ == '__main__':
- paramdump()