def convert_tmaps(root_dir, ext_old, ext_new):
        
    tmap_files = []
    for root, dirs, files in os.walk(root_dir):
        for _file in files:
            if _file.endswith(ext_old):
                 tmap_files.append(os.path.join(root, _file))
    
    mm = map_manager()
    for f in tmap_files:
        print "\n"
        rospy.loginfo("CONVERTING " + f)
        
        try:
            mm.init_map(f, load_from_file=True)
            mm.manager2.write_topological_map(os.path.splitext(f)[0] + ext_new)
        except Exception:
            rospy.logerr("Unable to convert {}\n{}".format(f, traceback.format_exc()))
Ejemplo n.º 2
0
#!/usr/bin/env python
import math
import rospy
import sys

import std_msgs.msg
from topological_navigation.topological_node import *
from strands_navigation_msgs.msg import TopologicalNode
from strands_navigation_msgs.msg import TopologicalMap

from mongodb_store.message_store import MessageStoreProxy

from topological_navigation.manager import map_manager


if __name__ == '__main__' :
    point_set = sys.argv[1]
    rospy.init_node("topological_map_manager")
    ps = map_manager(point_set)
    rospy.spin()
Ejemplo n.º 3
0
    print "\nFor loading a map from a tmap file:"
    print "\t rosrun topological_navigation map_manager.py -f map_filename"
    print "\nFor creating a new map:"
    print "\t rosrun topological_navigation map_manager.py -n map_name"
    print "\n\n"
    
    
    
if __name__ == '__main__' :
    load=True
    load_from_file = False
    if '-h' in sys.argv or '--help' in sys.argv or len(sys.argv) < 2 :
        usage()
        sys.exit(1)
    else:
        if '-n' in sys.argv:
            ind = sys.argv.index('-n')
            _map=sys.argv[ind+1]
            print "Creating new Map (%s)" %_map
            load=False
        elif '-f' in sys.argv:
            ind = sys.argv.index('-f')
            _map=sys.argv[ind+1]
            print "Loading map from tmap file (%s)" %_map
            load_from_file=True
        else:
            _map=sys.argv[1]

    rospy.init_node("topological_map_manager")
    ps = map_manager(_map,load,load_from_file)
    rospy.spin()
Ejemplo n.º 4
0
    print "\t rosrun topological_navigation map_manager.py -f map_filename"
    print "\nFor creating a new map:"
    print "\t rosrun topological_navigation map_manager.py -n map_name"
    print "\n\n"


if __name__ == '__main__':
    load = True
    load_from_file = False
    if '-h' in sys.argv or '--help' in sys.argv or len(sys.argv) < 2:
        usage()
        sys.exit(1)
    else:
        if '-n' in sys.argv:
            ind = sys.argv.index('-n')
            _map = sys.argv[ind + 1]
            print "Creating new Map (%s)" % _map
            load = False
        elif '-f' in sys.argv:
            ind = sys.argv.index('-f')
            _map = sys.argv[ind + 1]
            print "Loading map from tmap file (%s)" % _map
            load_from_file = True
        else:
            _map = sys.argv[1]

    rospy.init_node("topological_map_manager")
    ps = map_manager()
    ps.init_map(_map, load, load_from_file)
    rospy.spin()
#########################################################################################################
Ejemplo n.º 5
0
from topological_navigation.manager import map_manager


def usage():
    print "\nPublishes Topological Maps:"
    print "\nFor loading a map from the mongodb:"
    print "\t rosrun topological_navigation map_manager.py map_name"
    print "\nFor creating a new map:"
    print "\t rosrun topological_navigation map_manager.py -n map_name"
    print "\n\n"



if __name__ == '__main__' :
    load=True
    if '-h' in sys.argv or '--help' in sys.argv or len(sys.argv) < 2 :
        usage()
        sys.exit(1)
    else:
        if '-n' in sys.argv:
            ind = sys.argv.index('-n')
            point_set=sys.argv[ind+1]
            print "Creating new Map (%s)" %point_set
            load=False
        else:
            point_set=sys.argv[1]
            
    rospy.init_node("topological_map_manager")
    ps = map_manager(point_set,load)
    rospy.spin()