CentOSにInfluxDBをインストール

Install InfluxDB OSS | InfluxDB OSS v1 Documentation
Troubleshoot systemd errors | InfluxDB OSS v1 Documentation

$ cat <<EOF | sudo tee /etc/yum.repos.d/influxdb.repo
[influxdb]
name = InfluxDB Repository - RHEL \$releasever
baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdata-archive_compat.key
EOF

$ sudo yum install influxdb
$  sudo service influxdb start
$ influxd -config /etc/influxdb/influxdb.conf
$ sudo chown -R influxdb:influxdb /var/lib/influxdb/*
$  influxd -config /etc/influxdb/influxdb.conf

~/.bashrc

export INFLUXDB_CONFIG_PATH="/etc/influxdb/influxdb.conf"

Installing Grafana/InfluxDB on CentOS ESXi VM, with Remote Telegraf Metric Collection | by Michael Rodgers | Medium


HTTPのポートを開ける

sudo firewall-cmd --permanent --add-port=8086/tcp
sudo firewall-cmd --reload

/etc/influxdb/influxdb.conf

[http]
  # Determines whether HTTP endpoint is enabled.
  enabled = true

  # Determines whether the Flux query endpoint is enabled.
  # flux-enabled = false

  # Determines whether the Flux query logging is enabled.
  # flux-log-enabled = false

  # The bind address used by the HTTP service.
  bind-address = ":8086"

  # Determines whether user authentication is enabled over HTTP/HTTPS.
  auth-enabled = false
sudo service influxdb restart

グラムシュミットの直交化

dora.bk.tsukuba.ac.jp
Matlabでの実装

clear; close all;

a1 = [1 1 0]';
a2 = [0 -1 1]';
a3 = [1 1 1]';

e1 = a1/norm(a1)
e2 = a2 - dot(a2,e1)*e1;
e2 = e2/norm(e2)
e3 = a3 - dot(a3,e1)*e1  - dot(a3,e2)*e2;
e3 = e3/norm(e3)
% dot(e1,e2)
% dot(e1,e3)
% dot(e2,e3)

es = gram_schmidt([a1 a2 a3]);
es

function es = gram_schmidt(vectors)
  a1 = vectors(:,1);
  dim = size(vectors);
  m = dim(1);
  n = dim(2);
  as = zeros(m,n);
  es = zeros(m,n);
  e1 = a1/norm(a1);  
  as(:,1) = a1;
  es(:,1) = e1;
  for idx=2:length(vectors)
      ai = vectors(:,idx);
      as(:,idx) = ai;
      ei = ai;
      for jdx = 1:idx
          ei = ei - dot(as(:,idx),es(:,jdx))*es(:,jdx);
      end
      ei = ei/norm(ei);
      es(:,idx) = ei;
  end

end

実行結果 

e1 =
    0.7071
    0.7071
         0
e2 =
    0.4082
   -0.4082
    0.8165
e3 =
   -0.5774
    0.5774
    0.5774
es =
    0.7071    0.4082   -0.5774
    0.7071   -0.4082    0.5774
         0    0.8165    0.5774

DiscordのBotのテスト

Message content intentを有効にしておく必要がある

import discord
import os

intents = discord.Intents.default()
intents.message_content = True

client = discord.Client(intents=intents)

@client.event
async def on_ready():
    print('We have logged in as {0.user}'.format(client))

@client.event
async def on_message(message):
    if message.author == client.user:
        return

    if message.content.startswith('$hello'):
        await message.channel.send('Hello!')

client.run(os.getenv('DISCORD_TOKEN'))

Discordで毎週誰がどれだけのメッセージを送信したかカウントしたい

調べた感じ、すぐに使えるBotはないみたいだった。
discord.pyでBotを作成し、メッセージをカウントするたびに誰がコメントしたかをデータベースに残していくのが一番簡単な実装みたい。

AutowareをDockerでインストールする

NVIDIA GPUつきのUbuntuにインストールする

rocker --nvidia --x11 --user --volume $HOME/autoware_map -- ghcr.io/autowarefoundation/autoware-universe:humble-latest-prebuilt

autowarefoundation.github.io

上記でエラーが出たので以下を実行する

could not select device driver "" with capabilities: [[gpu]]. - #5 by sk.ahmed401 - Docker and NVIDIA Docker - NVIDIA Developer Forums
“Permission Denied While Trying to Connect to the Docker Daemon Socket” Error | Baeldung on Linux

sudo chmod 666 /var/run/docker.sock

sudo apt install -y nvidia-docker2
sudo systemctl daemon-reload
sudo systemctl restart docker

Rocker Docker Errors with python:3-slim-stretch - unable to detect os for base image · autowarefoundation · Discussion #3470 · GitHub

rocker --nvidia --x11 --user --volume $HOME/autoware --volume $HOME/autoware_map -- ghcr.io/autowarefoundation/autoware-universe:latest-cuda

SLERP(球面線形補間:クォータニオンによる大円補間)による補間

swkagami.hatenablog.com

(23)式を使えば、クォータニオンq1からクォータニオンq2への補間位置が逐次的に求められる。

このテクニックは「実践ロボット制御」でも単位クォータニオンを用いた大円補間として紹介されていた。

clear; close all;

origin = [1,0,0]';
destination = [1,1,1]';
q1 = [0,origin(1),origin(2),origin(3)]';
q2 = [0,destination(1),destination(2),destination(3)]';

phi = acos(dot(q1,q2)/(norm(q1)*norm(q2)));

plot3([0,q1(2)],[0,q1(3)],[0,q1(4)]);
hold on;
plot3([0,q2(2)],[0,q2(3)],[0,q2(4)]);

xlim([-2,2]);
ylim([-2,2]);
zlim([-2,2]);

for t=linspace(0,1,10)
    if(t==0)||(t==1)
        continue
    end
    tmp = sin((1-t)*phi)/sin(phi)*q1+sin(t*phi)/sin(phi)*q2;
    px = tmp(2);
    py = tmp(3);
    pz = tmp(4);
    plot3([0,px],[0,py],[0,pz],'k--');
    big;
    drawnow;
    pause(0.3);
end