Comments (2)
I haven't figured out a good way to solve this either in anything I have written. I generally tend to let it fail like this:
try:
import open3d as o3d
except ImportError:
print("Please do 'pip install open3d' to use this feature")
raise
I don't totally like this, but haven't found another clean way to do it. It alerts the user to the missing library.
The next issue you have is the from .visualizer import visualize
will issue an error based on what I just suggested. So the answer is to remove the line from __init__.py
. However now that forces the user to do something like from tinyik.visualize import Visualizer
, which is different than the rest of the other workflow in your module. But this is typically what I have done.
Sorry for the rambling, but I don't have a good answer that I personally like. I think python didn't think through this very well and forces you to do a bunch of try
/except
statements which makes the code overly complex in places.
from tinyik.
Thanks you so much! I apologize for confusing you with the error.
The visualizer is not a core feature of tinyik. In order to keep the library as "tiny" as possible, it is set to extra.
If you install tinyik with no extra, open3d will not be installed and you will get the import error in the following facade module, so I'm bypassing the check to avoid it.
Line 10 in e32a25e
That said, I think you're right that this will confuse users who use the library exploratively. Is there any good way to solve this? Shouldn't we be using extra for this purpose in the first place?
from tinyik.
Related Issues (16)
- Prismatic joint support? HOT 1
- module 'tinyik' has no attribute 'visualize' HOT 2
- problem for using multiple solver in same time HOT 3
- Visualization results in a blank screen HOT 2
- proof of concept IK help for CAM application HOT 2
- Links that run along the Z-axis aren't shown in the visualizer HOT 2
- trouble with basic results HOT 4
- Constrained Angles for IK HOT 2
- How to create a 3-DoF rotation joint? HOT 1
- wrong visualization HOT 2
- Implementation of relative axis
- arm initial position and angles HOT 1
- joint angle limits
- DH Params conversion?
- How to set rotation/pose of the end effector?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinyik.