ubuntu学习记录


==============================节点=======================================
https://subscribe.pronetworklink.com/api/v1/client/e5cea80c08c2367003269501e9cbea19

=================================orbslam===================================

运行摄像头,发布话题

roslaunch usb_cam usb_cam-test.launch

新终端:开启ORBSLAM2

rosrun ORB_SLAM2 Mono ./Vocabulary/ORBvoc.txt ./Examples/ROS/ORB_SLAM2/Asus.yaml

pcl_viewer的使用:pcl_viewer a.pcd

===========================vscode使用===============================

vscode查看函数列表Ctrl + Shift + O

markdown ctrl-shift-v Open preview(打开新窗口预览该文件)

ctrl+c+c

pkg-config –modversion opencv

g++ -std=c++11 test.cpp pkg-config --libs --cflags opencv -o result

sudo gedit ~/.bashrc

source ~/.bashrc

echo $ROS_PACKAGE_PATH

问题:liunx系统打开vscode之后代码和终端字体有的单词间距很奇怪,修改字体大小和间距后无效,修改了字体完成。

操作:打开设置,输入Editor:Font Family,

修改终端字体:在Terminal › Integrated: Font Family下输入monospace,

修改编辑器字体:在Editor:Font Family输入monospac

==============================服务器======================================================

ssh -p 1938 chenhaiyang@10.69.47.82

nvidia-smi

gpustat -i 1

-i http://pypi.douban.com/simple/ –trusted-host pypi.douban.com

vim ~/.bashrc

source ~/.bashrc

================================cuda=====================================

export PATH=”$PATH:/usr/local/cuda/bin”
export LD_LIBRARY_PATH=”$LD_LIBRARY_PATH:/usr/local/cuda/lib64/“
export LIBRARY_PATH=”$LIBRARY_PATH:/usr/local/cuda/lib64”
export CUDA_HOME=$CUDA_HOME:”/usr/local/cuda”

chmod 777 file

========================docker=====================================

查看容器运行现状:docker ps。
停止容器:docker stop 容器id,
查看容器标准输出:docker logs
获取镜像:docker pull 命令来载入 ubuntu 镜像
启动容器:docker run -it ubuntu /bin/bash
查看容器:docker ps -a
退出容器:exit或着CTRL+D
启动已停止的容器:docker start 容器id
后台运行:-d指定容器运行模式,如:docker run -itd ubuntu-test ubuntu /bin/bash
注:-d参数默认不会进入容器
进入容器:docker attach容器id(从容器最初会导致容器停止)以及docker exec容器id(推荐使用,从容器退出不会导致容器停止)
导出容器:docker export 如:docker export 容器id > ubuntu.tar
导入容器:docker import 如:cat docker/ubuntu.tar | docker import - test/ubuntu:v1
将快照文件 ubuntu.tar 导入到镜像 test/ubuntu:v1:
删除容器:docker rm -f 容器id
删除所有终止状态的容器:docker container prune

sudo docker ps -a

sudo docker container ls -a

docker stop 容器id

sudo docker start 容器id # 启动容器

sudo docker attach 容器id 进入容器正在执行的终端

sudo docker stats

sudo docker images

=============================conda源==============================================

channels:

channels:

============================opencv安装==========================================================

cmake -D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=/usr/local/opencv_2.4.11
-D WITH_CUDA=OFF
-D WITH_OPENGL=OFF
-D WITH_OPENCL=OFF
-D BUILD_JPEG=OFF
-D BUILD_PNG=OFF
-D BUILD_JASPER=OFF
-DBUILD_OPENEXR=OFF
-D BUILD_TIFF=OFF
-D BUILD_ZLIB=OFF
-D WITH_FFMPEG=OFF
..

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local/opencv2411 -D CUDA_GENERATION=Kepler -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=OFF -D WITH_OPENGL=ON -D BUILD_TIFF=ON ../local/opencv2411 ..

sudo cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.4.3/modules -D INSTALL_PYTHON_EXAMPLES=ON \ -D INSTALL_C_EXAMPLES=ON -D OPENCV_ENABLE_NONFREE:BOOL=ON -D BUILD_opencv_world:BOOL=ON -D BUILD_EXAMPLES=ON ..

—————————-ROS—————————————

rostopic list

rostopic type /tianbot_mini/odom 输出:类型

rosmsg show 类型 输出:类型包含的结构

rosrun turtlesim turtlesim_node 运行节点

rosrun turtlesim turtle_teleop_key 键盘控制运动

查看当前所有的topic:rostopic list
查看某个topic的输出:rostopic echo [topic_name]
查看某个topic的发布频率:rostopic hz [topic_name]
查看某个topic的数据格式:rostopic echo [topic_name]/encoding

==================slam-yolov5=================================

./Examples/RGB-D/rgbd_tum Vocabulary/ORBvoc.txt Examples/RGB-D/TUM3.yaml /home/chy/dataset/rgbd_dataset_freiburg3_walking_halfsphere /home/chy/dataset/rgbd_dataset_freiburg3_walking_halfsphere/associations.txt

=================segment-anything================================

python scripts/amg.py –input /home/chy/code_chy/segment-anything/99.jpg –output /home/chy/code_chy/segment-anything/outs –model-type vit_b –checkpoint /home/chy/code_chy/segment-anything/sam_vit_b_01ec64.pth

========================解压====================================
tgz格式解压到当前文件夹:
tar -zxvf xxx.tar.gz
zip格式解压到当前文件夹:
unzip xxx.zip
tar.xz格式解压
首先:xz -d xxx.tar.xz 解压得到tar文件 ;
其次:tar -xvf xxx.tar得到完整解压文件。

=========================git=======================================

在git的repo中,可能会有子项目的代码,也就是”git中的git”

–recursive是递归的意思,不仅会git clone当前项目中的代码,也会clone项目中子项目的代码。

未完待续


文章作者: oceanechy
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 oceanechy !
  目录