ARISE-Initiative / robosuite

robosuite: A Modular Simulation Framework and Benchmark for Robot Learning
https://robosuite.ai
Other
1.34k stars 413 forks source link

How to adjust size and position of the object loaded by xml file? #134

Closed HankerSia closed 3 years ago

HankerSia commented 3 years ago

I load a object using the following code: from robosuite.models.objects.objects import MujocoXMLObject seat_chair_model = MujocoXMLObject("/home/kai/robosuite/robosuite/models/assets/objects/seat_chair.xml") world.merge(seat_chair_model)

But, it looks very big in mujoco world. The cotent of the xml file is as shown in the following: Screenshot from 2020-12-03 17-29-26

Can anyone give me some advice, Thank you very much!

cremebrule commented 3 years ago

Hi @HankerSia ,

You can set the scale of your mesh object by setting the scale attribute in the corresponding <mesh ... /> tag. Please see this reference for exact details.

Closing this issue for now, feel free to re-open it if you continue to have problems!

HankerSia commented 3 years ago

Hi @HankerSia ,

You can set the scale of your mesh object by setting the scale attribute in the corresponding <mesh ... /> tag. Please see this reference for exact details.

Closing this issue for now, feel free to re-open it if you continue to have problems!

Yes, "scale" had been used for adjust the size of the model. Thanks. Another problems, can you give me a demo of grasping the object loaded by xml files, or some reference code demo. Thank you in advance!

cremebrule commented 3 years ago

I assume this is the same question as the new issue you posted, so I'll answer there.

spsingh37 commented 2 years ago

Hi @HankerSia,

Actually, I was loading an object into the robosuite environment using the following code:

code

As a result, I do see the object in the environment but it doesn’t seem to be a free body, since it is suspended in space and not experiencing any gravity, even though both the collision and visual mesh are in sync, as can be seen in the attached picture. robosuite_environment Secondly, if I provide this MujocoXMLObject position coordinates as if it is sitting on top of a moving BoxObject, which acts as a conveyor, then the MujocoXMLObject doesn’t move with the BoxObject and remains stick to its original position in space. Furthermore, if a second BoxObject is placed on top of the moving conveyor, the second BoxObject does move with the conveyor. In fact, the second BoxObject, if it collides with the MujocoXMLObject, is also not able to push the MujocoXMLObject. I find it pretty weird why the MujocoXMLObject doesn’t show the same behaviour like a BoxObject. So can you please help me fix these issues? I'm also attaching the MujocoXMLObject's collision and visual xml files. canobject canvisualobject

Thanks in advance