RobotinoでROS(ct2034)
自作のRobotino用のROSもいいけど,やっぱりオフィシャルのROSかな ということで探してみたけど,ページがなくなっている….
github の方にコピーが残っていたので,それを利用.
cd ~/git git clone https://github.com/ct2034/robotino cd ~/catkin_ws/src ln -s ~/git/robotino/robotino-ros-pkg/* . cd .. catkin_make
-- Could NOT find costmap_2d (missing: costmap_2d_DIR) -- Could not find the required component 'costmap_2d'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found. CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
costmap_2d ってなんじゃらほい.
sudo apt-get install ros-noetic-costmap-2d
とりあえず入れてみる.
-- Could NOT find image_transport (missing: image_transport_DIR) -- Could not find the required component 'image_transport'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
次は,image_transport か.
sudo apt-get install ros-noetic-image-transport
-- Could NOT find nav_core (missing: nav_core_DIR) -- Could not find the required component 'nav_core'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found. CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
nav_coreらしい.
sudo apt-get install ros-noetic-nav-core
/home/robotino/catkin_ws/src/robotino_node/include/ComROS.h:11:10: fatal error:rec/robotino/api2/Com.h: No such file or directory 11 | #include "rec/robotino/api2/Com.h"
あー.api周りか….
場所は,/opt/robotino/include/rec/robotino/api2 にあるはず.
CMakelists.txt に追加.
cat src/robotino_node/CMakeLists.txt ... set(CMAKE_MODULE_PATH /usr/local/robotino/api2/cmake) set(RobotinoAPI2_INCLUDE_DIRS /opt/robotino/include) ## System dependencies are found with CMake's conventions # find_package(Boost REQUIRED COMPONENTS system) find_package(RobotinoAPI2) set(REC_ROBOTINO_API2_LIBRARY /opt/robotino/lib/librec_robotino_api2.so) ... ## Specify additional locations of header files ## Your package locations should be listed before other locations # include_directories(include) include_directories( include ${catkin_INCLUDE_DIRS} ${RobotinoAPI2_INCLUDE_DIRS} ) ...
上記は,学生からの情報により,CMakeの部分が間違っているとのこと.
## set(CMAKE_MODULE_PATH /usr/local/robotino/api2/cmake) set(CMAKE_MODULE_PATH /usr/local/robotino/api2/cmake)
list(APPEND CMAKE_MODULE_PATH "/usr/local/robotino/api2/cmake" "/opt/robotino/cmake")
こうした方が,両方を参照できるので,良さそうですね.
これで,次は
/home/robotino/catkin_ws/src/robotino_local_planner/src/RobotinoLocalPlanner.cpp:12:24: error: expected constructor, destructor, or type conversion before ‘(’ token
むむむ?
PLUGINLIB_DECLARE_CLASS のマクロの部分がおかしいって感じですが,これはpluginlib/class_list_macros.h で定義されているはず.
cd /opt/ros/noetic/include/pluginlib grep PLUGINLIB_DECLARE_CLASS * -R
見つからない….なくなっているっぽいですね.
ROSで Tara – USB Stereo Vision Cameraを使うの作業歴だと,
-PLUGINLIB_DECLARE_CLASSをPLUGINLIB_EXPORT_CLASSに置き換えていますね.
robotino@robotino:/opt/ros/noetic/include/pluginlib$ grep PLUGINLIB_EXPORT_CLASS * class_list_macros.hpp: * \def PLUGINLIB_EXPORT_CLASS(class_type, base_class_type) class_list_macros.hpp:#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type) \
ふむふむ.
robotino@robotino:~/catkin_ws$ cat src/robotino_local_planner/src/RobotinoLocalPlanner.cpp ... // PLUGINLIB_DECLARE_CLASS(robotino_local_planner, RobotinoLocalPlanner, robotino_local_planner::RobotinoLocalPlanner, nav_core::BaseLocalPlanner) PLUGINLIB_EXPORT_CLASS(robotino_local_planner::RobotinoLocalPlanner, nav_core::BaseLocalPlanner)
こんな置換で,対応できるかなぁ.
from /home/robotino/catkin_ws/src/robotino_local_planner/src/RobotinoLocalPlanner.cpp:8: /opt/ros/noetic/include/class_loader/meta_object.hpp: In instantiation of ‘B* class_loader::impl::MetaObject<C, B>::create() const [with C = robotino_local_planner::RobotinoLocalPlanner; B = nav_core::BaseLocalPlanner]’: /opt/ros/noetic/include/class_loader/meta_object.hpp:196:7: required from here /opt/ros/noetic/include/class_loader/meta_object.hpp:198:12: error: invalid new-expression of abstract class type ‘robotino_local_planner::RobotinoLocalPlanner’ 198 | return new C;
次は,何だ.
コメントを残す