question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import URDF not working as expected

See original GitHub issue

HI,

I’m trying to import the LeoRover description in Unity using ZeroSim. I followed the video tutorial and the comment from @micahpearlman in https://github.com/fsstudio-team/ZeroSimROSUnity/issues/17#issuecomment-995344947. I was able to import the .obj files but it looks like the joints weren’t imported properly.

image

Have I missed something or is this the expected behaviour?

Setup info:

  • Unity 2020.2.6f1
  • on Ubuntu 18.04 LTS
  • with your docker image to convert the meshes

Thanks, Alex

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Apr 6, 2022

No problem, that’s what open source is for!

We appreciate that you released ZeroSim to the public. I have experience with ROS and linux, but at the moment I have no experience whatsoever with Unity and C#. I have a colleague that’s got the opposite set of experiences. It sure is a possibility for us to contribute back to ZeroSim.

0reactions
ghostcommented, Apr 12, 2022

Thanks for you patience as well, I’m quite fluent, but English isn’t my first language so there might be some stuff that’s lost in translation.

FYI: xacro is just an xml macro language on top of the urdf xml. It makes life easier when you want to add links and joints in a modular way. As an example, this is the file that i use to add parts to the LeoRover original URDF:

<?xml version="1.0" encoding="utf-8"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
    <xacro:include filename="$(find leo_ssom_addons_description)/urdf/e_stop.xacro" />
    <xacro:include filename="$(find leo_ssom_addons_description)/urdf/mounting_plates.xacro" />
    <xacro:include filename="$(find leo_ssom_addons_description)/urdf/realsense.xacro" />
    <xacro:include filename="$(find leo_ssom_addons_description)/urdf/jetson_nano.xacro" />
    <xacro:include filename="$(find leo_ssom_addons_description)/urdf/rplidar.xacro" />
</robot>

Link origin issue

I believe you found the root cause of the issue. To my knowledge, the link origin rotations and translations values aren’t used when importing the URDF. I think that it could be handled in the conversion script probably with bpy.ops.transform.rotate(rpy) and bpy.ops.transform.translate(xyz). I guess it might also be handled here: https://github.com/fsstudio-team/ZeroSimROSUnity/blob/9adff2a83fb4cb9ec4207ca7e933ca56ae5ad01f/Runtime/Scripts/Util/ImportExport/ZOImportURDF.cs#L113 and there: https://github.com/fsstudio-team/ZeroSimROSUnity/blob/9adff2a83fb4cb9ec4207ca7e933ca56ae5ad01f/Runtime/Scripts/Util/ImportExport/ZOImportURDF.cs#L213

I investigated by opening my .dae file in Blender.

image

I then manually applied the <origin rpy="0 0 -1.57079632679" xyz="0.155 0 -0.0085"/> rotations then translations.

image

The origin is now where the URDF is expecting it.

Validation in Blender with joint origin applied

After import image

After joint origin is applied the part is properly located and the joint is where it’s expected to be. <origin rpy="0 0 0" xyz="-0.045 0 0.0085"/> image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem with URDF Importer
I am using the URDF importer plugin to import a model of a Staubli manipulator, unfortunately it appears that the plugin incorrectly instantiates...
Read more >
Failed to import URDF file - Isaac Sim
Hi all, I'm trying to import my robot to appear in the screen through the hello_world tutorial program. When I import my robot...
Read more >
Rendering Issues when importing urdf linked to .obj
Hello everyone, I'll overview the issue and then list the specific code and details: In my simulation, when I load the urdf of...
Read more >
Asset not found · Issue #69 · Unity-Technologies/URDF ...
When I upload the URDF file and the meshes in the Asset folder and push on the "import robot from URDF", an error...
Read more >
Python cannot load URDF file - pybullet
Try supplying the full path to the file. The default is to look for the file in the current working directory, which is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found