compas-dev / compas_fab

Robotic fabrication package for the COMPAS Framework.
https://compas.dev/compas_fab/
MIT License
108 stars 32 forks source link

Fix Trajectory data backward compatibility #311

Closed yijiangh closed 3 years ago

yijiangh commented 3 years ago

What type of change is this?

This PR includes a small fix to make compas_fab.robots.JointTrajectory's from_data compatible with json data generated before compas_fab 0.18.0, before the JointTrajectoryPoint class attributes values and types are changed to joint_values and joint_types, and the attached_collision_meshes attribute is introduced.

While I am very eager to try out all the exciting features introduced in the latest version, I found upgrading the version turned all of my previously saved JointTrajectory data unparsable. I understand that we cannot keep compatible with everything in the past, but I found being backward-compatible for a longer time period can be very beneficial.

This PR also includes a small fix to disable redirect_stdout when used in a Jupyter notebook environment. Jupyter notebook (ipython) will raise UnsupportedOperation on fileno(): https://github.com/ipython/ipython/pull/3072/. I suggest we can simply circumvent redirect_stdout since C output is hidden anyway by default in ipython, unless we use some external piping package like https://github.com/minrk/wurlitzer.

This PR is also related to https://github.com/compas-dev/compas/pull/867

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

beverlylytle commented 3 years ago

LGTM, too! The deploy-and-publish workflow is failing because one of the links is broken/dead. Maybe replace the link in line https://github.com/compas-dev/compas_fab/blob/53a053ea5e37ceecd08442cae58722634cf24079/src/compas_fab/robots/wrench.py#L376 with http://wseas.us/e-library/conferences/crete2002/papers/444-809.pdf

yijiangh commented 3 years ago

@beverlylytle I pushed another change to fix the link, now it seems to be good to go?

beverlylytle commented 3 years ago

Yep, it is! Thanks for improving the code!