My main progress this week was getting hierarchical composition to finally work again. There were issues in the old robot compiler backend that seemed to have sorted themselves out when we rewrote it. The main issue I had to deal with to get hierarchical composition working again was fixing yaml serialization/deserialization. Since we replaced interfaces as a collection of ports with a wrapper class, this broke a lot of the serialization. Instead of storing the inherited interface as a subcomponent and subcomponent interface tuple, it became the interface itself that was passed up. To overcome this, I added a separate field in the Interface wrapper class to keep track of inheritance. The new class also broke connections, but I was able to use the same field to fix the serialization on that.

Another issue was the representation of symbols. We replaced the system with substituting symbol dummies with temporary symbols with just using dummies all the time. However, sympy appends underscores before the name of dummies to separate them from regular symbols. This was causing issues in re-constructing the constraints from a yaml file. I was able to fix this by overloading the str and repr functions in our subclassed Variable type to omit the underscore. There were also many other smaller changes such as changing the order of deserialization because some steps depending on ones that came later. For example, it was necessary to load the subcomponents before constraints as subcomponent parameters in the constraints do not exist before loading the subcomponents.

The image shows the hierarchy for a gripper. There is a knuckle made up of two trapezoids and a rectangle, a finger made up of two knuckles, and finally a gripper made from a rect beam and two fingers.

Next Post Previous Post