Skip to content
This repository was archived by the owner on Jan 7, 2026. It is now read-only.
Merged
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
18 changes: 8 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ project(paramdump)
find_package(catkin REQUIRED COMPONENTS
rospy
std_msgs
message_generation
)

## System dependencies are found with CMake's conventions
Expand Down Expand Up @@ -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(
Expand All @@ -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 ##
Expand Down Expand Up @@ -103,7 +101,7 @@ catkin_package(
# LIBRARIES paramdump
# CATKIN_DEPENDS rospy std_msgs
# DEPENDS system_lib
CATKIN_DEPENDS message_runtime
# CATKIN_DEPENDS message_runtime
)

###########
Expand Down
9 changes: 0 additions & 9 deletions launch/speech.launch~

This file was deleted.

9 changes: 0 additions & 9 deletions launch/testspeech.launch~

This file was deleted.

2 changes: 0 additions & 2 deletions msg/paramdump.msg

This file was deleted.

Empty file removed msg/paramdump.msg~
Empty file.
Binary file removed scripts/.paramdump.py.swp
Binary file not shown.
2 changes: 0 additions & 2 deletions scripts/gains.yaml

This file was deleted.

38 changes: 19 additions & 19 deletions scripts/paramdump.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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()