Skip to content

Commit

Permalink
🔄 synced local 'docs' with remote 'cheatsheets'
Browse files Browse the repository at this point in the history
  • Loading branch information
HansRobo committed Feb 5, 2025
1 parent d8fbc24 commit 34881ef
Show file tree
Hide file tree
Showing 26 changed files with 209 additions and 213 deletions.
2 changes: 1 addition & 1 deletion docs/AIとの付き合い方.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ created: 2025-01-14 04:48:47
人間なら間違えても許されるようなタスクでも、AIになった途端に完璧を求めて「使えない」という人も多い。
完璧かそうじゃないか、という解像度の低い使い方はせずに、人間相手にそうやっているように、性能に応じた期待値を自分の中で適切に設定して使う。

## 得意なことを把握して使う
## 得意なことを把握して使う
1 change: 0 additions & 1 deletion docs/C++|イディオム.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ intro: C++|便利イディオム
### Type Erasure

[More C++ Idioms(English version)](https://en.wikibooks.org/wiki/More_C++_Idioms/Type_Erasure)

2 changes: 1 addition & 1 deletion docs/C++|勉強日記.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ enum class [[maybe_unused]] E {
B
};
```

関数の引数の場合,maybe_unusedを指定せずとも,引数名を定義しないことで警告を抑制できる.

```cpp
Expand Down
22 changes: 10 additions & 12 deletions docs/CMake.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ if( Boost_FOUND )
endif()
```



### cmakeの関数の引数

#### 基礎
Expand All @@ -33,25 +31,25 @@ endif()

```cmake
function(関数名 引数名1 引数名2)
message("ARG1 = ${引数名1}")
message("ARG2 = ${引数名2}")
message("ARGN = ${ARGN}")
message("ARG1 = ${引数名1}")
message("ARG2 = ${引数名2}")
message("ARGN = ${ARGN}")
endfunction()
```

#### パース

```cmake          
```cmake
cmake_parse_arguments(
MYFUNC     # 変数のプレフィックス
"BOOL_VAR" # 真偽値をとる変数の名前
"VAR1;VAR2" # 値を1つだけとる変数の名前
"MULTIPLE_OUTPUT" # 値を複数とる変数の名前
${ARGN}       # パース元
MYFUNC     # 変数のプレフィックス
"BOOL_VAR" # 真偽値をとる変数の名前
"VAR1;VAR2" # 値を1つだけとる変数の名前
"MULTIPLE_OUTPUT" # 値を複数とる変数の名前
${ARGN}       # パース元
)
```

- 変数はセミコロン区切りで複数指定可能
- CMakeには名前空間がないのでプレフィックスをつけることで名前の衝突を回避
- 今回は`MYFUNC_VAR1`とかになる
- 今回は`MYFUNC_VAR1`とかになる
- パースされなかったものは`PREFIX_UNPARSED_ARGUMENTS`に詰められる
8 changes: 3 additions & 5 deletions docs/GNOME 拡張機能.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ intro: おすすめGNOME拡張機能

![screenshot](https://extensions.gnome.org/extension-data/screenshots/screenshot_4472.png)


### Extension Sync

GitHubのgist経由でGNOME拡張機能の設定ファイルを同期できるプラグイン
Expand All @@ -57,9 +56,10 @@ GitHubのgist経由でGNOME拡張機能の設定ファイルを同期できる
現在、Ubuntu24.04では使えないので残念

同期するには設定で以下の2点が必要

- GitHub GistのID
- 初めての場合[ここ](https://gist.github.com/)から作る
- 入力するのは`https://gist.github.com/username/XXXXX`の`XXXX`
- 初めての場合[ここ](https://gist.github.com/)から作る
- 入力するのは`https://gist.github.com/username/XXXXX``XXXX`
- GitHubのパーソナルアクセストークン
![](https://camo.githubusercontent.com/4c0e0828590709add17450112c0e65a9b053f7aef2f6c24df274c3ff263404ae/68747470733a2f2f692e696d6775722e636f6d2f345376334a75732e706e67)

Expand All @@ -70,7 +70,6 @@ GitHubのgist経由でGNOME拡張機能の設定ファイルを同期できる

![](https://extensions.gnome.org/extension-data/screenshots/screenshot_4548_Xf0qiGj.gif)


### Clipboard Indicator

[Clipboard Indicator - GNOME Shell Extensions](https://extensions.gnome.org/extension/779/clipboard-indicator/)
Expand All @@ -79,7 +78,6 @@ GitHubのgist経由でGNOME拡張機能の設定ファイルを同期できる

![](https://extensions.gnome.org/extension-data/screenshots/screenshot_779_GiNDiJq.png)


### TopHat

[TopHat - GNOME Shell Extensions](https://extensions.gnome.org/extension/5219/tophat/)
Expand Down
4 changes: 1 addition & 3 deletions docs/GitHub Actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ intro: GitHub Actions
pull_request
[Webhook のイベントとペイロード - GitHub Docs](https://docs.github.com/ja/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request)


## paths, paths-ignore フィルターについて

- 同時に両方使えない
- pathsでは!が使える
- paths-ignoreで書けてpathsで書けない表現は無く,逆は成り立たない
- paths-ignoreで書けてpathsで書けない表現は無く,逆は成り立たない

参考:[GitHub Actionsにおけるpathsとpaths-ignoreをベン図で理解する - Qiita](https://qiita.com/nacam403/items/3e2a5df5e88ba20aa76a)

Expand All @@ -41,4 +40,3 @@ pull_request
host: github.com
private-key: ${{ secrets.GIT_SSH_SECRET }}
```
1 change: 0 additions & 1 deletion docs/GitHub.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ intro: GitHub
2. base, compareのそれぞれにブランチ名・タグ名・コミットハッシュなどを設定して比較

### フォークを常に最新に保つ

10 changes: 4 additions & 6 deletions docs/ROS Context.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,27 @@ created: 2024-02-23 10:24:46

rclcpp::initではこのデフォルトコンテキストを初期化している。


## オリジナル Contextを使ったROS 2プログラミング

rclcpp::initはデフォルトContextをinitしているに過ぎないので、
オリジナルContextしか使わない場合はContext::initさえしておけばrclcpp::initする必要はない


## CallbackGroup

## NodeOptions
ノードに対応する設定
-

ノードに対応する設定
-

## InitOptions

contextに対応する設定
- domain IDがセットできる

- domain IDがセットできる

## ExecutorOptions

rclcpp::memory_strategy::MemoryStrategy::SharedPtr memory_strategy;
rclcpp::Context::SharedPtr context;
size_t max_conditions;
=>デフォルトコンテキストが使われる
=>デフォルトコンテキストが使われる
10 changes: 5 additions & 5 deletions docs/ROS Message.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ intro: ROS Message
## ??\_msgs/msg/details フォルダの中身は何なのか?

- xx\_\_builder.hpp
- メッセージの構築処理
- メッセージの構築処理
- xx\_\_functions.h/c
- コピー・等号関数の定義など
- コピー・等号関数の定義など
- xx\_\_rosidl_type_support_\<dds\>\_c/ccp.h/hpp
- シリアライズ・デシリアライズ関数
- シリアライズ・デシリアライズ関数
- xx\_\_struct.h/hpp
- structの定義、equal/ not equal演算子の定義
- structの定義、equal/ not equal演算子の定義
- xx\_\_traitshpp
- yamlへの変換関数の定義
- yamlへの変換関数の定義
- xx\_\_type_support.h/hpp/c
17 changes: 8 additions & 9 deletions docs/ROS News.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,33 @@ intro: ROS News

## `qos_event`から`event_handler`への以降



### `rclcpp::spin_until_timeout`関数の追加

テストを書く時に便利に使えそう

```c++
void spin_until_timeout(rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr,
void spin_until_timeout(rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr,
std::chrono::duration< TimeRepT, TimeT > timeout)
```
- [提案Issue](https://github.com/ros2/rclcpp/issues/1821)
- [PullRequest #1874](https://github.com/ros2/rclcpp/pull/1874)
- 2022/01/24に`rolling`にマージ
- 2022/01/24に`rolling`にマージ
- [デグレ発覚によりリバート #1956](https://github.com/ros2/rclcpp/pull/1956)
- 2022/01/25
- 2022/01/25
- [現在再マージに向けて調整中 #1957](https://github.com/ros2/rclcpp/pull/1957)
### `ros2 interface package` にフィルターのオプション追加
[Add interface type filters to ros2 interface package by DLu · Pull Request #765 · ros2/ros2cli · GitHub](https://github.com/ros2/ros2cli/pull/765)
以下のようにズラッとでてくるのをフィルターするため以下のオプションが追加される
- `--only-msgs`
- `--only-srvs`
- `--only-actions`
-
-
```shell
hans@hans$ ros2 interface package std_msgs
std_msgs/msg/Char
Expand All @@ -60,7 +60,7 @@ Nodeクラスのインタフェースは適切に分離されて提供されて
create_service(
std::shared_ptr<node_interfaces::NodeBaseInterface> node_base,
std::shared_ptr<node_interfaces::NodeServicesInterface> node_services,

auto service = create_service(
my_node_class->get_node_base_interface(),
my_node_class->get_node_services_interface(),
Expand All @@ -80,7 +80,6 @@ auto service = create_service(
// ...
```


### `ros2 topic echo`での `--timeout <sec>`オプション
[Adds a timeout feature to rostopic echo by arjo129 · Pull Request #792 · ros2/ros2cli · GitHub](https://github.com/ros2/ros2cli/pull/792)

[Adds a timeout feature to rostopic echo by arjo129 · Pull Request #792 · ros2/ros2cli · GitHub](https://github.com/ros2/ros2cli/pull/792)
1 change: 0 additions & 1 deletion docs/ROS Packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,3 @@ rosros.spin()

色々ツールがあるが,実装を見て何がリアルタイムになって何がリアルタイムにならないか把握し上で使ったほうが良さそう.
例えば,RealTimePublisherはpublish関数にブロックされる時間が短くなるだけで通信がリアルタイムになったりする効果はない

Loading

0 comments on commit 34881ef

Please sign in to comment.