Tarun:
I haven't kept up with pydy-viz, so I don't know helpful I can be. Maybe give me a better idea of what you want to know?
I imagine this hierarchy:
GUI model building, on top of:
modeling language / abstraction layer, on top of:
the current pydy interface.
Pydy-linkage was my first attempt at a modeling language. It was only going to work for linkages (i.e., chains) at first, but it seems now that that limitation should be lifted. Further, it assumed the underlying dynamics engine would be symbolic. Given recent discussion, it sounds like we would want to allow multiple underlying dynamics engines. It could take some work to create a nice interface that played well with various engines.
See
github.com/chrisdembia/pydy-linkage to see my sketch of this. I haven't thought much about how this works with visualization. I imagine the GUI would maintain an instance of a sys = MultibodySystem() object, and would make calls to methods like
sys.body_new(Body('link1'))
sys.body('link1').mass = 5
sys.body('ink1').shapes += [pydy_viz.Shape(...)]
sys.body('link1').origin = [symbol, symbol, symbol]
...
sys.controller_new(MyLQRController(K=python.contol.lqr(...)))
sys.visualize()
sys.integrate(time=5.0)
It might get confusing, because there are some differences I think in how symbolic vs numerical libraries expect a description of a model. We could get some good ideas from the interface of Simbody (for modeling and integration) and OpenSim (for controllers).
Ideally, the modeling language would allow serialization via JSON or XML. However, it seems that Tarun already accomplished this for pydy-viz. So maybe we could just use/adapt that.
Also, people want to do more than just visualize their system. They want to get time history data out (coordinates, tracking errors, controller signals). The MultibodySystem could provide this data, and the GUI application could display graphs of the data.
The GUI would be a client of the modeling layer and of pydy. This is similar to how OpenSim is an application on top of the Simbody library.
I'm happy to lay out more ideas with anyone who's interested.