pseudowire

調べたことを書き残す

ICTがGHG削減に貢献できる領域のうち大きな割合を占める技術領域

各機関の調査

United Nation(UN)

  • Global e-Sustainability Initiative (GeSI)から引用
  • 2030年までに世界のGHGを20%(12ギガトン)削減できる可能性について言及

GeSIによるICT技術のGHG排出量削減効果の見込み

World Economic Forum(WEF)

2020年の各分野の割合と2050年までのICTによる削減量
  • エネルギー分野:43%(削減量:8%)
  • 材料分野:26%(削減量:7%)
  • モビリティ分野:24%(削減量:5%)
Future of Jobs Report 2023

Fastest-growing jobs are

  • AI and machine learning specialists
  • sustainability specialists
  • business intelligence analysts
  • information security specialists

将来需要が増える仕事:サステナビリティスペシャリスト

Ericsson

2030年までのICTによる削減量と分野
  • Potential of up to 15% with agriculture included
  • the total potential GHG reduction was estimated to be about 4 Gt and 8 Gt CO2-equivalents, respectively (or about 5 and 10 Gt including agriculture).

エリクソンによるICTのGHG削減効果

詳細な研究レポート
  • The need for office space could be reduced due to dematerializations including fewer bookshelves, thinner screens, less paper, no fixed phones, fewer printers and so on, but it is assumed that this potential has to a large extent already been realized.
  • However, some potential still remains in terms of flexi-work spaces, open offices, etc., especially in the global perspective.

GHG削減効果が大きいICT領域

Cornell University

  • We assess the greenhouse gas emissions of this transition, considering factors including information and communication technology, commuting, noncommute travel, and office and residential energy use.
  • We find that, in the United States, switching from working onsite to working from home can reduce up to 58% of work's carbon footprint, and the impacts of IT usage are negligible, while office energy use and noncommute travel impacts are important.

Fig.S4_Climate mitigation potentials of teleworking are sensitive to changes in lifestyle and workplace rather than ICT usage

Ubuntu初期設定関連のトラシュー

netplan変更後にやること

ラズパイにUbuntu Server 20.04をインストールして動かすときにネットワーク(wlan0)を設定する場合、netplanを変更するが、一発で設定が反映されないためTipsを書き残す。

sudo vi /etc/netplan/99-cloud-init.yaml

ip addr
sudo netplan --debug generate
sudo netplan apply

RPi4(ROS親機:Ubuntu20.04)とRPi3(TB3実機:Ubuntu20.04)間のPing不通問題

なぜかわからないが、この2台間だけ同セグ通信ができなかった。 双方にGW向けのホストルートを書いて解決。

RViz関連不具合

RPi4にUbuntu Serverインストール後、ROS、TB3のインストールを実行し、 最後にデスクトップ機能をインストールしたところ、RVizが起動しなかった。

qt.qpa.xcb: could not connect to display

これで解決。

export DISPLAY=:1 # run in docker image terminal

Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 3518 (unattended-upgr)

Ubuntuでapt updateができない

Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 3518 (unattended-upgr)
sudo lsof /var/lib/dpkg/lock-frontend
ps aux | grep apt

unattended-upgrades とは

自動アップデートを行うパッケージ。 止め方などは以下参照

sudo apt install -y unattended-upgrades
sudo dpkg-reconfigure --priority=low unattended-upgrades
Replacing config file /etc/apt/apt.conf.d/20auto-upgrades with new version

聞かれる質問にはNoを選択するらしい marginalia.hatenablog.com

暫定措置

sudo rm /var/lib/apt/lists/lock
sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/dpkg/lock-frontend

marginalia.hatenablog.com

traffic-editorが使えなかったのでHumbleでOpen-RMF環境を再作成

経緯

前回、参考先URLに沿ってFree-Fleetをインストールしたが、Traffic-editorが使えなかったので、環境作成からやり直した。 Humble環境でOpen-RMFをインストール後に、Free-Fleetをインストールする手順で一応、無事に完了したので手順をメモ。 ソースからビルドしようとしていたが2日間くらいハマった。時間がやたらかかるので断念してバイナリインストールの手順に切り替えて実施した。

インストールガイドに沿って手順を進める。

sudo apt update && sudo apt install \
  python3-pip \
  curl \
  python3-colcon-mixin \
  ros-dev-tools \
  -y

sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -

python3 -m pip install flask-socketio fastapi uvicorn

sudo rosdep init # run if first time using rosdep.
rosdep update

colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
colcon mixin update default

「ソースからのビルド」ではなく「バイナリインストール」を選択。

sudo apt update && sudo apt install ros-humble-rmf-dev

mkdir ~/rmf_ws/src -p
cd ~/rmf_ws/src
git clone https://github.com/open-rmf/rmf_demos.git -b 2.0.3
cd ~/rmf_ws
colcon build

Free-Fleetをインストール。

git clone https://github.com/open-rmf/free_fleet -b main
rm -rf ./free_fleet/free_fleet_client_ros2
cd ..
source /opt/ros/humble/setup.bash
rosdep install --from-paths src --ignore-src --rosdistro humble -yr
colcon build --symlink-install  --packages-skip-build-finished --continue-on-error --parallel-workers 4

Troubleshooting_1

ビルド時にこんな感じのエラーが出たら source /opt/ros/humble/setup.bash で解決。

CMake Error at CMakeLists.txt:13 (find_package):
By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"ament_cmake", but CMake did not find one.

Could not find a package configuration file provided by "ament_cmake" with
any of the following names:

ament_cmakeConfig.cmake
ament_cmake-config.cmake
Add the installation prefix of "ament_cmake" to CMAKE_PREFIX_PATH or set
"ament_cmake_DIR" to a directory containing one of the above files. If
"ament_cmake" provides a separate development package or SDK, be sure it
has been installed.

Troubleshooting_2

特定のパッケージのビルドをスキップしたいときは、以下のようにCOLCON_IGNOREファイルを当該Dir直下に作成するとスキップできる。

touch src/ros-visualization/COLCON_IGNORE

Troubleshooting_3

--packages-skip-build-finished:すでにビルド済みのパッケージをスキップしたいとき --parallel-workers 1:CPUが高騰して発熱でシステムが落ちるとき

colcon build --symlink-install  --packages-skip-build-finished --continue-on-error --parallel-workers 1

Ref

github.com

qiita.com

christina04.hatenablog.com

Open-RMFを使って群制御をやってみる

Env

  • Ubuntu 22.04
  • Docker Desktop 4.21.1 (
  • Ubuntu on Docker 20.04
  • ROS2 Foxy

Troubleshooting_1

root@5901057b3d24:~/ff_ros2_ws# rosdep install --from-paths src --ignore-src -y --rosdistro foxy
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
ff_examples_ros2: Cannot locate rosdep definition for [turtlebot3_navigation2]
ff_examples_ros1: Cannot locate rosdep definition for [catkin]
free_fleet_client_ros1: Cannot locate rosdep definition for [move_base_msgs]
free_fleet_client_ros2: Cannot locate rosdep definition for [nav2_msgs]
free_fleet: Cannot locate rosdep definition for [cyclonedds]
ff_rviz_plugins_ros1: Cannot locate rosdep definition for [roscpp]
root@5901057b3d24:~/ff_ros2_ws# colcon build
Starting >>> free_fleet
Starting >>> rmf_fleet_msgs               
--- stderr: free_fleet                                                                     
CMake Error at CMakeLists.txt:15 (find_package):
  By not providing "FindCycloneDDS.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "CycloneDDS", but CMake did not find one.

  Could not find a package configuration file provided by "CycloneDDS" with
  any of the following names:

    CycloneDDSConfig.cmake
    cyclonedds-config.cmake

  Add the installation prefix of "CycloneDDS" to CMAKE_PREFIX_PATH or set
  "CycloneDDS_DIR" to a directory containing one of the above files.  If
  "CycloneDDS" provides a separate development package or SDK, be sure it has
  been installed.
---
Failed   <<< free_fleet [8.85s, exited with code 1]
Aborted  <<< rmf_fleet_msgs [16.7s]                

これで解決。

sudo apt install ros-foxy-rmw-cyclonedds-cpp

Troubleshooting_2

EOLのROSの依存関係をアップデートする場合のコマンド。

rosdep update --include-eol-distros

Troubleshooting_3

root@5901057b3d24:~/ff_ros2_ws# colcon build

Starting >>> free_fleet_client_ros2
--- stderr: free_fleet_client_ros2                                                                                    
CMake Error at CMakeLists.txt:34 (find_package):
  By not providing "Findnav2_util.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "nav2_util", but CMake did not find one.

  Could not find a package configuration file provided by "nav2_util" with
  any of the following names:

    nav2_utilConfig.cmake
    nav2_util-config.cmake

  Add the installation prefix of "nav2_util" to CMAKE_PREFIX_PATH or set
  "nav2_util_DIR" to a directory containing one of the above files.  If
  "nav2_util" provides a separate development package or SDK, be sure it has
  been installed.

---
Failed   <<< free_fleet_client_ros2 [23.0s, exited with code 1]
Aborted  <<< rmf_door_msgs [2min 25s]                                         

これで解決。

 sudo apt install ros-foxy-navigation2

Troubleshooting_4

サーバ機能のみ使いたいので、不要なものは削除。

root@5901057b3d24:~/ff_ros2_ws/src# rm -rf ./free_fleet/free_fleet_client_ros1
root@5901057b3d24:~/ff_ros2_ws/src# rm -rf ./free_fleet/free_fleet_client_ros2

Ref

github.com

qiita.com

Docker環境上でROS2 Humble+TB3のGazeboシミュレーションする

まだ検証中なので、参考サイトやメモを残すだけ。 あとで内容をまとめるつもり。

Troubleshooting_1

mkdir -p ~/turtlebot3_ws/src
cd ~/turtlebot3_ws/src/
git clone -b humble-devel https://github.com/ROBOTIS-GIT/DynamixelSDK.git
git clone -b humble-devel https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
git clone -b humble-jp-devel https://github.com/ROBOTIS-JAPAN-GIT/turtlebot3_jp_custom.git
cd ~/turtlebot3_ws
colcon build --symlink-install

ここでエラー発生。

root@1d491d21ae70:~/turtlebot3_ws# colcon build --symlink-install
Starting >>> dynamixel_sdk
Starting >>> turtlebot3_msgs
--- stderr: dynamixel_sdk                                                                     
CMake Error at CMakeLists.txt:18 (find_package):
  By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "ament_cmake", but CMake did not find one.

  Could not find a package configuration file provided by "ament_cmake" with
  any of the following names:

    ament_cmakeConfig.cmake
    ament_cmake-config.cmake

  Add the installation prefix of "ament_cmake" to CMAKE_PREFIX_PATH or set
  "ament_cmake_DIR" to a directory containing one of the above files.  If
  "ament_cmake" provides a separate development package or SDK, be sure it
  has been installed.


---
Failed   <<< dynamixel_sdk [0.33s, exited with code 1]
Aborted  <<< turtlebot3_msgs [0.27s]

Summary: 0 packages finished [1.04s]
  1 package failed: dynamixel_sdk
  1 package aborted: turtlebot3_msgs
  2 packages had stderr output: dynamixel_sdk turtlebot3_msgs
  10 packages not processed

以下を参考にして、ひとまず解決。 https://github.com/ros2/ros2/issues/710

source /opt/ros/humble/setup.bash 

Troubleshooting_2

Finished <<< turtlebot3_navigation2 [1.41s]                                                                          
Starting >>> turtlebot3_teleop
--- stderr: turtlebot3_teleop                                                                             
/usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.16.0-unknown is an invalid version and will not be supported in a future release
  warnings.warn(
/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
  warnings.warn(
---
Finished <<< turtlebot3_teleop [10.6s]
Starting >>> turtlebot3_example                                   
--- stderr: turtlebot3_example                                                                             
/usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.16.0-unknown is an invalid version and will not be supported in a future release
  warnings.warn(
/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
  warnings.warn(
---
Finished <<< turtlebot3_example [13.3s]

これで解決。 https://zenn.dev/tasada038/articles/f2f5b500cdc36a

pip install setuptools==58.2.0

Troubleshooting_3

cd ~/turtlebot3_ws/src/
git clone -b humble-jp-devel https://github.com/ROBOTIS-JAPAN-GIT/turtlebot3_simulations_jp_custom
git clone https://github.com/robotics-upo/lightsfm
cd lightsfm
make
sudo make install
cd ~/turtlebot3_ws
colcon build --symlink-install

これをやったらこうなった。

[Processing: turtlebot3_gazebo]                                         
[Processing: turtlebot3_gazebo]                                         
--- stderr: turtlebot3_gazebo                                            
CMake Warning (dev) at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (gazebo).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
  /usr/lib/x86_64-linux-gnu/cmake/gazebo/gazebo-config.cmake:72 (include)
  CMakeLists.txt:23 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

/root/turtlebot3_ws/src/turtlebot3_simulations_jp_custom/turtlebot3_gazebo/src/infinite_corridor_sfm_plugin.cpp: In member function ‘virtual void gazebo::InfiniteCorridorSFMPlugin::Reset()’:
/root/turtlebot3_ws/src/turtlebot3_simulations_jp_custom/turtlebot3_gazebo/src/infinite_corridor_sfm_plugin.cpp:283:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<ignition::math::v6::Vector3<double> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
  283 |     for (int i = 0; i < goals.size(); i++) {
      |                     ~~^~~~~~~~~~~~~~
---
Finished <<< turtlebot3_gazebo [7min 21s]
Starting >>> turtlebot3_simulations
Finished <<< turtlebot3_simulations [5.17s]                          
                             
Summary: 19 packages finished [7min 50s]
  1 package had stderr output: turtlebot3_gazebo
root@1d491d21ae70:~/turtlebot3_ws# 

こちらを参考に修正。 https://memoteki.net/archives/7187

vi /root/turtlebot3_ws/src/turtlebot3_simulations_jp_custom/turtlebot3_gazebo/CMakeLists.txt 

-find_package(gazebo REQUIRED)
+find_package(gazebo_ros REQUIRED)

Troubleshooting_4

今回利用させていただいたDockerイメージでは、VNCからターミナルを開くとRootでログインできない。 また、ROSのワークスペースが /root配下にあるため、source ~/turtlebot3_ws/install/setup.bash を実行できない。 VSCodeでこのDockerにShellをアタッチするとRootでログインできるので、ここでRootパスワードを変更した。

sudo passwd root

Troubleshooting_5

ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py

これをやったら、こうなった。

root@1d491d21ae70:~# ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py
[INFO] [launch]: All log files can be found below /root/.ros/log/2023-08-02-00-58-41-294663-1d491d21ae70-4888
[INFO] [launch]: Default logging verbosity is set to INFO
urdf_file_name : turtlebot3_big_wheel.urdf.xacro
urdf_file_name : turtlebot3_big_wheel.urdf.xacro
[ERROR] [launch]: Caught exception in launch (see debug for traceback): 
executed command failed. Command: xacro /root/turtlebot3_ws/install/turtlebot3_description/share/turtlebot3_description/urdf/turtlebot3_big_wheel.urdf.xacro
Captured stderr output: error: environment variable 'LDS_MODEL' is not set 
when evaluating expression 'lds_model=='LDS-01''
when processing file: /root/turtlebot3_ws/install/turtlebot3_description/share/turtlebot3_description/urdf/turtlebot3_big_wheel.gazebo.xacro
included from: /root/turtlebot3_ws/install/turtlebot3_description/share/turtlebot3_description/urdf/turtlebot3_big_wheel.urdf.xacro

こちらを参考に解決。

https://blog.csdn.net/weixin_45365549/article/details/127225258

export LDS_MODEL=LDS-01

Troubleshooting_6

ubuntu@1d491d21ae70:/$ gazebo
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': No such file or directory

これで解決。 https://waregawa-log.hatenablog.com/entry/2020/10/10/234148

root@1d491d21ae70:/# vi /usr/share/alsa/alsa.conf

pcm.!default {
    type plug
    slave.pcm "null"
}

Troubleshooting_7

root@1d491d21ae70:~# ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py
[ERROR] [gzclient-2]: process has died [pid 18100, exit code -6, cmd 'gzclient'].

権限の問題っぽいので、

chmod 777 /root 

をしたうえで、Rootを抜けて一般ユーザでturtlebot3_wsに移動して、

export TURTLEBOT3_MODEL=burger
source /root/turtlebot3_ws/install/setup.bash

をやってからリトライしたら正常にGazeboが起動した。 同様の手順をほかのTerminalでも実行したところ、正常にTeleopできた。

Ref

memoteki.net

note.com

zenn.dev

qiita.com

answers.ros.org

docker上でGrafanaとZabbixを連携

ZabbixとGrafanaを連携させようとしてハマったポイント

  • コンテナ起動時に再起動を繰り返す
  • doccker logs [container id]
mkdir: can't create directory '/var/lib/grafana/plugins': Permission denied
  • 解決策: user: “$PID:$GID

  • docker-compose.yml

version: "3"
services:
  grafana-zabbix:
    image: grafana/grafana:latest
    container_name: grafana
    hostname: grafana
    ports:
      - 3000:3000
    volumes:
      - ./data/grafana:/var/lib/grafana
    user: "$PID:$GID"
    environment:
      - GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource,alexanderzobnin-zabbix-app
    restart: always
  • APIトークンを探す必要性 API連携ということで、トークン生成方法を探して試すも、root権限問題で挫折。 結果的に、APIトークンを発行するのではなく、普通に以下でOK。
http://[zabbixのIP]:8080/api_jsonrpc.php

なお、PWとIDは「Zabbix API details」のところに入力すればよく、特に「Auth」でBasicなどを選択して入力する必要はなかった。

Ref

qiita.com

kobe-systemdesign.work

wisdomtrees.net

qiita.com

qiita.com

github.com