threedworld-mit / tdw

ThreeDWorld simulation environment
BSD 2-Clause "Simplified" License
500 stars 75 forks source link

Impossible to create a Custom Robot in TDW, also using the basic ur5.urdf #517

Open belcore97 opened 1 year ago

belcore97 commented 1 year ago

Hi there, me and my university collegue are using TDW for a master thesis in order to simulate a robot operations. We started using the pre configured ur5 and its inverse kinematics but now we need to use a custom robot and we wanted to add the franka panda robot that we have in our laboratory. The problem is when we use our Panda urdf; Unity can't manage correctly the various files and a strange white hole appears in the simulation of the only first joint (maybe it can't manage correctly the various visual and collision mashes). Note that just the first joint appears in the simulation even if in the urdf all the needed joints are declered!

The real problem is that we can't also recreate the pre configured ur5 robot using the url that it is showed in the documentation. We have again the white hole of the first joint.

Can you help us to find a solution in order to add a custom robot correctly?

Thank you so much for the answers.

To be more clear we are using these codes:

output_directory = EXAMPLE_CONTROLLER_OUTPUT_PATH.joinpath("ur5_asset_bundles")
print(f"Asset bundles will be saved to: {output_directory}")
r = RobotCreator()

url="https://github.com/ros-industrial/robot_movement_interface/blob/master/dependencies/ur_description/urdf/ur5_robot.urdf.xacro"
r.source_url_to_asset_bundles(url=url, output_directory=output_directory.joinpath("ur19"), library_path=output_directory.joinpath("library.json"), library_description="My custom library",source_description='https://github.com/ros-industrial/robot_movement_interface')

lib = RobotLibrarian(library=str(output_directory.joinpath("library.json").resolve()))
robot_id = 0
robot = Robot(name="ur5", source=lib, position={"x": 0, "y": 0, "z": 0}, robot_id=robot_id)
c = Controller()
a = FirstPersonAvatar(avatar_id="avatar",position={"x": -2, "y": 1, "z": -2}, rotation=0,move_speed=2.5,detect_collisions=False, height=0.5, camera_height=0.5)

c.add_ons.append(robot)
c.add_ons.append(a)
c.communicate(TDWUtils.create_empty_room(12, 12))

c.communicate({"$type": "set_screen_size", "width": 1024, "height": 720})
while True:
    c.communicate([])
alters-mit commented 1 year ago

@belcore97 There might be an issue specific to your code or to the .xacro file.

belcore97 commented 1 year ago

Hi there, The first reason of our choice was to add a specific tool for the End Effector in order to do specific tasks, and the second reason was the introduction of a personal IK algorithm which manages the position and orientation of the end effector.

I have also another question: We would like to have the possibility of having an interaction between the robot and the obi fluid but in the documentation I found that it is not possible (in this link: https://github.com/threedworld-mit/tdw/blob/master/Documentation/lessons/obi/robots.md ). For example I would like to have the mouvement of the robot when it is hitted by the fluid. Is there any workaround to solve this problem?

I attached also the log of Robot Creator Class and the screenshot of TDW's simulation. log.txt no_creation_ur5 Thank you so much for the answers.

alters-mit commented 1 year ago

Is there any workaround to solve this problem?

No, it's not possible. This is a problem in the Obi particle system. The Obi documentation states that ArticulationBodies aren't fully supported and might never be fully supported.

I attached also the log of Robot Creator Class and the screenshot of TDW's simulation. There might be a problem with the colors. This looks wrong:

Color: RGBA(7.000, 7.000, 7.000, 10.000)

I think color channel values are supposed to be 0-1.

This is also probably wrong, unless you are using Windows asset bundles

Building an AssetBundle for target 'MacStandaloneSupport' is not allowed because the required module is not **installed.**