Skip to content

シミュレータのインストール

Raspberry Pi Mouse Simulator(rt-net/raspimouse_sim)はメインボードにRaspberry Piを使った左右独立二輪方式の小型移動プラットフォームロボット、Raspberry Pi Mouseのシミュレータです。

このページでは、 rt-net/raspimouse_sim パッケージを用いたシミュレーションのセットアップ方法と動作確認方法を説明します。

使用機材

  • ノートパソコン等のPC
    • OS(Ubuntu Desktop)がインストール済みであることを前提としています
      • ROS 2 Humbleを使用する場合: Ubuntu Desktop 22.04
      • ROS Noeticを使用する場合: Ubuntu Desktop 20.04
    • ROSまたはROS 2がインストール済みであることを前提としています

パッケージのダウンロードとインストール

次のコマンドを実行します。

シミュレータパッケージのダウンロード

cd ~/catkin_ws/src
git clone https://github.com/rt-net/raspimouse_sim.git

依存パッケージをインストール

git clone https://github.com/rt-net/raspimouse.git
git clone https://github.com/rt-net/raspimouse_description.git
rosdep install -r -y -i --from-paths raspimouse*

パッケージをビルド

cd ~/catkin_ws && catkin_make
source ~/catkin_ws/devel/setup.bash

Gazeboで使用するハードウェアモデルデータをダウンロード

rosrun raspimouse_gazebo download_gazebo_models.sh

次のコマンドを実行します。

シミュレータパッケージのダウンロード

cd ~/ros2_ws/src
git clone -b humble-devel https://github.com/rt-net/raspimouse_sim.git

依存パッケージをインストール

git clone -b humble-devel https://github.com/rt-net/raspimouse_ros2_examples.git
git clone -b humble-devel https://github.com/rt-net/raspimouse_slam_navigation_ros2.git
rosdep install -r -y -i --from-paths raspimouse*

キーボードで操作するためのパッケージをインストール

git clone -b dashing https://github.com/ros2/teleop_twist_keyboard.git

パッケージをビルド

cd ~/ros2_ws
colcon build --symlink-install
source ~/ros2_ws/install/setup.bash

動作確認(キーボードで操縦)

次のコマンドを実行します。

シミュレータの起動

roslaunch raspimouse_gazebo raspimouse_with_samplemaze.launch

別のターミナルでコマンドを実行

rosrun teleop_twist_keyboard teleop_twist_keyboard.py _speed:=0.1 _turn:=1.57

次のコマンドを実行します。

シミュレータの起動

ros2 launch raspimouse_gazebo raspimouse_with_emptyworld.launch.py

別のターミナルでコマンドを実行

ros2 run teleop_twist_keyboard teleop_twist_keyboard