jsk-ros-pkg / jsk_robot

jsk-ros-pkg/jsk_robot
https://github.com/jsk-ros-pkg/jsk_robot
73 stars 97 forks source link

noetic で ロボットモデルが作成されない時の解決方法 #1892

Open k-okada opened 7 months ago

k-okada commented 7 months ago
[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行目ぐらいで,

if(NOT "include;/usr/../include/include;/usr/include/collada-dom2.4/1.5;/usr/include/collada-dom2.4;/usr/include " STREQUAL " ")
  set(collada_urdf_INCLUDE_DIRS "")
  #  set(_include_dirs "include;/usr/../include/include;/usr/include/collada-dom2.4/1.5;/usr/include/collada-dom2.4;/usr/include")
    set(_include_dirs "include;/usr/include;/usr/include/collada-dom2.4/1.5;/usr/include/collada-dom2.4;/usr/include")
  if(NOT "https://github.com/ros/collada_urdf/issues " STREQUAL " ")

と編集すると回避可能です.ただし,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