ami-iit / meshcat-cpp

Self-contained C++ interface for the MeshCat visualizer
BSD 3-Clause "New" or "Revised" License
25 stars 4 forks source link

[Question]: Pointers on how to have a CapsuleGeometry supported for set_object #16

Open wpumacay opened 6 months ago

wpumacay commented 6 months ago

Hi, I got to the point that I needed to create Capsules for my simulation, and I was wondering what parts in the code should I change to support creating capsules. Could you give some pointers to what I should change to obtain this result?.

Thanks in advance

Islam0mar commented 2 weeks ago

https://github.com/ami-iit/meshcat-cpp/blob/master/include/MeshcatCpp/Shape.h#L57

traversaro commented 2 weeks ago

fyi @GiulioRomualdi

wpumacay commented 2 weeks ago

Oh, yes I followed that path, but it seems that there's an issue with the version of threejs bundled into the main.min.js. It doesn't recognize the CapsuleGeometry. I updated the version of threejs, but then got some issues with the packet of data sent to the meshcat server. It seems that we have to update some parts of meshcatcpp to make it work with a newer version of threejs. Did u run into a similar issue when trying to add this new geometry?. I think it's a whole process, as the folks in drake had a similar issue.

Islam0mar commented 2 weeks ago

Could you link drake issue.

wpumacay commented 2 weeks ago

Sure.

https://github.com/RobotLocomotion/drake/issues/17149

This tracks the changes for Capsule support:

https://github.com/RobotLocomotion/drake/pull/17319