Skip to content
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.

collada_to_urdf.cpp fails to compile #44

Closed
kartikmohta opened this issue Nov 20, 2013 · 13 comments
Closed

collada_to_urdf.cpp fails to compile #44

kartikmohta opened this issue Nov 20, 2013 · 13 comments

Comments

@kartikmohta
Copy link

Building CXX object CMakeFiles/collada_urdf.dir/src/collada_urdf.cpp.o
hydro/src/collada_urdf/src/collada_to_urdf.cpp: In function ‘void assimp_file_export(std::string, std::string, std::string)’:
hydro/src/collada_urdf/src/collada_to_urdf.cpp:79:30: error: ‘AI_CONFIG_IMPORT_COLLADA_IGNORE_UP_DIRECTION’ was not declared in this scope
     importer.SetPropertyBool(AI_CONFIG_IMPORT_COLLADA_IGNORE_UP_DIRECTION, true, &existing);
                              ^
CMakeFiles/collada_to_urdf.dir/build.make:57: recipe for target 'CMakeFiles/collada_to_urdf.dir/src/collada_to_urdf.cpp.o' failed

The "AI_CONFIG_IMPORT_COLLADA_IGNORE_UP_DIRECTION" property was added in Assimp's git master branch[1] but is not present in any of the released versions.

[1] assimp/assimp@5470f5f

@wjwwood
Copy link
Member

wjwwood commented Nov 20, 2013

Thanks for the report, but I need some more information.

What version of assimp are you using?

How did you install assimp? (From source or from a package manager?)

What OS are you on?

What version of robot_model are you trying to build from source? (commit hash, tag, or released source?)

@kartikmohta
Copy link
Author

Sorry for not providing them with the original report.
OS: Archlinux
assimp v3.0.1270 installed from package manager
robot_model version: v1.10.16 trying to build from released source (using rosinstall_generator)

@wjwwood
Copy link
Member

wjwwood commented Nov 20, 2013

Ubuntu Precise uses assimp v2:

http://packages.ubuntu.com/precise/libassimp-dev

This is likely something that changed from assimp 2 and 3. However, everything seems to work for my mac where I use assimp 3.0.1270 also, let me try and reproduce the error on my mac.

@kartikmohta
Copy link
Author

The code which causes the error is inside a

#if IS_ASSIMP3
#endif

block, so wouldn't cause issues on Ubuntu Precise.

@wjwwood
Copy link
Member

wjwwood commented Nov 20, 2013

This builds fine on my mac, but can you post the output of the CMake configure step for collada_urdf? My CMake reports:

-- checking for module 'assimp'
--   found assimp, version 3.0.255

But my package manager reports:

% brew info assimp
assimp: stable 3.0.1270
http://assimp.sourceforge.net/
/usr/local/Cellar/assimp/3.0.1270 (52 files, 9.8M) *
  Built from source
From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/assimp.rb
==> Dependencies
Build: cmake
Required: boost

Which totally do not match...

@kartikmohta
Copy link
Author

The cmake configure output is:

-- catkin 0.5.77
-- Found TinyXML: /usr/lib64/libtinyxml.so  
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   program_options
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28") 
-- checking for module 'assimp'
--   found assimp, version 3.0.1264
-- Configuring done

The version 3.0.255 you get is due to some patch in homebrew (https://github.com/mxcl/homebrew/blob/master/Library/Formula/assimp.rb#L37).

Can you grep for "AI_CONFIG_IMPORT_COLLADA_IGNORE_UP_DIRECTION" in your assimp header files and check where it's defined? It doesn't seem to be present anywhere in the source package.

@wjwwood
Copy link
Member

wjwwood commented Nov 20, 2013

Ah, I am not using the latest version of robot_model, let me update.

@wjwwood
Copy link
Member

wjwwood commented Nov 20, 2013

Looks like the bug was introduced in 0bdfef0

I would guess they just didn't test the IS_ASSIMP3 code path at all.

@isucan @YoheiKakiuchi

@wjwwood
Copy link
Member

wjwwood commented Nov 20, 2013

I can reproduce it on OS X with the latest source:

[ 60%] Building CXX object robot_model/collada_urdf/CMakeFiles/collada_to_urdf.dir/src/collada_to_urdf.cpp.o
/tmp/robot_model_ws/src/robot_model/collada_urdf/src/collada_to_urdf.cpp:79:30: error: use of undeclared identifier 'AI_CONFIG_IMPORT_COLLADA_IGNORE_UP_DIRECTION'
    importer.SetPropertyBool(AI_CONFIG_IMPORT_COLLADA_IGNORE_UP_DIRECTION, true, &existing);
                             ^
/tmp/robot_model_ws/src/robot_model/collada_urdf/src/collada_to_urdf.cpp:81:61: warning: data argument not used by format string [-Wformat-extra-args]
      fprintf(stderr, ";; OverWrite : Ignore UP_DIRECTION", existing);
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
1 warning and 1 error generated.
make[2]: *** [robot_model/collada_urdf/CMakeFiles/collada_to_urdf.dir/src/collada_to_urdf.cpp.o] Error 1
make[1]: *** [robot_model/collada_urdf/CMakeFiles/collada_to_urdf.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed

@tfoote
Copy link
Member

tfoote commented Nov 21, 2013

This is a regresssion between 1.10.15 and 1.10.16. This is breaking the hydro builds on quantal and raring http://www.ros.org/debbuild/hydro.html?q=collada_urdf

http://jenkins.ros.org/job/ros-hydro-collada-urdf_binarydeb_quantal_amd64/68/console

/tmp/buildd/ros-hydro-collada-urdf-1.10.16-0quantal-20131121-1755/src/collada_to_urdf.cpp: In function 'void assimp_file_export(std::string, std::string, std::string)':
/tmp/buildd/ros-hydro-collada-urdf-1.10.16-0quantal-20131121-1755/src/collada_to_urdf.cpp:79:30: error: 'AI_CONFIG_IMPORT_COLLADA_IGNORE_UP_DIRECTION' was not declared in this scope
make[4]: *** [CMakeFiles/collada_to_urdf.dir/src/collada_to_urdf.cpp.o] Error 1

If we don't have a suggestion for a quick fix I will roll back the version in the rosdistro soon.

@isucan
Copy link
Contributor

isucan commented Nov 21, 2013

Sorry about this guys, I should have checked this in more detail.
I think we shld just comment out this block:

 { // ignore UP_DIRECTION tag in collada
    bool existing;
    importer.SetPropertyBool(AI_CONFIG_IMPORT_COLLADA_IGNORE_UP_DIRECTION, true, &existing);
    if(existing) {
      fprintf(stderr, ";; OverWrite : Ignore UP_DIRECTION", existing);
    }
  }

@YoheiKakiuchi
Copy link
Contributor

They are code for assimp trunk.
I couldn't find out because I just used ubuntu 12.04.
Please comment out them.

 { // ignore UP_DIRECTION tag in collada
    bool existing;
    importer.SetPropertyBool(AI_CONFIG_IMPORT_COLLADA_IGNORE_UP_DIRECTION, true, &existing);
    if(existing) {
      fprintf(stderr, ";; OverWrite : Ignore UP_DIRECTION", existing);
    }
  }

@dirk-thomas
Copy link
Member

Released as 1.10.17 into Hydro: ros/rosdistro#2607

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

No branches or pull requests

6 participants