Изучить возможности плагина Phobos и объём доработок для интеграции в конвейер #52

Closed
opened 2023-03-07 16:48:59 +03:00 by movefasta · 29 comments
movefasta commented 2023-03-07 16:48:59 +03:00 (Migrated from gitlab.com)

Нужно рассматреть использование Phobos в качестве инструмента для подготовки моделей к экспорту в Gazebo.

На данный момент ведётся работа по выпуску версии Phobos'v2 в отдельной ветке. Работа ведётся весьма интенсивно. Прогресс по этой работе можно отслеживать по pullrequest https://github.com/dfki-ric/phobos/pull/264 . Я предложил нашу помощь в тестировании и доработке плагина - https://github.com/dfki-ric/phobos/pull/264#issuecomment-1464910472

Итак, нужно проверить (для версии v2)

  1. работоспособность плагина для экспорта SDF - как отдельного робота, так и сцены целиком (экспорт world)
  2. импорт URDF и SDF моделей, подготовленных извне
  3. степень полноты соответствия спецификации SDF.
Нужно рассматреть использование [Phobos](https://github.com/dfki-ric/phobos) в качестве инструмента для подготовки моделей к экспорту в Gazebo. На данный момент ведётся работа по выпуску версии Phobos'v2 в отдельной ветке. Работа ведётся весьма интенсивно. Прогресс по этой работе можно отслеживать по pullrequest https://github.com/dfki-ric/phobos/pull/264 . Я предложил нашу помощь в тестировании и доработке плагина - https://github.com/dfki-ric/phobos/pull/264#issuecomment-1464910472 Итак, нужно проверить (для версии v2) 1. работоспособность плагина для экспорта SDF - как отдельного робота, так и сцены целиком (экспорт world) 2. импорт URDF и SDF моделей, подготовленных извне 3. степень полноты соответствия спецификации SDF.
movefasta commented 2023-03-11 16:18:30 +03:00 (Migrated from gitlab.com)

changed the description

changed the description
movefasta commented 2023-03-11 16:18:35 +03:00 (Migrated from gitlab.com)

assigned to @brothermechanic

assigned to @brothermechanic
brothermechanic commented 2023-03-12 20:34:25 +03:00 (Migrated from gitlab.com)

интересная особенность фобоса
читает только в относительном формате (слева)
а в газебовском model: (справа) не читает

Screenshot_20230312_203230

интересная особенность фобоса читает только в относительном формате (слева) а в газебовском model: (справа) не читает ![Screenshot_20230312_203230](/uploads/fc2d39d74839fc41ac1fb90a1c5ee095/Screenshot_20230312_203230.jpg)
movefasta commented 2023-03-13 19:18:01 +03:00 (Migrated from gitlab.com)

Нам model://адреса не особо актуальны, так как у нас будут пути, но issue можно создать. Всяко полезная информация. Пусть знают. А вдруг уже и пофиксил во второй версии.

Нам model://адреса не особо актуальны, так как у нас будут пути, но issue можно создать. Всяко полезная информация. Пусть знают. А вдруг уже и пофиксил во второй версии.
brothermechanic commented 2023-03-14 08:07:16 +03:00 (Migrated from gitlab.com)

понял
хорошо, создам

вряд ли, я все ветки тестировал

понял хорошо, создам вряд ли, я все ветки тестировал
brothermechanic commented 2023-03-15 11:48:35 +03:00 (Migrated from gitlab.com)

импорт world будет поддерживаться в фобосе-2,1

scene support anyways as this is planned to be integrated in v2.1.0

https://github.com/dfki-ric/phobos/pull/264#issuecomment-1465669658

импорт world будет поддерживаться в фобосе-2,1 >scene support anyways as this is planned to be integrated in v2.1.0 https://github.com/dfki-ric/phobos/pull/264#issuecomment-1465669658
brothermechanic commented 2023-03-15 11:54:54 +03:00 (Migrated from gitlab.com)

тестовый мир
world.sdf

тестовый мир [world.sdf](/uploads/4f0025a619e6884079daa747281b6c0d/world.sdf)
brothermechanic commented 2023-03-17 11:21:59 +03:00 (Migrated from gitlab.com)

тестовый механизм SDF от @solid-sinusoid Assembly1.sdf

(получен из URDF от @3dcnc Assembly1.urdf)

тестовый механизм SDF от @solid-sinusoid [Assembly1.sdf](/uploads/2c6d8786e92f50574beac6bb73a9b503/Assembly1.sdf) (получен из URDF от @3dcnc [Assembly1.urdf](/uploads/8e4d505044623ea04b97dda942831d8b/Assembly1.urdf))
brothermechanic commented 2023-03-17 11:36:00 +03:00 (Migrated from gitlab.com)

Замечания к Phobos по импорту SDF механизма:

  • Импорт мешей без учета масштаба Blender сцены (1:1000) при импорте из Solid Works
  • Несоответствие осей мешей и данных SDF файла при импорте из Solid Works
  • Арматура в режиме Octahedral
  • Относительные координаты игнорируются (pre_v2.0.0)
  • Импорт лимитов неверен
  • Нельзя выбирать кости разных арматур
  • Импорт мешей с неверным шейдингом
  • ? Импорт материалов из SDF ?

TODO протестировать:

  • импорт массы
  • импорт симметрии
  • импорт текстур
Замечания к Phobos по импорту SDF механизма: - Импорт мешей без учета масштаба Blender сцены (1:1000) при импорте из Solid Works - Несоответствие осей мешей и данных SDF файла при импорте из Solid Works - Арматура в режиме Octahedral - Относительные координаты игнорируются (pre_v2.0.0) - Импорт лимитов неверен - Нельзя выбирать кости разных арматур - Импорт мешей с неверным шейдингом - ? Импорт материалов из SDF ? TODO протестировать: - импорт массы - импорт симметрии - импорт текстур
brothermechanic commented 2023-03-17 11:56:14 +03:00 (Migrated from gitlab.com)

Правленный SDF с моделями, работает как с phobos так и с gazebo

my_asm.zip

Screenshot_20230316_202749

Screenshot_20230316_202455

Правленный SDF с моделями, работает как с phobos так и с gazebo [my_asm.zip](/uploads/c08a2f9f79fbfe76d2a7e2d90fd47b66/my_asm.zip) ![Screenshot_20230316_202749](/uploads/7546023bb5c6d7012f074b3cc52ab7d0/Screenshot_20230316_202749.jpg) ![Screenshot_20230316_202455](/uploads/e31c3e0459cd600446c9f76dec638bcd/Screenshot_20230316_202455.jpg)
brothermechanic commented 2023-03-17 12:00:09 +03:00 (Migrated from gitlab.com)

@solid-sinusoid можешь проверить его на валидность?

@solid-sinusoid можешь проверить его на валидность?
brothermechanic commented 2023-03-17 19:31:38 +03:00 (Migrated from gitlab.com)

Замечания к Phobos по экспорту SDF механизма:

  • Экспорт мешей добавляет объект Plane, зачем?
  • Путь экспорта всегда относительный
Замечания к Phobos по экспорту SDF механизма: - Экспорт мешей добавляет объект Plane, зачем? - Путь экспорта всегда относительный
brothermechanic commented 2023-03-17 19:33:05 +03:00 (Migrated from gitlab.com)

Экспорт SDF из Phobos phobos.sdf

Экспорт SDF из Phobos [phobos.sdf](/uploads/72859adcb8dda9aa100eab15c4df3e21/phobos.sdf)
brothermechanic commented 2023-03-17 19:33:22 +03:00 (Migrated from gitlab.com)

@solid-sinusoid можешь проверить его на валидность?

@solid-sinusoid можешь проверить его на валидность?
brothermechanic commented 2023-03-17 19:41:04 +03:00 (Migrated from gitlab.com)

Ошибка импорта источника света sun.sdf

Traceback (most recent call last):
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/operators/io.py", line 283, in execute
    model = entity_io.entity_types[suffix]['import'](self.filepath)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/entities/sdf.py", line 1856, in importSDF
    if root.attrib['name']:
AttributeError: 'NoneType' object has no attribute 'attrib'

pre_v2.0.0

Traceback (most recent call last):
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 300, in execute
    robot = core.Robot(inputfile=self.filepath)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/core/robot.py", line 36, in __init__
    raise e
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/core/robot.py", line 31, in __init__
    super().__init__(xmlfile=xmlfile, submechanisms_file=submechanisms_file, smurffile=smurffile,
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/smurfrobot.py", line 94, in __init__
    base_robot = parse_xml(self.xmlfile)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/parser.py", line 44, in parse_xml
    xml_root = xml_root.findall("./model")[0]
IndexError: list index out of range
Ошибка импорта источника света [sun.sdf](/uploads/a11d8bd24caf78c388375499751721f4/sun.sdf) ```python Traceback (most recent call last): File "/home/bm/.config/blender/3.5/scripts/addons/phobos/operators/io.py", line 283, in execute model = entity_io.entity_types[suffix]['import'](self.filepath) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/entities/sdf.py", line 1856, in importSDF if root.attrib['name']: AttributeError: 'NoneType' object has no attribute 'attrib' ``` pre_v2.0.0 ```python Traceback (most recent call last): File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 300, in execute robot = core.Robot(inputfile=self.filepath) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/core/robot.py", line 36, in __init__ raise e File "/home/bm/.config/blender/3.5/scripts/addons/phobos/core/robot.py", line 31, in __init__ super().__init__(xmlfile=xmlfile, submechanisms_file=submechanisms_file, smurffile=smurffile, File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/smurfrobot.py", line 94, in __init__ base_robot = parse_xml(self.xmlfile) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/parser.py", line 44, in parse_xml xml_root = xml_root.findall("./model")[0] IndexError: list index out of range ```
brothermechanic commented 2023-03-17 19:43:37 +03:00 (Migrated from gitlab.com)

Ошибка импорта мира world_empty.sdf

Traceback (most recent call last):
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/operators/io.py", line 285, in execute
    models.buildModelFromDictionary(model)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/model/models.py", line 1252, in buildModelFromDictionary
    linkmodel.setLinkTransformations(model, root)
UnboundLocalError: local variable 'root' referenced before assignment

pre_v2.0.0

Traceback (most recent call last):
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 300, in execute
    robot = core.Robot(inputfile=self.filepath)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/core/robot.py", line 36, in __init__
    raise e
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/core/robot.py", line 31, in __init__
    super().__init__(xmlfile=xmlfile, submechanisms_file=submechanisms_file, smurffile=smurffile,
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/smurfrobot.py", line 94, in __init__
    base_robot = parse_xml(self.xmlfile)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/parser.py", line 44, in parse_xml
    xml_root = xml_root.findall("./model")[0]
IndexError: list index out of range
Ошибка импорта мира [world_empty.sdf](/uploads/8d4c2e44cb70248d2eed69c0434543d2/world_empty.sdf) ```python Traceback (most recent call last): File "/home/bm/.config/blender/3.5/scripts/addons/phobos/operators/io.py", line 285, in execute models.buildModelFromDictionary(model) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/model/models.py", line 1252, in buildModelFromDictionary linkmodel.setLinkTransformations(model, root) UnboundLocalError: local variable 'root' referenced before assignment ``` pre_v2.0.0 ```python Traceback (most recent call last): File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 300, in execute robot = core.Robot(inputfile=self.filepath) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/core/robot.py", line 36, in __init__ raise e File "/home/bm/.config/blender/3.5/scripts/addons/phobos/core/robot.py", line 31, in __init__ super().__init__(xmlfile=xmlfile, submechanisms_file=submechanisms_file, smurffile=smurffile, File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/smurfrobot.py", line 94, in __init__ base_robot = parse_xml(self.xmlfile) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/parser.py", line 44, in parse_xml xml_root = xml_root.findall("./model")[0] IndexError: list index out of range ```
brothermechanic commented 2023-03-17 20:18:47 +03:00 (Migrated from gitlab.com)

Дополнительные замечания к Phobos pre_v2.0.0

  • странная трансформация 3-й детали
    Screenshot_20230317_201059

  • не импортируется одинарная модель korobka.zip

Traceback (most recent call last):
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 301, in execute
    createRobot(robot)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/phobos2blender.py", line 455, in createRobot
    newlink = createLink(link)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/phobos2blender.py", line 209, in createLink
    geom = createGeometry(viscol, 'visual' if isinstance(viscol, representation.Visual) else "collision")
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/phobos2blender.py", line 88, in createGeometry
    newgeom.data = geometry.load_mesh()
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/representation.py", line 712, in load_mesh
    bpy.context.view_layer.objects.active = delete_objects[0]
IndexError: list index out of range
Дополнительные замечания к Phobos pre_v2.0.0 - странная трансформация 3-й детали ![Screenshot_20230317_201059](/uploads/9ee331d634b3500068ff2bc1b02117ec/Screenshot_20230317_201059.jpg) - не импортируется одинарная модель [korobka.zip](/uploads/5ce15fa4b559b8e3d14459c6d156833d/korobka.zip) ```python Traceback (most recent call last): File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 301, in execute createRobot(robot) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/phobos2blender.py", line 455, in createRobot newlink = createLink(link) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/phobos2blender.py", line 209, in createLink geom = createGeometry(viscol, 'visual' if isinstance(viscol, representation.Visual) else "collision") File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/phobos2blender.py", line 88, in createGeometry newgeom.data = geometry.load_mesh() File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/representation.py", line 712, in load_mesh bpy.context.view_layer.objects.active = delete_objects[0] IndexError: list index out of range ```
brothermechanic commented 2023-03-18 08:10:00 +03:00 (Migrated from gitlab.com)

URDF повторяет мытарства SDF my_asm.urdf

URDF повторяет мытарства SDF [my_asm.urdf](/uploads/02ca7d21b03504c4cb33e7a87e9650a2/my_asm.urdf)
brothermechanic commented 2023-03-18 08:10:17 +03:00 (Migrated from gitlab.com)

@solid-sinusoid можешь проверить его на валидность?

@solid-sinusoid можешь проверить его на валидность?
brothermechanic commented 2023-03-18 08:12:46 +03:00 (Migrated from gitlab.com)

Экспорт в URDF не работает в pre_v2.0.0

Error: Python: Traceback (most recent call last):
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 141, in invoke
    return self.execute(context)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 238, in execute
    self.exportModel(root, exportpath)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 156, in exportModel
    robot = deriveRobot(root)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/blender2phobos.py", line 659, in deriveRobot
    links=[deriveLink(obj) for obj in objectlist if obj.phobostype == 'link'],
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/blender2phobos.py", line 659, in <listcomp>
    links=[deriveLink(obj) for obj in objectlist if obj.phobostype == 'link'],
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/utils/validation.py", line 802, in validation_wrapper
    return function(obj, *args, logging=logging, **kwargs)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/blender2phobos.py", line 343, in deriveLink
    collisions.append(deriveCollision(part, logging=logging))
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/blender2phobos.py", line 140, in deriveCollision
    geometry=deriveGeometry(obj, duplicate_mesh),
NameError: name 'duplicate_mesh' is not defined. Did you mean: 'duplicat_mesh'?
Экспорт в URDF не работает в pre_v2.0.0 ```python Error: Python: Traceback (most recent call last): File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 141, in invoke return self.execute(context) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 238, in execute self.exportModel(root, exportpath) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 156, in exportModel robot = deriveRobot(root) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/blender2phobos.py", line 659, in deriveRobot links=[deriveLink(obj) for obj in objectlist if obj.phobostype == 'link'], File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/blender2phobos.py", line 659, in <listcomp> links=[deriveLink(obj) for obj in objectlist if obj.phobostype == 'link'], File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/utils/validation.py", line 802, in validation_wrapper return function(obj, *args, logging=logging, **kwargs) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/blender2phobos.py", line 343, in deriveLink collisions.append(deriveCollision(part, logging=logging)) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/blender2phobos.py", line 140, in deriveCollision geometry=deriveGeometry(obj, duplicate_mesh), NameError: name 'duplicate_mesh' is not defined. Did you mean: 'duplicat_mesh'? ```
brothermechanic commented 2023-03-18 08:17:31 +03:00 (Migrated from gitlab.com)

Пример экспорта в URDF phobos.urdf

Пример экспорта в URDF [phobos.urdf](/uploads/99536cf8eb357d3031a6fb133d7d81f0/phobos.urdf)
solid-sinusoid commented 2023-03-18 08:25:43 +03:00 (Migrated from gitlab.com)

Ближайшие пару недель не смогу ничего проверить, так что как-то самостоятельно. Либо пусть попробует @IDONTSUDO запустить у себя посмотреть. Сам можешь проверить на текущей версии газебо

Ближайшие пару недель не смогу ничего проверить, так что как-то самостоятельно. Либо пусть попробует @IDONTSUDO запустить у себя посмотреть. Сам можешь проверить на текущей версии газебо
IDONTSUDO commented 2023-03-18 18:12:40 +03:00 (Migrated from gitlab.com)

@brothermechanic то что ты написал можешь проверить проверить нельзя так как оно привязано к STL который хранится у тебя на компе

@brothermechanic то что ты написал можешь проверить проверить нельзя так как оно привязано к STL который хранится у тебя на компе
brothermechanic commented 2023-03-21 11:27:15 +03:00 (Migrated from gitlab.com)

импорт составного SDF combo.zip

master

Traceback (most recent call last):
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/operators/io.py", line 285, in execute
    models.buildModelFromDictionary(model)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/model/models.py", line 1252, in buildModelFromDictionary
    linkmodel.setLinkTransformations(model, root)
UnboundLocalError: local variable 'root' referenced before assignment

pre_v2.0.0

Traceback (most recent call last):
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 301, in execute
    createRobot(robot)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/phobos2blender.py", line 471, in createRobot
    rootlink = newlinks[str(robot.get_root())]
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/xmlrobot.py", line 400, in get_root
    assert root is not None, "No roots detected, invalid URDF."
AssertionError: No roots detected, invalid URDF.
импорт составного SDF [combo.zip](/uploads/12c623ead916e6eca6895ed4b0142b63/combo.zip) master ```py Traceback (most recent call last): File "/home/bm/.config/blender/3.5/scripts/addons/phobos/operators/io.py", line 285, in execute models.buildModelFromDictionary(model) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/model/models.py", line 1252, in buildModelFromDictionary linkmodel.setLinkTransformations(model, root) UnboundLocalError: local variable 'root' referenced before assignment ``` pre_v2.0.0 ```py Traceback (most recent call last): File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 301, in execute createRobot(robot) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/phobos2blender.py", line 471, in createRobot rootlink = newlinks[str(robot.get_root())] File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/xmlrobot.py", line 400, in get_root assert root is not None, "No roots detected, invalid URDF." AssertionError: No roots detected, invalid URDF. ```
brothermechanic commented 2023-03-22 09:40:45 +03:00 (Migrated from gitlab.com)

git branch pre_v2.0.0
git slice dfki-ric/phobos@1dc7d06a45
import issues:

  • Can't to get working relative paths
    if I import SDF from some path like //my_model/my_model.sdf with relative meshes to this sdf like model://my_model/model/my_model.stl I get this error:
    Mesh with path /media/disk/robossembler/project/pipeline/refs/paleta/model:/paleta/model/paleta.dae wasn't found!
    So, for now I use absolute paths.

  • Can't import combined SDF (with included child SDFs) like

<?xml version="1.0" encoding="utf-8"?>
<sdf version="1.9">
  <model name="combo-model">
    <pose>0 0 1 0 0 0</pose>
    <include>
      <name>model-1</name>
      <uri>~/model-1</uri>
      <pose>0 0 0 0 0 0</pose>
    </include>
    <include>
      <name>model-2</name>
      <uri>~/model-2</uri>
      <pose>0 0 0 0 0 0</pose>
    </include>
  </model>
</sdf>

I get this error with combined SDFs

Traceback (most recent call last):
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 301, in execute
    createRobot(robot)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/phobos2blender.py", line 474, in createRobot
    rootlink = newlinks[str(robot.get_root())]
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/xmlrobot.py", line 400, in get_root
    assert root is not None, "No roots detected, invalid URDF."
AssertionError: No roots detected, invalid URDF.
Traceback (most recent call last):
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 300, in execute
    robot = core.Robot(inputfile=self.filepath)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/core/robot.py", line 38, in __init__
    raise e
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/core/robot.py", line 32, in __init__
    super().__init__(xmlfile=xmlfile, submechanisms_file=submechanisms_file, smurffile=smurffile,
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/smurfrobot.py", line 94, in __init__
    base_robot = parse_xml(self.xmlfile)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/parser.py", line 42, in parse_xml
    return World.from_xml(xml_root.findall("./world")[0], dialect=file_type, _xmlfile=xml_file)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/base.py", line 322, in from_xml
    return cls.factory[dialect].from_xml(cls, xml, **kwargs)
KeyError: 'sdf'
  • Scaling conversion issue.
    As you may already know, 1 unit in blender and gazebo = 1 metter, however for other software (for ex. FreeCAD, Cura etc...) it will be 1 mm (in 1000 times smaller).
    What scale is recommended for phobos? Blender like or FreeCAD like?
    How do you solve scale incompatibility?

  • Axes Mismatch.
    When exporting from Solid Works with the SDF plugin, there is a problem that for SDF Z axis as up, and for meshes Y axis as up.
    Can you give an advice for this?

  • Armature (joints) silhouettes visually block the model.
    I would like to suggest to you, let me make new mesh silhouettes for armature, wire like?

  • Degrees of freedom to > Bone Constraints
    Looks like you have wirk in progress for it? It's don't works right.

  • There are problems with mesh shadings like shading groups, hard edges and autosmoth.

  • A similar import issues has urdf format.

I'm still learning phobos, like object's attributes and exporting, so if you don't mind, I plan to add my comments in the future.

Best regards.

git branch pre_v2.0.0 git slice https://github.com/dfki-ric/phobos/tree/1dc7d06a45c949bb1f309f206aa0e91220253645 import issues: - Can't to get working relative paths if I import SDF from some path like /<somepath>/my_model/my_model.sdf with relative meshes to this sdf like <uri>model://my_model/model/my_model.stl</uri> I get this error: `Mesh with path /media/disk/robossembler/project/pipeline/refs/paleta/model:/paleta/model/paleta.dae wasn't found!` So, for now I use absolute paths. - Can't import combined SDF (with included child SDFs) like ```xml <?xml version="1.0" encoding="utf-8"?> <sdf version="1.9"> <model name="combo-model"> <pose>0 0 1 0 0 0</pose> <include> <name>model-1</name> <uri>~/model-1</uri> <pose>0 0 0 0 0 0</pose> </include> <include> <name>model-2</name> <uri>~/model-2</uri> <pose>0 0 0 0 0 0</pose> </include> </model> </sdf> ``` I get this error with combined SDFs ``` Traceback (most recent call last): File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 301, in execute createRobot(robot) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/phobos2blender.py", line 474, in createRobot rootlink = newlinks[str(robot.get_root())] File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/xmlrobot.py", line 400, in get_root assert root is not None, "No roots detected, invalid URDF." AssertionError: No roots detected, invalid URDF. ``` - Can't import 'world' [world_empty.sdf](/uploads/ad9fa04a3f190ceba6b23b0b73cde38a/world_empty.sdf) ``` Traceback (most recent call last): File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 300, in execute robot = core.Robot(inputfile=self.filepath) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/core/robot.py", line 38, in __init__ raise e File "/home/bm/.config/blender/3.5/scripts/addons/phobos/core/robot.py", line 32, in __init__ super().__init__(xmlfile=xmlfile, submechanisms_file=submechanisms_file, smurffile=smurffile, File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/smurfrobot.py", line 94, in __init__ base_robot = parse_xml(self.xmlfile) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/parser.py", line 42, in parse_xml return World.from_xml(xml_root.findall("./world")[0], dialect=file_type, _xmlfile=xml_file) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/base.py", line 322, in from_xml return cls.factory[dialect].from_xml(cls, xml, **kwargs) KeyError: 'sdf' ``` - Scaling conversion issue. As you may already know, 1 unit in blender and gazebo = 1 metter, however for other software (for ex. FreeCAD, Cura etc...) it will be 1 mm (in 1000 times smaller). What scale is recommended for phobos? Blender like or FreeCAD like? How do you solve scale incompatibility? - Axes Mismatch. When exporting from Solid Works with the [SDF plugin](https://www.youtube.com/playlist?list=PLC-SsBhVny0XrRpYoofHT39dGeGe51UAa), there is a problem that for SDF Z axis as up, and for meshes Y axis as up. Can you give an advice for this? - Armature (joints) silhouettes visually block the model. I would like to suggest to you, let me make new mesh silhouettes for armature, [wire](https://ddz4ak4pa3d19.cloudfront.net/cache/15/13/151336245111ab45404a399431a095a5.jpg) like? - Degrees of freedom to > Bone Constraints Looks like you have wirk in progress for it? It's don't works right. - There are problems with mesh shadings like shading groups, hard edges and autosmoth. - A similar import issues has urdf format. I'm still learning phobos, like object's attributes and exporting, so if you don't mind, I plan to add my comments in the future. Best regards.
brothermechanic commented 2023-04-26 21:25:12 +03:00 (Migrated from gitlab.com)

пример экспорта модели grip_tool размеченной мной в фобос

<?xml version="1.0"?>
<!-- created with Phobos 1.0.1 "Capricious Choutengan" -->
<sdf version="1.5">
  <model name="grip_tool">
    <link name="root">
      <pose>0 0 0 0 0 0</pose>
      <collision name="mount_lp.001">
        <pose>0 0 0 0 0 0</pose>
        <geometry>
          <mesh>
            <uri>model://grip_tool/meshes/Part__Feature.002.dae</uri>
            <scale>1.0 1.0 1.0</scale>
          </mesh>
        </geometry>
      </collision>
      <visual name="mount_lp.001">
        <pose>0.0 0.0 0.0 0.0 -0.0 0.0</pose>
        <material>
          <ambient>0.8 0.8 0.8 1.0</ambient>
          <diffuse>0.8 0.8 0.8 1.0</diffuse>
          <specular>0.5 0.5 0.5 1.0</specular>
        </material>
        <geometry>
          <mesh>
            <uri>model://grip_tool/meshes/Part__Feature.003.dae</uri>
            <scale>1.0 1.0 1.0</scale>
          </mesh>
        </geometry>
      </visual>
    </link>
    <link name="link_grip_rotator">
      <pose>0 0 0.1095 0 0 0</pose>
      <collision name="grip_rotator_lp.001">
        <pose>0 0 0 0 0 0</pose>
        <geometry>
          <mesh>
            <uri>model://grip_tool/meshes/Part__Feature007.002.dae</uri>
            <scale>1.0 1.0 1.0</scale>
          </mesh>
        </geometry>
      </collision>
      <visual name="grip_rotator_lp.001">
        <pose>0.0 0.0 0.0 0.0 -0.0 0.0</pose>
        <material>
          <ambient>0.8 0.8 0.8 1.0</ambient>
          <diffuse>0.8 0.8 0.8 1.0</diffuse>
          <specular>0.5 0.5 0.5 1.0</specular>
        </material>
        <geometry>
          <mesh>
            <uri>model://grip_tool/meshes/Part__Feature007.003.dae</uri>
            <scale>1.0 1.0 1.0</scale>
          </mesh>
        </geometry>
      </visual>
    </link>
    <link name="link_grip1">
      <pose>0.068 0.02375 0.1145 0 1.5708 0</pose>
      <collision name="grip1_lp.001">
        <pose>0 0 0 0 -1.5708 0</pose>
        <geometry>
          <mesh>
            <uri>model://grip_tool/meshes/grip.004.dae</uri>
            <scale>1.0 1.0 1.0</scale>
          </mesh>
        </geometry>
      </collision>
      <visual name="grip1_lp.001">
        <pose>-2.3167228135889673e-09 0.0 0.0 -0.0 -1.570796251296997 0.0</pose>
        <material>
          <ambient>0.8 0.8 0.8 1.0</ambient>
          <diffuse>0.8 0.8 0.8 1.0</diffuse>
          <specular>0.5 0.5 0.5 1.0</specular>
        </material>
        <geometry>
          <mesh>
            <uri>model://grip_tool/meshes/grip.005.dae</uri>
            <scale>1.0 1.0 1.0</scale>
          </mesh>
        </geometry>
      </visual>
    </link>
    <link name="link_grip2">
      <pose>-0.068 -0.02375 0.1145 3.14159 1.5708 0</pose>
      <collision name="grip2_lp.001">
        <pose>0 0 0 0 -1.5708 0</pose>
        <geometry>
          <mesh>
            <uri>model://grip_tool/meshes/grip.003.dae</uri>
            <scale>1.0 1.0 1.0</scale>
          </mesh>
        </geometry>
      </collision>
      <visual name="grip2_lp.001">
        <pose>1.661072168701594e-09 0.0 0.0 -1.7021841970882648e-14 -1.5707961320877075 0.0</pose>
        <material>
          <ambient>0.8 0.8 0.8 1.0</ambient>
          <diffuse>0.8 0.8 0.8 1.0</diffuse>
          <specular>0.5 0.5 0.5 1.0</specular>
        </material>
        <geometry>
          <mesh>
            <uri>model://grip_tool/meshes/grip.006.dae</uri>
            <scale>1.0 1.0 1.0</scale>
          </mesh>
        </geometry>
      </visual>
    </link>
    <joint name="link_grip_rotator" type="revolute">
      <parent>root</parent>
      <child>link_grip_rotator</child>
      <pose>0.0 0.0 0.0 0.0 0.0 0.0</pose>
      <axis>
        <xyz>0 0 1.0</xyz>
        <limit>
          <lower></lower>
          <upper></upper>
          <effort>2.0</effort>
          <velocity>1.0</velocity>
        </limit>
      </axis>
    </joint>
    <joint name="link_grip1" type="prismatic">
      <parent>link_grip_rotator</parent>
      <child>link_grip1</child>
      <pose>0.0 0.0 0.0 0.0 0.0 0.0</pose>
      <axis>
        <xyz>0 0 1.0</xyz>
        <limit>
          <lower>-0.05</lower>
          <upper>0</upper>
          <effort>2.0</effort>
          <velocity>1.0</velocity>
        </limit>
      </axis>
    </joint>
    <joint name="link_grip2" type="prismatic">
      <parent>link_grip_rotator</parent>
      <child>link_grip2</child>
      <pose>0.0 0.0 0.0 0.0 0.0 0.0</pose>
      <axis>
        <xyz>0 0 1.0</xyz>
        <limit>
          <lower>-0.05</lower>
          <upper>0</upper>
          <effort>2.0</effort>
          <velocity>1.0</velocity>
        </limit>
      </axis>
    </joint>
  </model>
</sdf>
пример экспорта модели grip_tool размеченной мной в фобос ```xml <?xml version="1.0"?> <!-- created with Phobos 1.0.1 "Capricious Choutengan" --> <sdf version="1.5"> <model name="grip_tool"> <link name="root"> <pose>0 0 0 0 0 0</pose> <collision name="mount_lp.001"> <pose>0 0 0 0 0 0</pose> <geometry> <mesh> <uri>model://grip_tool/meshes/Part__Feature.002.dae</uri> <scale>1.0 1.0 1.0</scale> </mesh> </geometry> </collision> <visual name="mount_lp.001"> <pose>0.0 0.0 0.0 0.0 -0.0 0.0</pose> <material> <ambient>0.8 0.8 0.8 1.0</ambient> <diffuse>0.8 0.8 0.8 1.0</diffuse> <specular>0.5 0.5 0.5 1.0</specular> </material> <geometry> <mesh> <uri>model://grip_tool/meshes/Part__Feature.003.dae</uri> <scale>1.0 1.0 1.0</scale> </mesh> </geometry> </visual> </link> <link name="link_grip_rotator"> <pose>0 0 0.1095 0 0 0</pose> <collision name="grip_rotator_lp.001"> <pose>0 0 0 0 0 0</pose> <geometry> <mesh> <uri>model://grip_tool/meshes/Part__Feature007.002.dae</uri> <scale>1.0 1.0 1.0</scale> </mesh> </geometry> </collision> <visual name="grip_rotator_lp.001"> <pose>0.0 0.0 0.0 0.0 -0.0 0.0</pose> <material> <ambient>0.8 0.8 0.8 1.0</ambient> <diffuse>0.8 0.8 0.8 1.0</diffuse> <specular>0.5 0.5 0.5 1.0</specular> </material> <geometry> <mesh> <uri>model://grip_tool/meshes/Part__Feature007.003.dae</uri> <scale>1.0 1.0 1.0</scale> </mesh> </geometry> </visual> </link> <link name="link_grip1"> <pose>0.068 0.02375 0.1145 0 1.5708 0</pose> <collision name="grip1_lp.001"> <pose>0 0 0 0 -1.5708 0</pose> <geometry> <mesh> <uri>model://grip_tool/meshes/grip.004.dae</uri> <scale>1.0 1.0 1.0</scale> </mesh> </geometry> </collision> <visual name="grip1_lp.001"> <pose>-2.3167228135889673e-09 0.0 0.0 -0.0 -1.570796251296997 0.0</pose> <material> <ambient>0.8 0.8 0.8 1.0</ambient> <diffuse>0.8 0.8 0.8 1.0</diffuse> <specular>0.5 0.5 0.5 1.0</specular> </material> <geometry> <mesh> <uri>model://grip_tool/meshes/grip.005.dae</uri> <scale>1.0 1.0 1.0</scale> </mesh> </geometry> </visual> </link> <link name="link_grip2"> <pose>-0.068 -0.02375 0.1145 3.14159 1.5708 0</pose> <collision name="grip2_lp.001"> <pose>0 0 0 0 -1.5708 0</pose> <geometry> <mesh> <uri>model://grip_tool/meshes/grip.003.dae</uri> <scale>1.0 1.0 1.0</scale> </mesh> </geometry> </collision> <visual name="grip2_lp.001"> <pose>1.661072168701594e-09 0.0 0.0 -1.7021841970882648e-14 -1.5707961320877075 0.0</pose> <material> <ambient>0.8 0.8 0.8 1.0</ambient> <diffuse>0.8 0.8 0.8 1.0</diffuse> <specular>0.5 0.5 0.5 1.0</specular> </material> <geometry> <mesh> <uri>model://grip_tool/meshes/grip.006.dae</uri> <scale>1.0 1.0 1.0</scale> </mesh> </geometry> </visual> </link> <joint name="link_grip_rotator" type="revolute"> <parent>root</parent> <child>link_grip_rotator</child> <pose>0.0 0.0 0.0 0.0 0.0 0.0</pose> <axis> <xyz>0 0 1.0</xyz> <limit> <lower></lower> <upper></upper> <effort>2.0</effort> <velocity>1.0</velocity> </limit> </axis> </joint> <joint name="link_grip1" type="prismatic"> <parent>link_grip_rotator</parent> <child>link_grip1</child> <pose>0.0 0.0 0.0 0.0 0.0 0.0</pose> <axis> <xyz>0 0 1.0</xyz> <limit> <lower>-0.05</lower> <upper>0</upper> <effort>2.0</effort> <velocity>1.0</velocity> </limit> </axis> </joint> <joint name="link_grip2" type="prismatic"> <parent>link_grip_rotator</parent> <child>link_grip2</child> <pose>0.0 0.0 0.0 0.0 0.0 0.0</pose> <axis> <xyz>0 0 1.0</xyz> <limit> <lower>-0.05</lower> <upper>0</upper> <effort>2.0</effort> <velocity>1.0</velocity> </limit> </axis> </joint> </model> </sdf> ```
brothermechanic commented 2023-04-26 21:26:43 +03:00 (Migrated from gitlab.com)

Screenshot_20230426_212337

![Screenshot_20230426_212337](/uploads/26726b630ec6041cc04e841b6ef21bfb/Screenshot_20230426_212337.jpg)
brothermechanic commented 2023-04-26 21:27:22 +03:00 (Migrated from gitlab.com)

Алгоритм разметки Phobos

Screenshot_20230426_165410

Алгоритм разметки Phobos ![Screenshot_20230426_165410](/uploads/3193542071a25a40387bd5501d04f4b9/Screenshot_20230426_165410.jpg)
brothermechanic commented 2023-05-02 17:59:00 +03:00 (Migrated from gitlab.com)

баги последней фиксации второй ветки

bpy.ops.phobos.create_links()

Error: Python: Traceback (most recent call last):
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/editing.py", line 1972, in execute
    modellinks.deriveLinkfromObject(
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/model/links.py", line 70, in deriveLinkfromObject
    link = createLink({'scale': scale, 'name': linkname, 'matrix': obj.matrix_world})
NameError: name 'createLink' is not defined


bpy.ops.phobos.create_collision_objects()

Error: Python: Traceback (most recent call last):
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/editing.py", line 1343, in execute
    bpy.ops.object.transform_apply(location=False, rotation=False, scale=True, properties=False)
  File "/usr/share/blender/3.5/scripts/modules/bpy/ops.py", line 113, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: Cannot apply to a multi user: Object "grip_rotator_collision", Mesh "Part__Feature007.003", aborting


bpy.ops.phobos.add_motor()

Error: Python: Traceback (most recent call last):
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/editing.py", line 1855, in execute
    type=self.controllerType,
  File "/usr/share/blender/3.5/scripts/modules/bpy_types.py", line 816, in __getattribute__
    return super().__getattribute__(attr)
AttributeError: 'AddMotorOperator' object has no attribute 'controllerType'


bpy.ops.phobos.export_model()

Error: Python: Traceback (most recent call last):
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 141, in invoke
    return self.execute(context)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 254, in execute
    self.exportModel(root, exportpath)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 156, in exportModel
    robot = deriveRobot(root)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/blender2phobos.py", line 700, in deriveRobot
    xml_robot = xmlrobot.XMLRobot(
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/xmlrobot.py", line 75, in __init__
    self.link_entities()
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/xmlrobot.py", line 102, in link_entities
    entity.link_with_robot(self, check_linkage_later=True)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/representation.py", line 1615, in link_with_robot
    super(Joint, self).link_with_robot(robot, check_linkage_later=True)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/base.py", line 130, in link_with_robot
    self._attr_set_name(attribute, getattr(self, "_" + attribute), no_check=True)
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/base.py", line 89, in _attr_set_name
    setattr(self, "_" + attribute, self._converter(attribute, new_value))
  File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/base.py", line 75, in _converter
    raise AssertionError(f"{str(type(self))}, can not convert {new_value} to value type {vtype} for variable {varname}")
AssertionError: <class 'phobos.io.representation.Joint'>, can not convert grip_rotator_link_joint_motor to value type motors for variable motor
баги последней фиксации второй ветки ``` bpy.ops.phobos.create_links() Error: Python: Traceback (most recent call last): File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/editing.py", line 1972, in execute modellinks.deriveLinkfromObject( File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/model/links.py", line 70, in deriveLinkfromObject link = createLink({'scale': scale, 'name': linkname, 'matrix': obj.matrix_world}) NameError: name 'createLink' is not defined bpy.ops.phobos.create_collision_objects() Error: Python: Traceback (most recent call last): File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/editing.py", line 1343, in execute bpy.ops.object.transform_apply(location=False, rotation=False, scale=True, properties=False) File "/usr/share/blender/3.5/scripts/modules/bpy/ops.py", line 113, in __call__ ret = _op_call(self.idname_py(), None, kw) RuntimeError: Error: Cannot apply to a multi user: Object "grip_rotator_collision", Mesh "Part__Feature007.003", aborting bpy.ops.phobos.add_motor() Error: Python: Traceback (most recent call last): File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/editing.py", line 1855, in execute type=self.controllerType, File "/usr/share/blender/3.5/scripts/modules/bpy_types.py", line 816, in __getattribute__ return super().__getattribute__(attr) AttributeError: 'AddMotorOperator' object has no attribute 'controllerType' bpy.ops.phobos.export_model() Error: Python: Traceback (most recent call last): File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 141, in invoke return self.execute(context) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 254, in execute self.exportModel(root, exportpath) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/operators/io.py", line 156, in exportModel robot = deriveRobot(root) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/blender/io/blender2phobos.py", line 700, in deriveRobot xml_robot = xmlrobot.XMLRobot( File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/xmlrobot.py", line 75, in __init__ self.link_entities() File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/xmlrobot.py", line 102, in link_entities entity.link_with_robot(self, check_linkage_later=True) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/representation.py", line 1615, in link_with_robot super(Joint, self).link_with_robot(robot, check_linkage_later=True) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/base.py", line 130, in link_with_robot self._attr_set_name(attribute, getattr(self, "_" + attribute), no_check=True) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/base.py", line 89, in _attr_set_name setattr(self, "_" + attribute, self._converter(attribute, new_value)) File "/home/bm/.config/blender/3.5/scripts/addons/phobos/io/base.py", line 75, in _converter raise AssertionError(f"{str(type(self))}, can not convert {new_value} to value type {vtype} for variable {varname}") AssertionError: <class 'phobos.io.representation.Joint'>, can not convert grip_rotator_link_joint_motor to value type motors for variable motor ```
brothermechanic (Migrated from gitlab.com) closed this issue 2023-05-10 15:31:52 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
robossembler/framework#52
No description provided.