ふるお〜と!- FullAuto

AI・ロボットが普及しBI(ベーシックインカム)が早急に実現されることを願う元ニートのブログ

ふるお〜と!-FullAuto

depthai-rosを試してみる

GitHub - luxonis/depthai-ros
GitHub - luxonis/depthai-ros-examples

ROS2 Foxy にない関数使われていたよ。README.mdを信じてはいけない。

いるよね〜。聞けばすぐわかることを延々ソースコード眺めているコミュ障キモメガネ

そうそう、README.mdに書いてあっても日々アップデートしてんだがら仕様変わるつーの

Prerequisite

ROS2 Galactic
Installing ROS 2 via Debian Packages — ROS 2 Documentation: Galactic documentation

↓ROS2 Foxyでハマったときの駄文

ROS1をメインに作れているようでROS2向けにビルドするには工夫が必要。 ~/ros2_ws/src/
に依存パッケージをインストールしていく。

$ git clone https://github.com/ros-perception/vision_msgs --branch foxy

camera_info_managerをCMakeLists.txtから外す。

no member named id,score,x,y 全部削除!

colcon依存追加
https://github.com/ros2/rcpputils

https://github.com/ros-perception/image_common/tree/foxy

多用するコマンド

$ colcon build --cmake-clean-cache

ROS2 Galacticの依存ソースコード

~/ros2_ws/srcにぶち込んでおくソースコード
main(ほぼROS1)ではなくbranch(glatic)にあるので注意。

depthai-ros-examples

とりあえず、~/ros2_ws/installに ネタはビルドできたのでexampleを試してみようと思う。

https://github.com/luxonis/depthai-ros-examples/tree/daxoft/foxy-release

~/ros2_ws/srcへ追加。

libcamera_info_manager.so: undefined reference to `rcpputils::fs::path::stringabi:cxx11 const' collect2: error: ld returned 1 exit status

とかなんとか言われたらこうする

$ sudo ldconfig
$ source ~/ros2_ws/src/local_setup.sh
$ git clone https://github.com/luxonis/depthai-ros-examples
$ cd depthai-ros-examples
$ mkdir build
$ cd build
$ cmake ..
$ make

Run(Mobile)

$ source ~/ros2_ws/install/local_setup.sh
$ ros2 launch depthai_examples mobile_publisher.launch.py camera_model:=OAK-D

No such file or directory: 'xacro'

apt update
apt search xacro
sudo apt install ros-galactic-xacro

OAK-D-LITE

$ ros2 launch depthai_examples mobile_publisher.launch.py camera_model:=OAK-D-LITE

Topic表示

$ ros2 topic list
$ ros2 topic echo /color/image