-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Urdf pybullet #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice :)
kscale/store/cli.py
Outdated
match parsed_args.subcommand: | ||
case "urdf": | ||
urdf.main(remaining_args) | ||
case "urdf": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo?
kscale/store/pybullet.py
Outdated
p.addUserDebugLine(pt[0], pt[1], color, 1, parentObjectUniqueId=obj_id, parentLinkIndex=link_id) | ||
p.addUserDebugLine(pt[1], pt[3], color, 1, parentObjectUniqueId=obj_id, parentLinkIndex=link_id) | ||
p.addUserDebugLine(pt[3], pt[2], color, 1, parentObjectUniqueId=obj_id, parentLinkIndex=link_id) | ||
p.addUserDebugLine(pt[2], pt[0], color, 1, parentObjectUniqueId=obj_id, parentLinkIndex=link_id) | ||
|
||
p.addUserDebugLine(pt[0], pt[4], color, 1, parentObjectUniqueId=obj_id, parentLinkIndex=link_id) | ||
p.addUserDebugLine(pt[1], pt[5], color, 1, parentObjectUniqueId=obj_id, parentLinkIndex=link_id) | ||
p.addUserDebugLine(pt[2], pt[6], color, 1, parentObjectUniqueId=obj_id, parentLinkIndex=link_id) | ||
p.addUserDebugLine(pt[3], pt[7], color, 1, parentObjectUniqueId=obj_id, parentLinkIndex=link_id) | ||
|
||
p.addUserDebugLine(pt[4 + 0], pt[4 + 1], color, 1, parentObjectUniqueId=obj_id, parentLinkIndex=link_id) | ||
p.addUserDebugLine(pt[4 + 1], pt[4 + 3], color, 1, parentObjectUniqueId=obj_id, parentLinkIndex=link_id) | ||
p.addUserDebugLine(pt[4 + 3], pt[4 + 2], color, 1, parentObjectUniqueId=obj_id, parentLinkIndex=link_id) | ||
p.addUserDebugLine(pt[4 + 2], pt[4 + 0], color, 1, parentObjectUniqueId=obj_id, parentLinkIndex=link_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there must be a way to clean this up...
kscale/store/pybullet.py
Outdated
pt = [ | ||
[half_extents[0], half_extents[1], half_extents[2]], | ||
[-half_extents[0], half_extents[1], half_extents[2]], | ||
[half_extents[0], -half_extents[1], half_extents[2]], | ||
[-half_extents[0], -half_extents[1], half_extents[2]], | ||
[half_extents[0], half_extents[1], -half_extents[2]], | ||
[-half_extents[0], half_extents[1], -half_extents[2]], | ||
[half_extents[0], -half_extents[1], -half_extents[2]], | ||
[-half_extents[0], -half_extents[1], -half_extents[2]], | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, probably can clean up
kscale/store/urdf.py
Outdated
def fetch_urdf_info(listing_id: str) -> dict: | ||
url = f"https://api.kscale.store/urdf/info/{listing_id}" | ||
response = requests.get(url) | ||
response.raise_for_status() | ||
return response.json() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe there should be a way to use the auto-generated pydantic types here so that you don't have untyped requests and responses, however, i haven't figured it out yet
kscale/store/urdf.py
Outdated
filename = os.path.join(cache_dir, artifact_url.split("/")[-1]) | ||
|
||
if not os.path.exists(filename): | ||
logger.info(f"Downloading artifact from {artifact_url}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: don't use format strings in logger messages
logger.info(f"Downloading artifact from {artifact_url}") | |
logger.info("Downloading artifact from %s", artifact_url) |
kscale/store/urdf.py
Outdated
artifact_url = urdf_info["urdf"]["url"] | ||
download_artifact(artifact_url, CACHE_DIR) | ||
except requests.RequestException as e: | ||
logger.error(f"Failed to fetch URDF info: {e}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto with earlier
kscale/store/urdf.py
Outdated
urdf_info = fetch_urdf_info(listing_id) | ||
artifact_url = urdf_info["urdf"]["url"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should pre-parse with pydantic so we can use dot lookup instead of going by dict keys
kscale/store/urdf.py
Outdated
logger.error(f"Failed to upload artifact: {e}") | ||
sys.exit(1) | ||
else: | ||
print("Invalid command") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print statements make me sad :(
[options.entry_points] | ||
|
||
console_scripts = | ||
kscale = kscale.store.cli:main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
setup.py
Outdated
@@ -32,7 +32,7 @@ | |||
url="https://github.com/kscalelabs/kscale", | |||
long_description=long_description, | |||
long_description_content_type="text/markdown", | |||
python_requires=">=3.11", | |||
# python_requires=">=3.11", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sad :( we should add this back
changed all but pydantic stuff |
…-- i think it's probably a problem on the fastapi end though
URDF + Pybullet CLI. Closes #1
There is bug in /store. Downloaded files are given .stl when they are .obj. Results in invalid .stls