Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URDF Mesh File Path Error on Windows #28

Open
LudovicaDanovaro opened this issue Dec 18, 2024 · 1 comment
Open

URDF Mesh File Path Error on Windows #28

LudovicaDanovaro opened this issue Dec 18, 2024 · 1 comment

Comments

@LudovicaDanovaro
Copy link

I encountered an issue while working on Windows using a Conda environment with only python and urchin installed. I wrote a Python script to generate a URDF file for a simple robot:

from urchin import URDF, Link, Visual, Collision, Inertial, Geometry, Mesh, Material
 
# Define the mesh file path
mesh_file = 'package://my_robot_description/meshes/base_link.dae'
 
# Create the material
material = Material(name='gray', color=[0.5, 0.5, 0.5, 1.0])
 
# Create the geometry for visual and collision
geometry = Geometry(mesh=Mesh(filename=mesh_file, scale=[1, 1, 1], combine=False, lazy_filename=True))
 
# Create the visual element
visual = Visual(geometry=geometry, material=material)
 
# Define the inertial properties
inertial = Inertial(
    mass=1.0,
    inertia=[[0.1, 0.0, 0.0],
             [0.0, 0.1, 0.0],
             [0.0, 0.0, 0.1]]
)
 
# Create the link
link = Link(
    name='base_link',
    visuals=[visual],
    collisions=[],
    inertial=inertial
)
 
# Create the URDF
robot = URDF(
    name='simple_robot',
    links=[link]
)
 
# Save the URDF to a file
robot.save("simple_robot.urdf")

However, when I run the script, it throws the following error:

OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'package:'

Notably, the same script runs without any issues on Linux.

@traversaro
Copy link
Collaborator

Thanks for the report! Probably at some point some functions mistakes the package:// URI to refer to a drive name (like C: or D:).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants