genmap.py: make top-left by default (#220)

* genmap.py: make top-left by default

* docs: make top left by default in genmap

* genmap.py: fix usage string
This commit is contained in:
Oleg Kalachev
2020-03-06 02:04:19 +03:00
committed by GitHub
parent a427d86f41
commit 351b33cc5f
3 changed files with 13 additions and 12 deletions

View File

@@ -13,17 +13,18 @@
Generate map file for aruco_map nodelet.
Usage:
genmap.py <length> <x> <y> <dist_x> <dist_y> <first> [--top-left]
genmap.py <length> <x> <y> <dist_x> <dist_y> <first> [--top-left | --bottom-left]
genmap.py (-h | --help)
Options:
<length> Marker side length
<x> Marker count along X axis
<y> Marker count along Y axis
<dist_x> Distance between markers along X axis
<dist_y> Distance between markers along Y axis
<first> First marker ID
--top-left First marker is on top-left (not bottom-left)
<length> Marker side length
<x> Marker count along X axis
<y> Marker count along Y axis
<dist_x> Distance between markers along X axis
<dist_y> Distance between markers along Y axis
<first> First marker ID
--top-left First marker is on top-left (default)
--bottom-left First marker is on bottom-left
"""
from __future__ import print_function
@@ -39,7 +40,7 @@ markers_x = int(arguments['<x>'])
markers_y = int(arguments['<y>'])
dist_x = float(arguments['<dist_x>'])
dist_y = float(arguments['<dist_y>'])
top_left = arguments['--top-left']
bottom_left = arguments['--bottom-left']
max_y = (markers_y - 1) * dist_y
@@ -47,7 +48,7 @@ for y in range(markers_y):
for x in range(markers_x):
pos_x = x * dist_x
pos_y = y * dist_y
if top_left:
if not bottom_left:
pos_y = max_y - pos_y
print('{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t'.format(first, length, pos_x, pos_y, 0, 0, 0, 0))
first += 1