ある任意の文字列を含むファイル/フォルダを削除
ls | grep -P '^(?!.*rviz).*$' | xargs rm -rf
ros2 基本 メモ
パッケージ作成
ros2 pkg create hoge_pkg --dependencies rclcpp --build-type ament_cmake --license Apache-2.0
ros2 pkg create inverted_pendulum_robot_imu_filter_ros2 --dependencies rclcpp --build-type ament_cmake --license Apache-2.0 --maintainer-name "Tatsuhiro Ikebe" --maintainer-email "beike315@icloud.com"
ros2 pkg create diff_bot_description --build-type ament_cmake --dependencies urdf xacro --license Apache-2.0 --description "The diff_bot_description package" --maintainer-name "Tatsuhiro Ikebe" --maintainer-email "beike315@icloud.com" --package-format 3
参考元
ubuntu起動時に自動で立ち上がるアプリの設定を変更
メモ ディレクトリ内にある全てのファイルに拡張子を付与する
ls | awk '{print $1 " " $1 ".msg"}' | xargs -L 1 mv
メモ ubuntu エイリアス
if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi if [ -f /etc/bash_completion.d/git-prompt ]; then export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w$(__git_ps1)\[\033[00m\](\t)\$ ' else export PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w \$ ' fi if [ "$0" = "bash" ]; then /usr/bin/wmctrl -r :ACTIVE: -b add,above; fi ## Docker xhost +local:docker ## Alias set by yourself alias sb='source ~/.bashrc' alias vs='vim ~/.bashrc' alias lo='gnome-screensaver-command -l' alias x="perl -pe 's/\n/ /' | xsel --clipboard --input" alias gs='git status' alias gp='$(git push |& grep "git push")'
WSLでRVizを使用する
概要
WSL(ubuntu 18.04)でRVizを使用する際にエラーが出たので 上手く行った方法を備ぼる。
結論
WSL2を使おう docs.microsoft.com
手順
①WSLを入れる
②ros melodic desktopを入れる
③X Window Systemのインストール
④RVizを立ち上げるために設定を行う
xming Serverを立ち上げる必要があるので XLaunchを起動します。
立ち上げるとこんな感じの画面がでてくる そのまま次へを選択
この画面では一番上を選択して次へを選択
この画面ではDisable access control
をチェックするのと
パラメータとして-nowgl
を追加する必要がある
終わったら次へを選択する
この画面ではそのまま完了を押せば良い
これでxming serverの立ち上げは完了
続いてmesa-utils
をインストールする
sudo apt install mesa-utils
続いて設定を~/.bashrcに書きます
export DISPLAY=localhost:0.0 #0.0は上の絵のポップアップで出てくる数字に合わせる export LIBGL_ALWAYS_INDIRECT= export GAZEBO_IP=127.0.0.1
追加し終えたらsource ~/.bashrc
を実行
④RVizを起動 これで上手くRVizを立ち上げることができると思います
ターミナルが一つのみの場合 roscore & rosrun rviz rviz
確認が終わったら
killall -9 rosmaster
でrosmasterのプロセスを落とす
複数ターミナルの場合 roscore rosrun rviz rviz
こちらはctl+cでroscore
を落とせば良い