Skip to content

Commit

Permalink
Change directory tree (#91)
Browse files Browse the repository at this point in the history
ミーティングで話したようにディレクトリを変えます

<img width="417" alt="image"
src="https://github.com/pf-robotics/baku-kachaka-api/assets/98455255/59f01832-3efc-47a8-ad79-872f54e99010">

---------

Co-authored-by: Yutaka Kondo <youtalk@pfrobotics.jp>
  • Loading branch information
nozaki-pfr and youtalk-pfr committed Aug 8, 2023
1 parent 50020ca commit dd6af0a
Show file tree
Hide file tree
Showing 74 changed files with 49 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .flexci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ BUILD_VERSION="$(git describe --always --dirty --all --long)-$(date '+%Y%m%d-%H%
prepare_build "${project}" "${FLEXCI_BRANCH}"

BASE_ARCH=""
DOCKERFILE=Dockerfile
DOCKERFILE=ros2/Dockerfile
TARGET_NAMES=("${JAMMY_TARGET_NAMES[@]}")
if [[ "${project}" == kachaka-api.ros.aarch64 ]]; then
BASE_ARCH=aarch64
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ readme = "README.md"
[project.urls]
Repository = "https://github.com/pf-robotics/kachaka-api"

[tool.setuptools]
package-dir = {"" = "python"}

[tool.pysen]
version = "0.10.5"

Expand All @@ -21,7 +24,7 @@ line_length = 80
[tool.pysen.lint.source]
excludes = [
".flexci/env.sh",
"kachaka_api/generated",
"python/kachaka_api/generated",
]

[tool.pysen.plugin.clang_format]
Expand Down
3 changes: 1 addition & 2 deletions example/command_gui.ipynb → python/demos/command_gui.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"metadata": {},
"outputs": [],
"source": [
"%run setup_example_env.py"
"%run setup_demo_env.py"
]
},
{
Expand All @@ -45,7 +45,6 @@
"import grpc\n",
"import ipywidgets as widgets\n",
"import kachaka_api_pb2\n",
"\n",
"from kachaka_api.aio import KachakaApiClient\n",
"from kachaka_api.aio.layout_util import ShelfLocationResolver\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"metadata": {},
"outputs": [],
"source": [
"%run ../setup_example_env.py"
"%run setup_demo_env.py"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"metadata": {},
"outputs": [],
"source": [
"%run ../setup_example_env.py"
"%run setup_demo_env.py"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"metadata": {},
"outputs": [],
"source": [
"%run ../setup_example_env.py"
"%run setup_demo_env.py"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"metadata": {},
"outputs": [],
"source": [
"%run setup_example_env.py"
"%run setup_demo_env.py"
]
},
{
Expand Down
8 changes: 3 additions & 5 deletions example/get_imu.ipynb → python/demos/get_imu.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"metadata": {},
"outputs": [],
"source": [
"%run setup_example_env.py"
"%run setup_demo_env.py"
]
},
{
Expand Down Expand Up @@ -67,7 +67,6 @@
"import grpc\n",
"import kachaka_api_pb2\n",
"import plotly.graph_objects as go\n",
"\n",
"from kachaka_api.aio import KachakaApiClient\n",
"\n",
"MAX_POINTS = 100\n",
Expand All @@ -76,7 +75,7 @@
"data = [0] * MAX_POINTS\n",
"f.add_scatter(y=data)\n",
"f.layout.title = \"IMU acceleration x\"\n",
"f\n"
"f"
]
},
{
Expand All @@ -86,14 +85,13 @@
"metadata": {},
"outputs": [],
"source": [
"\n",
"client = await KachakaApiClient.create()\n",
"for i in range(100):\n",
" imu = await client.get_ros_imu()\n",
"\n",
" data.append(imu.linear_acceleration.x)\n",
" del data[0]\n",
" f.data[0].y = data\n"
" f.data[0].y = data"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"metadata": {},
"outputs": [],
"source": [
"%run setup_example_env.py"
"%run setup_demo_env.py"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion example/get_map.ipynb → python/demos/get_map.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"metadata": {},
"outputs": [],
"source": [
"%run setup_example_env.py"
"%run setup_demo_env.py"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"metadata": {},
"outputs": [],
"source": [
"%run ../setup_example_env.py"
"%run setup_demo_env.py"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"metadata": {},
"outputs": [],
"source": [
"%run setup_example_env.py"
"%run setup_demo_env.py"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"metadata": {},
"outputs": [],
"source": [
"%run setup_example_env.py\n",
"%run setup_demo_env.py\n",
"import kachaka_api\n",
"\n",
"client = kachaka_api.KachakaApiClient()\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"outputs": [],
"source": [
"# kachaka_apiをimport可能にするため、パスに追加するスクリプトです。サンプル以外の用途では、pip等でinstallしてください。\n",
"%run setup_example_env.py"
"%run setup_demo_env.py"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"metadata": {},
"outputs": [],
"source": [
"%run setup_example_env.py"
"%run setup_demo_env.py"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion example/vision/qrcode.ipynb → python/demos/qrcode.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"metadata": {},
"outputs": [],
"source": [
"%run ../setup_example_env.py"
"%run setup_demo_env.py"
]
},
{
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion example/speak.ipynb → python/demos/speak.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"metadata": {},
"outputs": [],
"source": [
"%run setup_example_env.py"
"%run setup_demo_env.py"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion example/teleop.ipynb → python/demos/teleop.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"metadata": {},
"outputs": [],
"source": [
"%run setup_example_env.py"
"%run setup_demo_env.py"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"metadata": {},
"outputs": [],
"source": [
"%run ../setup_example_env.py"
"%run setup_demo_env.py"
]
},
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
mkidr -p ~/ros2_ws/src
cd ~/ros2_ws/src
cp -r ~/kachaka-api/ros2/kachaka_interfaces .
cp -r ~/kachaka-api/ros2_sample/follow .
cp -r ~/kachaka-api/ros2/demos/kachaka_follow .
cd ~/ros2_ws
colcon build
Expand All @@ -33,6 +33,6 @@ cd ~/kachaka-api/ros2_bridge
```
cd ~/ros2_ws
source install/setup.bash
ros2 run follow follow
ros2 run kachaka_follow follow
```

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?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>follow</name>
<name>kachaka_follow</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="terakoji@pfrobotics.jp">terakoji</maintainer>
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup

package_name = "follow"
package_name = "kachaka_follow"

setup(
name=package_name,
Expand All @@ -21,6 +21,6 @@
license="TODO: License declaration",
tests_require=["pytest"],
entry_points={
"console_scripts": ["follow = follow.follow:main"],
"console_scripts": ["follow = kachaka_follow.follow:main"],
},
)
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
ln -s ~/kachaka-api/ros2/kachaka_interfaces/ kachaka_interfaces
ln -s ~/kachaka-api/ros2_sample/smart_speaker/ smart_speaker
ln -s ~/kachaka-api/ros2/demos/kachaka_smart_speaker/ kachaka_smart_speaker
cd ~/ros2_ws
colcon build
Expand All @@ -67,13 +67,13 @@ colcon build
## 実行


* ros2bridgeを起動した上で、以下のコマンドを実行します
* ros2_bridgeを起動した上で、以下のコマンドを実行します
```
cd ~/ros2_ws
source install/setup.bash
export TOKEN=<BeeBotteのトークン>
wget https://beebotte.com/certs/mqtt.beebotte.com.pem
ros2 run smart_speaker smart_speaker
ros2 run kachaka_smart_speaker smart_speaker
```
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?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>smart_speaker</name>
<name>kachaka_smart_speaker</name>
<version>0.0.0</version>
<description>ROS2 sample smart_speaker</description>
<maintainer email="support@kachaka.life">Kahacka Customer Support</maintainer>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup

package_name = "smart_speaker"
package_name = "kachaka_smart_speaker"

setup(
name=package_name,
Expand All @@ -22,7 +22,7 @@
tests_require=["pytest"],
entry_points={
"console_scripts": [
"smart_speaker = smart_speaker.smart_speaker:main",
"smart_speaker = kachaka_smart_speaker.smart_speaker:main",
],
},
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ git clone https://github.com/pf-robotics/kachaka-api.git
mkidr -p ~/ros2_ws/src
cd ~/ros2_ws/src
ln -s ~/kachaka-api/ros2/kachaka_interfaces .
ln -s ~/kachaka-api/ros2_sample/speak .
ln -s ~/kachaka-api/ros2/demos/kachaka_speak .
cd ~/ros2_ws
colcon build
```

## 実行方法

* ros2bridgeを起動した状態で、以下のコマンドを実行します
* ros2_bridgeを起動した状態で、以下のコマンドを実行します

```
cd ~/ros2_ws
source install/setup.bash
ros2 run speak speak
ros2 run kachaka_speak speak
```
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?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>speak</name>
<name>kachaka_speak</name>
<version>0.0.0</version>
<description>ROS2 speak sample</description>
<maintainer email="support@kachaka.life">Kahacka Customer Support</maintainer>
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup

package_name = "speak"
package_name = "kachaka_speak"

setup(
name=package_name,
Expand All @@ -22,7 +22,7 @@
tests_require=["pytest"],
entry_points={
"console_scripts": [
"speak = speak.speak:main",
"speak = kachaka_speak.speak:main",
],
},
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.8)
project(vision)
project(kachaka_vision)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Download model and config file from the internet.

```bash
cd ~/kachaka-api/ros2_sample/vision/config
cd ~/kachaka-api/ros2/demos/kachaka_vision/config
# sometimes the following link is not available, then please see and find the mirror link in https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/1567
wget http://posefs1.perception.cs.cmu.edu/OpenPose/models/hand/pose_iter_102000.caffemodel
wget https://raw.githubusercontent.com/CMU-Perceptual-Computing-Lab/openpose/master/models/hand/pose_deploy.prototxt
Expand All @@ -20,7 +20,7 @@ wget https://raw.githubusercontent.com/CMU-Perceptual-Computing-Lab/openpose/mas
```bash
mkidr -p ~/ros2_ws/src
cd ~/ros2_ws/src
cp -r ~/kachaka-api/ros2_sample/vision .
cp -r ~/kachaka-api/ros2/demos/kachaka_vision .

cd ~/ros2_ws
colcon build
Expand All @@ -41,7 +41,7 @@ cd ~/kachaka-api/ros2_bridge
```bash
cd ~/ros2_ws
source install/setup.bash
ros2 launch vision hand_recognition_launch.py
ros2 launch kachaka_vision hand_recognition_launch.py
```
* Now, let's check the output image by the following command on another terminal, then put your hand on the front camera.
Expand Down
File renamed without changes.
File renamed without changes
Loading

0 comments on commit dd6af0a

Please sign in to comment.