Load Textures in Collada 1.5

I am working on a research project where we run simulations on openrave. I downloaded collada models from 3dwarehouse sketchup site The dae files were in 1.4.1 format and I am trying to convert them to 1.5.0 (since openrave works with 1.5)

I am using xmllint to validate the dae file with the collada specification (schema.xsd) and this is the output I get

$ xmllint --noout --schema schema.xsd floor15.dae
output.dae:130: element sampler2D: Schemas validity error : Element '{collada 2008 03 COLLADASchema}sampler2D': Character content is not allowed, because the content type is empty.
output.dae:130: element sampler2D: Schemas validity error : Element '{collada 2008 03 COLLADASchema}sampler2D': Element content is not allowed, because the content type is empty.
output.dae fails to validate

From what I understand, the element can have either Character or Element content. If both are not allowed what do I even add here??

I’ve tried going through the specification (collada_spec_1_5.pdf) and fixing the sampler2D node but have had no success.

I tried using this converter (github metaleap go-collada tree master conv-1.4.1-to-1.5) written in Go to convert the original collada file I downloaded from 1.4.1 to 1.5 but that gives me the same errors above.

Google drive link to files:
drive folders 1fHyoXQB5vKJMUv_BgoAZC8Ol-vfiFwV9?usp=sharing

I’ve looked at OpenRave before, looking for test files. It used COLLADA-DOM 2.4. It needs 1.5 for kinematics. Its implementation is very crude, so I wouldn’t worry about validating your files. I wouldn’t expect too much either. (That was some time ago, but I imagine its code is unchanged, especially since nothing else implements kinematics.)

I’ve worked on upgrading COLLADA-DOM significantly, and the person who worked on OpenRave I dealt with some in the beginning:

Rosen Diankov (patches for 1.5, cmake support, collada namespaces, github maintenance)

OpenRave has a robots pack, which is why it has COLLADA in the first place. It’s very peculiar to its implementation of COLLADA. I think it has its own model format, and it is converted from that to its COLLADA format.

I can try to help you around your element if you copy/paste some of the XML code. Or I can look at a file at a regular download link. sampler2D has elements in both versions, so your schema setup may be to blame. But I would not worry about validation. COLLADA is not a mature technology. I’m trying to develop it for noncommercial applications, because it seems like the best place to start, but only because there is no real alternative, and it suits me.

This link used to be in my signature, in the old forum:

Thanks. Below is the xml for one of the models i’m working with.
My main concern is just to get the textures working. The validator helped me point out that there is something wrong with the xml elements. Until then it was all a black box for me.

I am not able to add links. This is the trailing url for a google drive link for all files you might need to replicate this issue: /drive/u/1/folders/1fHyoXQB5vKJMUv_BgoAZC8Ol-vfiFwV9

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<COLLADA xmlns="http://www.collada.org/2008/03/COLLADASchema" version="1.5.0">
            <authoring_tool>SketchUp 19.2.222</authoring_tool>
        <unit meter="0.0254" name="inch" />
        <camera id="ID1" name="skp_camera_Last_Saved_SketchUp_View">
        <visual_scene id="ID2">
            <node name="SketchUp">
                <instance_geometry url="#ID3">
                            <instance_material symbol="Material2" target="#ID4">
                                <bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0" />
                            <instance_material symbol="Material3" target="#ID15">
                                <bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0" />
                            <instance_material symbol="Material4" target="#ID16">
                                <bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0" />
                <node name="skp_camera_Last_Saved_SketchUp_View">
                    <matrix>-0.6130583 -0.2805412 0.7385501 6392.782 0.7900377 -0.217696 0.5731046 6675.334 -5.551115e-17 0.9348289 0.3550984 2700.077 0 0 0 1</matrix>
                    <instance_camera url="#ID1" />
        <geometry id="ID3">
                <source id="ID9">
                    <float_array id="ID18" count="36">1853.365 -1076.018 -240.6876 -1823.431 5667.582 -345.2971 -2996.138 -87.91088 -345.2971 3026.072 4679.475 -240.6876 3026.072 4679.475 -240.6876 1853.365 -1076.018 -240.6876 -1823.431 5667.582 -345.2971 -2996.138 -87.91088 -345.2971 -2996.138 -87.91088 -345.2971 1853.365 -1076.018 -240.6876 3026.072 4679.475 -240.6876 -1823.431 5667.582 -345.2971</float_array>
                        <accessor count="12" source="#ID18" stride="3">
                            <param name="X" type="float" />
                            <param name="Y" type="float" />
                            <param name="Z" type="float" />
                <source id="ID10">
                    <float_array id="ID19" count="36">-0.02070671 0.004219083 0.9997767 -0.02070671 0.004219083 0.9997767 -0.02070671 0.004219083 0.9997767 -0.02070671 0.004219083 0.9997767 0.02070671 -0.004219083 -0.9997767 0.02070671 -0.004219083 -0.9997767 0.02070671 -0.004219083 -0.9997767 0.02070671 -0.004219083 -0.9997767 0 0 0 0 0 0 0 0 0 0 0 0</float_array>
                        <accessor count="12" source="#ID19" stride="3">
                            <param name="X" type="float" />
                            <param name="Y" type="float" />
                            <param name="Z" type="float" />
                <source id="ID11">
                    <Name_array id="ID21" count="0" />
                        <accessor count="0" source="#ID21" stride="1">
                            <param name="skp_material" type="Name" />
                <source id="ID13">
                    <float_array id="ID20" count="8">38.01813 112.5189 -288.3013 -162.495 38.01813 -162.495 -288.3013 112.5189</float_array>
                        <accessor count="4" source="#ID20" stride="2">
                            <param name="S" type="float" />
                            <param name="T" type="float" />
                <vertices id="ID12">
                    <input semantic="POSITION" source="#ID9" />
                    <input semantic="NORMAL" source="#ID10" />
                <triangles count="2" material="Material2">
                    <input offset="0" semantic="VERTEX" source="#ID12" />
                    <input offset="1" semantic="TEXCOORD" source="#ID13" />
                    <p>0 0 1 1 2 2 1 1 0 0 3 3</p>
                <triangles count="2" material="Material3">
                    <input offset="0" semantic="VERTEX" source="#ID12" />
                    <p>4 5 6 7 6 5</p>
                <lines count="4" material="Material4">
                    <input offset="0" semantic="VERTEX" source="#ID12" />
                    <p>8 9 9 10 10 11 11 8</p>
        <material id="ID4" name="Metal_Seamed">
            <instance_effect url="#ID5" />
        <material id="ID15" name="material">
            <instance_effect url="#ID14" />
        <material id="ID16" name="edge_color000255">
            <instance_effect url="#ID17" />
        <effect id="ID5">
                <newparam sid="ID8">
                        <instance_image url="#ID6"/>
                <technique sid="COMMON">
                            <texture texture="ID8" texcoord="UVSET0" />
        <effect id="ID14">
                <technique sid="COMMON">
                            <color>0.6705882 0.6901961 0.8 1</color>
        <effect id="ID17">
                <technique sid="COMMON">
                        <transparent opaque="A_ONE">
                            <color>0 0 0 1</color>
        <image id="ID6">
        <instance_visual_scene url="#ID2" />

You’ll have to give me straightforward instructions to access your files.

I don’t see anything wrong around your sampler2D element or its surroundings. I think 1.5 is a little different in this regard. It’s mostly unchanged from 1.4.1, which is actually not a good thing, since there are lot of problems and errors in 1.4.1. There is a list of changes in the manual.

I think your validator is mistaken. Anyway, sampler2D is not an empty content-model element.

EDITED: See if you can post links now. I think your account was suspect as a brand new user account.

Can you double check that your XSD (Scehema) is same as the original one (you can grap that from khronos page)

To convert COLLADA 1.4/1.4.1 to 1.5;

  • AFAIK, the <image> is different a bit at 1.5
  • The <surface> doesn’t appears at 1.5

Don’t forget that <init_from> has extra element at 1.5 which is <ref>, so this may cause to get wrong image url which will prevent to load texture. This <ref> element does not present at 1.4.

I’m also converting 1.4 to 1.5 and get expected results. I have just migrated the <surface> element into the new <image> element which is very simple to do, I think.

Just try to follow the changes from 1.4 to 1.5, there is a PDF about release notes.

I am still not able to post links. You can replace the ‘@’ symbols with ‘.’ and the link should work. drive@google@com/drive/u/1/folders/1fHyoXQB5vKJMUv_BgoAZC8Ol-vfiFwV9

I went through the manual but I haven’t been able to figure out what is going wrong in my case. Could it be that the issue with textures is inside openrave and not the dae file?

@recp I got my xsd file from the khronos page itself. I have used the < ref > tag for <init_from>
Would you have an example of the conversion you performed? Might be helpful

Your files work for me, except the UV map has unusual values (38.01813 112.5189 …) so I can’t say if the image is working or not. I don’t get any errors reported from the COLLADA-DOM reference implementation I’m responsible for.

(I deleted an earlier post that had some erroneous findings. I’m hoping making a new post will avoid confusion. The floor_orig file has the JPG in a “floor” folder.)

Would have a sample of UV map values that I could use? I have no clue what they mean.
Are you able to load it in openrave?

I am aware of the floor folder path. I’ve tried various combinations (placing it in the floor folder, placing it along .dae file, providing full file path, file:// uri) but none worked.

Texture coordinate value space is between 0 and 1 if not wrapping. That doesn’t look like how yours work. Unless that floor is gigantic, and the texture repeats over it hundreds of times. In that case you have to scale down to the size of ant to see your texture. Typical viewing software may not be able to get that close.

EDITED: I don’t use OpenRave. But I think it’s for developers right? In which case, debugging it is your best bet.

I gave up on trying to load them in openrave and I am not loading it in gazebo with the 1.4 format dae files. I can see the textures load fine in gazebo but as you said the textures are being repeated over hundreds of times and I need to scale down to view them.

In this case, is changing the scale of the models the only way to fix the texture repetition?

No, the scale is unrelated to texture coordinates. It’s funny. The software that modeled it probably uses pixels instead of 0~1 scale, but in that case the export should have converted it. This isn’t a general help forum… or at least as you can see, there aren’t many people here. I think this forum is more for programmers needing help implementing COLLADA than support for modeling software or even writing COLLADA documents (that is not normally done by hand. I mean, you can’t usually fill out a UV map by hand. You need software. And those software have their own help forums.)

EDITED: I don’t recall seeing any models with textures in OpenRave’s robot pack. It’s possible it doesn’t implement textures. It is is a pretty sketchy library. Takes a lot of work to set up no doubt, and be prepared for tribulations.

1 Like