optas icon indicating copy to clipboard operation
optas copied to clipboard

Issue with visualizer

Open cmower opened this issue 2 years ago • 5 comments

I'm not sure when this happened, but the LBR model in the examples is messed up. From running other code, I am pretty much certain there is nothing wrong with optas.RobotModel. I think the issue must be in optas.Visualizer. Strange that the LWR is fine. It could be something to do with how this visual frames are defined (I made changes in the visualizer that handled the case when multiple visual frames for a link are defined). When I load the same model for the LBR into Pybullet it is put together fine. I probably missed something standard.

cmower avatar Apr 10 '23 20:04 cmower

You should consider removing all the "arrayfying" decorators and put a clause like so:

if isinstance(position, DM):
            position = position.toarray().flatten().tolist()
        else:
            position = position

for all variables that are converted to a list in visualize.py. This is a quick fix to run the example, I don't know how it will affect the whole program.

FrankC96 avatar Jun 11 '23 21:06 FrankC96

Thanks @FrankC96! The arrayify decorator is to ensure that the array-like inputs to all the decorated functions have type casadi.DM or casadi.SX - the main point of this is to prevent code repetition.

Just to clarify, did you have the changes to visualize.py that make the LBR example work without affecting the other examples? If so, I'd appreciate if you could set up a pull request.

cmower avatar Jun 16 '23 08:06 cmower

To my best knowledge the other examples, are not affected. I created the pull request.

FrankC96 avatar Jun 16 '23 12:06 FrankC96

Screenshot from 2023-08-11 13-30-02

I loaded the LBR model into pybullet, and all is well. This confirms the issue is with the visualizer and how it extracts the robot geometry.

cmower avatar Aug 11 '23 12:08 cmower