jupyter-robotics / jupyterlab-urdf

A URDF viewer and editor extension for JupyterLab.
https://jupyterlab-urdf.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
97 stars 9 forks source link

Simple xacro doesn't seem to work #51

Open kevin-thankyou-lin opened 6 months ago

kevin-thankyou-lin commented 6 months ago

Hi, thanks for the great package!

For some reason, this simple xacro, named test.urdf.xacro, doesn't show anything in jupyter lab:

<?xml version="1.0"? >
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
  <link name="base_link">
    <visual>
      <geometry>
        <box size="1 1 1" />
      </geometry>
    </visual>
  </link>
</robot>

However, I'm able to view the .xacro in the examples/ repo.

What might be the cause?

IsabelParedes commented 6 months ago

Hi @kevin-thankyou-lin!

It seems that the space you have between the ? and the > in the first line is causing a parsing error. When opened with the editor, all the syntax is the same color when it shouldn't be.

Apart from that, there is another issue where this model will not display when first opened. It seems to work fine after the file is edited, but maybe the initial loading of the file has a problem. I have to look into this a bit more.

But hopefully with this you can edit your xacro file :)

kevin-thankyou-lin commented 6 months ago

Hi @IsabelParedes, seems to work fine after the file is edited, but maybe the initial loading of the file has a problem - indeed! Nonetheless, thanks for help with the xacro fix!