MUJOCO

Typically: "How do I... ", "How can I... " questions
Post Reply
dream
Posts: 5
Joined: 23 Jan 2024, 05:19

MUJOCO

Post by dream »

Hello, I want to connect the “soft body” of the demo with the “UR5_connection” fixed at the end of the UR5 robot, but I tried it and couldn't do it, please what should I do

https://drive.google.com/file/d/1CWSWXl ... drive_link

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: MUJOCO

Post by coppelia »

Hello,

have a look at the demo scene scenes/mujoco/compositeAndOtherCallbacks.ttt: then add a UR5 robot model to the scene. then open the child script attached to softBody and modify the code around line 50:

Code: Select all

        if simFrame==1 then
            endEffector  = sim.getObjectParent(sim.getObject('/UR5/connection'))
            -- Attach the composite to the end-effector:
            xml='<weld body1="'..prefix..'" '
            xml=xml..' body2="'..sim.getObjectAlias(endEffector,4)..'"/>'
            injection1=simMujoco.injectXML(xml,'equality',{callback=injection1Callback})
        end
Cheers

dream
Posts: 5
Joined: 23 Jan 2024, 05:19

Re: MUJOCO

Post by dream »

Thank you very much for your help,have a nice day!

dream
Posts: 5
Joined: 23 Jan 2024, 05:19

Re: MUJOCO

Post by dream »

Such a connection is to connect "softBody" with connection's parent, and when I try to connect directly with "connection", the system crashes, but I want to get the data about the force of softBody directly in connection, is there any suggestion

dream
Posts: 5
Joined: 23 Jan 2024, 05:19

Re: MUJOCO

Post by dream »


dream
Posts: 5
Joined: 23 Jan 2024, 05:19

Re: MUJOCO

Post by dream »

I solved it, thank you for your help

Post Reply