Skip to content

URDF Mesh File Path Error on Windows #28

Description

@LudovicaDanovaro

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions