Skip to content

Commit

Permalink
Minor modifications.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgerod committed Aug 7, 2019
1 parent 00b9d3c commit fbfbbf3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
29 changes: 14 additions & 15 deletions src/rosplan_pytools/controller/nodes/ros_server_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,6 @@ def add_element(self, name, message, metadata=''):
return False

msg_value = message_converter.convert_ros_message_to_dictionary(message)

# def replace_types_in_dictionary(dictionary):
#
# for k, v in dictionary.iteritems():
# if type(v) is dict:
# replace_types_in_dictionary(dictionary[k])
# else:
# if type(v) is float64:
# dictionary[k] = float(v)
#
# return dictionary
#
# print msg_value
# msg_value = replace_types_in_dictionary(msg_value)

element = {'name': name, 'metadata': metadata, 'uuid': str(uuid.uuid4()),
'msg_type': message.__class__._type,'msg_value': msg_value}

Expand Down Expand Up @@ -182,3 +167,17 @@ def _find_element_by_name(self, name):
element_id = -1

return element_key, element_id

# def _replace_types_in_dictionary(dictionary):
#
# for k, v in dictionary.iteritems():
# if type(v) is dict:
# replace_types_in_dictionary(dictionary[k])
# else:
# if type(v) is float64:
# dictionary[k] = float(v)
#
# return dictionary
#
# print msg_value
# msg_value = replace_types_in_dictionary(msg_value)
10 changes: 6 additions & 4 deletions src/rosplan_pytools/controller/nodes/scene_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ class ServiceNames(object):

class SceneDatabase(object):

def __init__(self, sdb_name, service_prefix):

if sdb_name is None:
sdb_name = 'scene_database'
def __init__(self, service_prefix, sdb_name='scene_database'):

self._lock = Lock()
self._ros_server = RosServerConnection(sdb_name)
Expand Down Expand Up @@ -154,6 +151,11 @@ def _remove_all_elements(self):
def start_node(name):

try:

NODE_NAME = name
SERVICE_NAME = name
DATABASE_NAME = name

rospy.init_node(name)
SceneDatabase(name, name)
rospy.spin()
Expand Down

0 comments on commit fbfbbf3

Please sign in to comment.