5 TPL =
"../urdf/human-tpl.xacro"
7 parser = argparse.ArgumentParser(description=
"Generate the URDF of a human.")
9 "-i",
"--id", type=str, default=
"", help=
"the person's unique ID (default: empty)"
16 help=
"length of the upperarm, in cm (default: 20)",
23 help=
"length of the forearm, in cm (default: 30)",
30 help=
"torso height, in cm (default: 30)",
34 "--shoulder-to-shoulder",
37 help=
"distance between the two shoulders, in cm (default: 50)",
40 args = parser.parse_args()
44 "upperarm_length":
str(args.upperarm_length / 100.0),
45 "forearm_length":
str(args.forearm_length / 100.0),
46 "torso_height":
str(args.torso_height / 100.0),
47 "neck_shoulder_length":
str((args.shoulder_to_shoulder / 100.0) / 2),
50 print(xacro.process_file(TPL, mappings=params).toprettyxml(indent=
" "))