Skip to content
This repository was archived by the owner on Dec 7, 2023. It is now read-only.

itohemon/cylinder_ros2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cylinder_ros2

事前設定

ROS2のセットアップファイル作成

以下を$HOME/ros2_setup.bashに記載する

#
# ROS2
#
source /opt/ros/humble/setup.bash
source /home/itohemon/microros_ws/install/setup.bash
source /home/itohemon/ros2_ws/install/setup.bash
export PICO_SDK_PATH=/home/itohemon/pico-sdk

microROS実行環境セットアップ

zennの記事 を参考にセットアップする

LD06, BNO055のノードセットアップ

zennの記事を参考にセットアップする

pigpioのインストール

mkdir ~/tmp
cd ~/tmp
git clone https://github.com/joan2937/pigpio.git
cd pigpio
mkdir build
cd build
cmake ..
make
sudo make install

pigpiodの自動起動設定

sudo vi /lib/systemd/system/pigpiod.service

ファイルの中身は以下。

[Unit]
Description=Pigpio daemon

[Service]
Type=forking
PIDFile=pigpio.pid
ExecStart=/usr/local/bin/pigpiod -l -n 127.0.0.1 -s 10
ExecStop=/usr/bin/systemctl kill pigpiod

[Install]
WantedBy=multi-user.target

起動確認。

sudo systemctl enable pigpiod
sudo systemctl start pigpiod
sudo systemctl status pigpiod

リブートして ps コマンドでpigpiodが立ち上がってるか確認する。 [参照] (https://qiita.com/mashi0727/items/1e25c4eea511968066ca)

母艦PCにてRaspberryPi Picoへのファームウェアインストール

cd ~/ros2_ws/src/cylinder_ros2/
mkdir build
cd build
cmake ..
make

コンパイル完了したら、RaspberryPiPicoをUbuntuから見えるよう以下実行

  1. BOOTSELを押しながらUSB接続
  2. BOOTSELを離す

Picoが自動マウントされるのでマウント先に.uf2ファイルをコピーする

cp cylinder_ros2_pico_micro_ros.uf2 /media/$USER/RPI-RP2

実行方法

terminal#1

ros2 launch cylinder_ros2 cylinder.launch.py

あるいは

ros2 launch cylinder_ros2 cylinder_withIMU.launch.py

SLAM-ToolBox起動

terminal#2

ros2 launch cylinder_ros2 online_async_launch.py

map保存

terminal#3

cd /home/ubuntu/ros2_ws/src/cylinder_ros2/cmd
./map_save.sh <mapname>

Nav2起動

terminal#3

ros2 launch cylinder_ros2 navigation2.launch.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published