move_origin.py
Go to the documentation of this file.
1 #!/usr/bin/python
2 
3 """
4 Move origin of fiducial co-ordinate system
5 """
6 
7 import numpy, sys, os
8 from fiducial_slam.map import Map
9 
10 if __name__ == "__main__":
11  argc = len(sys.argv)
12  if argc != 4 and argc != 5:
13  print "Usage: %s x y z [file]" % sys.argv[0]
14  sys.exit(1)
15  offset = numpy.array([float(sys.argv[1]), float(sys.argv[2]), float(sys.argv[3])])
16  if argc == 5:
17  filename = sys.argv[4]
18  else:
19  filename = "~/.ros/slam/map.txt"
20  filename = os.path.expanduser(filename)
21  map = Map(filename)
22  fids = map.keys()
23  for fid in fids:
24  f = map[fid]
25  f.position += offset
26  map.save()


fiducial_slam
Author(s): Jim Vaughan
autogenerated on Tue Jun 1 2021 03:03:29