[spoteus:cmake] -- BUILD_SHARED_LIBS is on
[spoteus:cmake] CMake Error at /opt/ros/noetic/share/collada_urdf/cmake/collada_urdfConfig.cmake:113 (message):
[spoteus:cmake] Project 'collada_urdf' specifies '/usr/../include/include' as an include
[spoteus:cmake] dir, which is not found. It does neither exist as an absolute directory
[spoteus:cmake] nor in '${{prefix}}//usr/../include/include'. Check the issue tracker
[spoteus:cmake] 'https://github.com/ros/collada_urdf/issues' and consider creating a ticket
[spoteus:cmake] if the problem has not been reported yet.
[spoteus:cmake] Call Stack (most recent call first):
[spoteus:cmake] /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
[spoteus:cmake] CMakeLists.txt:7 (find_package)
[spoteus:cmake]
[spoteus:cmake]
[spoteus:cmake] -- Configuring incomplete, errors occurred!
みたいなエラーが出てロボットモデルが作成できない,ということが起こると思いますが,これらは回避可能なはずです.
1) そもそもの原因 (collada_urdf にバグが入ったままリリースされている.これをなんとかリリースしてもらうのが正しい解決策) -> https://github.com/ros/collada_urdf/issues/43
2)とりあえずの解決策 sudo emacs -nw /opt/ros/noetic/share/collada_urdf/cmake/collada_urdfConfig.cmake として,100行目ぐらいで,
と編集すると回避可能です.ただし,
ros-noetic-collada-urdf
を再インストールすると上書きされます.一般的にはおすすめしませんが,とりあえず,という意味では有効です.2)パッケージ側での変更.
find_package(collada_urdf)
としたときにエラーが出るので,これをなくせばよいです.ケース1: 実は何もしていない https://github.com/k-okada/jsk_robot/blob/1664a10c1ecb20c7ea9bef4c16e76855c00e0863/jsk_spot_robot/spoteus/CMakeLists.txt#L7-L32 みたいに
find_package
しているけど,find_pakcage(collada_urdf)
で変数collada_urdf_PREFIX
を取ってきて表示しているだけで何もしていない場合があります.その場合はシンプルにコードから外すのがよいです. https://github.com/jsk-ros-pkg/jsk_robot/pull/1701/commits/b3682c1adc7bd35812b9f93aa46f561fba141663ケース2:rosrun を使う
find_package(collada_urdf)
をしなくてもpackage.xml
に<build_depend>collada_urdf
があれば,rosrun
がききます(多分...)https://github.com/jsk-ros-pkg/jsk_robot/blob/d7cba75b3d07175ecbaf483ca8b86b628a02153d/jsk_fetch_robot/fetcheus/CMakeLists.txt#L31-L39