Skip to content

Commit

Permalink
Feature create raspicat simulation world (#77)
Browse files Browse the repository at this point in the history
* Fix branch name

* Feature create_raspicat_simulation_world
  • Loading branch information
uhobeike authored Sep 15, 2023
1 parent 8d08074 commit 193b3ec
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
push:
branches:
- master
- main
jobs:
deploy:
runs-on: ubuntu-latest
Expand Down
63 changes: 63 additions & 0 deletions docs/document/simulator/create_raspicat_simulation_world.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
## 概要
地図からGazeboのシミュレータ環境を作成し、Raspberry Pi Catを動かす方法について説明します。

## 必要な物
| Software | Version |
| ---------------- | -------------------------------------------- |
| ノートPC(Dockerインストール済み) | Ubuntu 22.04(ROS 2 Humble) |

## パッケージのビルド&インストール

```sh
mkdir -p raspicat_map2gazebo_ws/src && cd raspicat_map2gazebo_ws
git clone https://github.com/CIT-Autonomous-Robot-Lab/raspicat_map2gazebo.git src/raspicat_map2gazebo
vcs import src < src/raspicat_map2gazebo/raspicat_map2gazebo.repos --debug
rosdep update
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
colcon build --symlink-install
source $HOME/.bashrc
```

## シミュレータ環境の作成
`map_yaml``map_pgm``config_dir`は、絶対パスを入力してください。
`world_name``author_name``email`は、任意の名前を入力してください。

```
ros2 launch raspicat_map2gazebo map2gazebo.launch.xml \
map_yaml:=$(ros2 pkg prefix --share raspicat_map2gazebo)/config/map/map_tsudanuma_2_19.yaml \
map_pgm:=$(ros2 pkg prefix --share raspicat_map2gazebo)/config/map/map_tsudanuma_2_19.pgm \
config_dir:=$(ros2 pkg prefix --share raspicat_map2gazebo)/config \
world_name:=tsudanuma_2_19 \
author_name:=hoge \
email:=hoge.com
```

## シミュレータ環境のチェック
**シミュレータ環境の作成**で入力した同じ`world_name`を入力してください。
生成したモデルを読み込むために`colcon build`を実行する必要があります。
```
cd raspicat_map2gazebo_ws
colcon build --symlink-install
ros2 launch raspicat_map2gazebo check_gazebo_world.launch.xml \
world_name:=tsudanuma_2_19
```

[![Image from Gyazo](https://i.gyazo.com/e63309d74a689ba7f740d74e3c03d436.png)](https://gyazo.com/e63309d74a689ba7f740d74e3c03d436)

## シミュレータ環境の実行
* 環境の立ち上げ
```
cd raspicat_map2gazebo_ws
colcon build --symlink-install
ros2 launch raspicat_map2gazebo raspicat_tsudanuma_2_19_world.launch \
x_pose:=0.0 \
y_pose:=0.0
```

* ジョイスティックコントローラ操作
```
ros2 service call /motor_power std_srvs/SetBool '{data: true}'
ros2 launch raspicat_bringup teleop.launch.py teleop:=joy
```

[![Image from Gyazo](https://i.gyazo.com/ee6f2b936329faaac3a8cc28f169c10e.png)](https://gyazo.com/ee6f2b936329faaac3a8cc28f169c10e)
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ nav:
- Raspberry Pi Catについて: document/raspicat_documentaion.md

- Simulator:
- Create Raspberry Pi Cat Simulation World: document/simulator/create_raspicat_simulation_world.md
- Raspberry Pi Cat Simulator: document/simulator/raspicat_simulator.md
- Real Machine:
- Set Up:
Expand Down

0 comments on commit 193b3ec

Please sign in to comment.