cyglidar 원래 버전
https://github.com/CygLiDAR-ROS/cyglidar_d1
cyglidar ROS2 버전?
https://github.com/madgrizzle/cyglidar_d1/tree/ROS2v0.1
ROS2 빌드 명령어 : colcon build
ROS2 cyglidar를 빌드하면 이런 에러가 난다
--- stderr: cyglidar_d1
CMake Error at CMakeLists.txt:16 (find_package):
By not providing "Findcatkin.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "catkin", but
CMake did not find one.
Could not find a package configuration file provided by "catkin" with any
of the following names:
catkinConfig.cmake
catkin-config.cmake
Add the installation prefix of "catkin" to CMAKE_PREFIX_PATH or set
"catkin_DIR" to a directory containing one of the above files. If "catkin"
provides a separate development package or SDK, be sure it has been
installed.
---
Failed <<< cyglidar_d1
Summary: 0 packages finished
1 package failed: cyglidar_d1
1 package had stderr output: cyglidar_d1
catkin_make는 ROS1 때 빌드 시스템
ROS2 빌드 시스템은 colcon build 임 (설명 : https://design.ros2.org/articles/build_tool.html)
동일한 에러에 대한 답변을 찾음
==> 이런 에러는 ROS1 용으로 만들어 진거라서 ROS2로 바꾸려면 많은걸 해야 한다고 함
That package has been created for ROS1, to run it on ROS2, you will have to rewrite it
(change build system from catkin to colcon, rewrite specific files, etc.).
If you are a beginner, this might be too much,
so I suggest building & running it on ROS1 so you can learn how things work
(or you can find other robot that runs ROS2).
https://answers.ros.org/question/385797/issue-with-creating-a-workspace-ros2/?sort=votes
동일한 에러인데, 답변 된게 없음
https://answers.ros.org/question/279226/problems-with-findpackage-in-cmake/
동일한 에러에 대해 catkin 을 설치해도 해결이 안됐다는 글
(괜히 catkin 설치했다가는 ros 전체를 지워야 하므로 하지 말것)
https://chowdera.com/2022/03/202203301603120599.html
ROS2 cyglidar 소스 수정 내용을 보면 아래와 같은 작업이 되어 있지 않음
ROS2: C++로 publisher와 subscriber 만들기 https://www.robotstory.co.kr/king/?vid=889
위와 같은 작업이 소스코드에 다 안되어 있는것 같다?
ROS 2 기초 - publisher 작성하기 (C++) https://m.blog.naver.com/junghs1040/222142391475
결론 : ROS2 버전으로 완성된게 다 만들어진게 아닌것 같다.
ROS2 package 만드는 설명
https://docs.ros.org/en/eloquent/Tutorials/Creating-Your-First-ROS2-Package.html
CMake가 아래 처럼 ament_cmake 빌드툴을 써야 ROS2 버전으로 컴파일 됨
<?xml version="1.0"?>
<?xml-model
href="http://download.ros.org/schema/package_format3.xsd"
schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>my_package</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="user@todo.todo">user</maintainer>
<license>TODO: License declaration</license>
<buildtool_depend>ament_cmake</buildtool_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<export>
<build_type>ament_cmake</build_type>
</export>
</package>
혹시나 colcon 빌드 시스템이 정상인지 확인하기 위해
여기에 나오는 hello world 기본 package 튜토리얼을 따라 해보니 정상 빌드 된다.
Creating your first ROS 2 package https://docs.ros.org/en/eloquent/Tutorials/Creating-Your-First-ROS2-Package.html
Bridge communication between ROS 1 and ROS 2
https://github.com/ros2/ros1_bridge/blob/master/README.md
The ROS 1 bridge can connect topics from ROS 1 to ROS 2 and vice-versa. See the dedicated documentation on how to build and use the ROS 1 bridge.
from :
https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html
A) raspberry-pi setup
1) install Ubuntu 16.04 Xeniel & ROS1 Kinetic (using Ubiquityrobotics ubuntu image)
2) build cyglidar
3) configure ROS_MASTER_URI=192.168.0.39:11311 as raspberrypi ip addr
B) laptop setup
1) install Ubuntu 20.04 focal into laptop
2) install ROS1 noetic
3) install ROS2 galactic
4) build https://github.com/ros2/ros1_bridge
5) run ROS1 to ROS2 (apply ROS_MASTER_URI=192.168.0.39:11311, rapberrypi ip addr)
6) 'rostopic list' can show received topic from cyglidar at raspberrypi
7) run rviz to display scan_2D topic
8) there is a error such as 'fail to connect.. ubiquityrobotics'