Skip to content

Commit

Permalink
Merge pull request #1 from a-ichikura/add-codesigned-robot-demos
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
sawada10 authored Feb 12, 2025
2 parents c328d71 + 3d27cb6 commit 60a2a7d
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 2 deletions.
44 changes: 43 additions & 1 deletion jsk_2023_12_codesign/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ source <ワークスペース>/devel/setup.bash
roslaunch jsk_2023_12_codesign codesigned_robot.launch robot_name:=kuromitsu
```
※launchするときにrobot_nameに動かしたいロボットの名前(kashiwagi/kuromitsu)を指定する。
※joyを使いたいときは、joyをlaunchファイルを立ち上げているPCにUSB接続したうえで、`joy``true`に設定する。
e.g.
```
roslaunch jsk_2023_12_codesign codesigned_robot.launch joy:=true
```

### 動作を保存する
```
Expand Down Expand Up @@ -70,5 +75,42 @@ $ ipython
```

## TODO(2025-01-31)
### 目の光らせ方・ほっぺ, 梅の光らせ方
### 目・ほっぺ・梅の光らせ方
```
source <ワークスペース>/devel/setup.bash
roslaunch jsk_2023_12_codesign codesigned_module.launch
```
した上で、以下の表に示すトピックにpublishすることで変化する

| 箇所 | トピック || 機能 |
| ------------- | ------------- |---| --- |
|| `/eye_status` |UInt16| 表情変化 |
| ほっぺ | `/cheek/led_blink_time` | UInt16 |点滅回数を指定|
||`/cheek/led_duration`| UInt16 | 点滅時間を秒数で指定|
||`/cheek/led_mode`| UInt16 | 光り方を1,2,3で指定 1:常時 2:点滅 3:虹色|
||`/cheek/led_rainbow_delta_hue`| UInt16 | 虹色の光り方を1-50で指定(数字が大きいほど隣同士が別の色)|
||`/cheek/led_rgb`| ColorRGBA |r:Red, g:Green, b:Blue, a:明るさ (rgbは0-255で指定, aは10くらいでOK) |
| 梅(柏木さんのみ) | `/ume/led_blink_time` |UInt16|点滅回数を指定 |
||`/ume/led_duration`| UInt16 | 点滅時間を秒数で指定|
||`/ume/led_mode`| UInt16 |光り方を1,2,3で指定 1:常時 2:点滅 3:虹色 |
||`/ume/led_rainbow_delta_hue`| UInt16 |虹色の光り方を1-50で指定(数字が大きいほど隣同士が別の色) |
||`/ume/led_rgb`| ColorRGBA |r:Red, g:Green, b:Blue, a:明るさ (rgbは0-255で指定, aは10くらいでOK)|

<表情の対応表>
| 番号 | くろみつ |柏木さん|
|---|---|---|
|0| 通常|通常|
|1| まばたき|まばたき|
|2| キラキラ|おどろき|
|3| 眠い |眠い|
|4| 真剣 |怒る|
|5| 悲しい|悲しい|
|6| 嬉しい |楽しい|
|7|悔しい1|困る|
|8| 悔しい2|嬉しい|
|9| 退屈|期待|
|10| ハート ||
|11| ぐるぐる ||
|12| キラキラ2||

### くろみつでの動作確認
17 changes: 17 additions & 0 deletions jsk_2023_12_codesign/config/dualshock3_teleop_twist_joy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
axis_linear:
x: 1
y: 0
scale_linear:
x: 0.5
y: 0.3
scale_linear_turbo:
x: 1.2
y: 0.3
axis_angular:
yaw: 3
scale_angular:
yaw: 0.5
scale_angular_turbo:
yaw: 0.7
enable_button: 4
enable_turbo_button: 7
7 changes: 6 additions & 1 deletion jsk_2023_12_codesign/launch/codesigned_robot.launch
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<!-- Define the path to the servo configuration file -->
<arg name="servo_config_path" value="$(find codesigned_robot_2023)/config/$(arg robot_name)_servo_config.yaml" />

<!-- Define the joystick launch flag -->
<arg name="joy" default="false" />

<!-- Launch the main controller -->
<include file="$(find kxr_controller)/launch/kxr_controller.launch">
<arg name="urdf_path" value="$(arg urdf_path)" />
Expand All @@ -21,6 +24,8 @@
<include file="$(find kxr_controller)/launch/diff_drive_controller.launch" />

<!-- Launch the joystick control (uncomment if needed) -->
<!-- <include file="$(find kxr_controller)/launch/joy.launch" /> -->
<group if="$(arg joy)">
<include file="$(find jsk_2023_12_codesign)/launch/joy.launch" />
</group>

</launch>
24 changes: 24 additions & 0 deletions jsk_2023_12_codesign/launch/joy.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<launch>

<arg name="joy_topic" default="/joy" />
<arg name="cmd_vel_topic" default="/diff_drive_controller/cmd_vel" />

<arg name="teleop_twist_joy_param_file" default="$(find jsk_2023_12_codesign)/config/dualshock3_teleop_twist_joy.yaml" />

<node name="joy_node"
pkg="joy" type="joy_node"
respawn="true">
<remap from="joy" to="joy"/>
<param name="dev" value="/dev/input/js0" />
<param name="deadzone" value="0.1" />
<param name="autorepeat_rate" value="10" />
</node>

<node name="teleop_twist_joy"
pkg="teleop_twist_joy" type="teleop_node" >
<remap from="joy" to="$(arg joy_topic)" />
<remap from="cmd_vel" to="$(arg cmd_vel_topic)" />
<rosparam command="load" file="$(arg teleop_twist_joy_param_file)" />
</node>

</launch>

0 comments on commit 60a2a7d

Please sign in to comment.