Multiverse-Framework / Multiverse

Decentralized Simulation Framework designed to integrate multiple advanced physics engines along with various photo-realistic graphics engines to simulate everything
MIT License
16 stars 2 forks source link

Questions on MuJoCo and ROS2 Integration: Custom ros2_control, Site Pose Access, and Contact Force Visualization #38

Closed Ekanshh closed 1 month ago

Ekanshh commented 2 months ago

First of all, thank you for this amazing work! :100: I have a few questions if you could kindly clarify:

I am planning to use Multiverse for a research project, specifically integrating MuJoCo and ROS2 (RViz2) for visualization with the Franka Emika (Panda) robot and custom objects in the scene.

  1. Custom ros2_control integration: I have developed a compliant controller and would like to integrate it with the simulation. Is it possible to control the robot with a custom ros2_control controller in Multiverse? If so, could you provide the necessary steps to achieve this?

  2. Accessing object site pose: MuJoCo allows defining site poses in XML. Would it be possible to access the site pose from MuJoCo in Multiverse? I would like to use this information to command the robot to move to a specified site.

  3. Contact force visualization: MuJoCo offers an option to toggle contact force visualization. Is it possible to achieve a similar visualization with MuJoCo in Multiverse? Additionally, is there a way to publish the contact force points and values to a ROS2 topic, so I can visualize them as markers in RViz2? For reference, here's an example figure from an issue with contact force arrow: https://github.com/google-deepmind/mujoco/issues/997

image

HoangGiang93 commented 1 month ago

Thank you for your interest, I was in my vacation for 3 weeks and just came back. Sorry for the late response. 1) Yes, it's possible. I will write a comprehensive tutorial for that, but it will be in a couple weeks. If you want to try out, here is the quick demo multiverse_launch multiverse/resources/muv/pr2_ros2_control.muv 2) It could be possible but I didn't implement it because I don't have any use cases for that. Could you use body with not geom instead? 3) At the moment, the force and torque can be sent from MuJoCo. But I didn't implement a ROS node for visualizing the force and torque. I will do it later. If you want, you can try to create one https://multiverseframework.readthedocs.io/en/latest/tutorials/tutorial_6.html

I know there are lots of things need to be implemented to be practically useful for many use cases and I'm trying to do all of them step by step. Thank you for your understanding.

Ekanshh commented 1 month ago

Thank you, @HoangGiang93 , for the clarification. :) I am now closing this issue.