Skip to content

Instantly share code, notes, and snippets.

View mikedh's full-sized avatar

Michael Dawson-Haggerty mikedh

View GitHub Profile
@mikedh
mikedh / cust16.glb.header.json
Created July 28, 2022 17:47
Byte alignment error
{
"scene": 0,
"scenes": [{ "nodes": [0] }],
"asset": {
"version": "2.0",
"generator": "https://github.com/mikedh/trimesh"
},
"accessors": [
{
"componentType": 5125,
# -*- coding: utf-8 -*-
"""
Simple coloring shader example.
Press any number key (not on the numpad) to change the triangle color
"""

robot-gltf

Summary

An effort to replace ROS packages describing a robot (a directory structure with URDF, SRDF, OBJ-MTL-STL-salad) with a single GLTF 2.0 GLB file including URDF and SRDF descriptions in the "extras" field of the GLTF header.

Proposed Robot-GLTF Format

  • All geometry is put into a GLTF 2.0 .GLB file.
  • Nodes in GLTF scene description are not used, but can be defined for visualization
  • The URDF and SRDF descriptions are stored in the extras field of the GLTF header.
  • Using the extras field keeps us completely compliant with the spec.
import os
cwd = os.path.abspath(os.path.expanduser(os.path.dirname(__file__)))
def backup(frag):
"""
Parse a string backwards to find the first value which can
be a variable name, parenthisized or bracked expression.