發表文章

目前顯示的是有「tools」標籤的文章

Renaming files in linux at once

Problem description: When you have hundreds of files in the folder, and you want to rename them with the same rule... For example, I have images named img0.jpg, img1.jpg, img2.jpg......, and I expect them named img00000.jpg, img00001.jpg, img00002.jpg.  Commands:  $ rename 's/\d+/sprintf("%05d", $&)/e' *.jpg Reference: https://askubuntu.com/questions/473236/renaming-hundreds-of-files-at-once-for-proper-sorting

Upload a project to github

1. Create a new repository 2. git clone "path of new repository" 3. cd "project name" 4. echo "# project name" >> README.md 5. git init 6. git add README.md 7. move all codes to the path under the project folder 8. git status (optional) 9. git add . 10. git commit -m "first commit" 11. git push / git push --set-upstream origin master *If you got the message: Could not resolve host: github.com key in: $ git config --global --unset http.proxy $ git config --global --unset https.proxy and then restart the linux system, the problem will be solved. Reference: [1]  GitHub 入門(二) — 使用終端機上傳檔案到GitHub [2]  https://markdown.tw/ [3]  GitHub不再支援密碼驗證解決方案,怎麼辦? [4]  使用 Git LFS 上傳大型檔案 [5]  Git Large File Storage - How to Work with Big Files

Kalibr: a tool for calibrating camera and IMU

1. Installation (1)  Using the CDE package (2) Building from source 2. Camera calibration (1) Prepare a calibration target. (2) Prepare a image bag file & target.yaml file Command: ./kalibr_calibrate_cameras --target april_intel.yaml --bag rgb_mono.bag --model pinhole-equi --topics /camera/rgb/image_mono Output: camchain-%BAGNAME%.yaml results-cam-%BAGNAME%.txt report-cam-%BAGNAME%.pdf 3. Find IMU parameters (1) From product datasheet (ex: BMI160 ) (2) From the Allan standard deviation (AD) 4. Camera IMU calibration Command: ./kalibr_calibrate_imu_camera --target april_intel.yaml --cam camchain-homenamikidrone2kalibr-cdergb_mono.yaml --imu imu_intel.yaml --bag rgb_mono_imu.bag 5. Convert calibration results to the accessible files in the maplab (1) Building from source *source ~/kalibr_workspace/devel/setup.bash (2) rosrun kalibr kalibr_maplab_config --to-ncamera --label <your_label> --cam <your_cam_chain_yaml> R...

Tips for using imu_utils for imu calibration

1. Install Ceres * Dependencies: $ sudo apt-get install liblapack-dev libsuitesparse-dev libcxsparse3.1. 4 libgflags-dev $ sudo apt-get install libgoogle-glog-dev libgtest-dev * Eigen version should be newer than 3.3.4. * Download the version  ceres-solver-1.14.0.tar.gz directly. 2. Build code_utils * Dependency: sudo apt-get install libdw-dev * Build the source code in the ROS_WORKSPACE * Modify file: catkin_ws/src/code_utils/src/ sumpixel_test.cpp #include "backward.hpp" ->  #include “code_utils/backward.hpp” 3. Build imu_utils * Build the source code in the ROS_WORKSPACE 4. Run the calibration * Create your own .launch file. (assign the topic name, time duration ...) *  roslaunch imu_utils XXX.launch first and then rosbag play -r 200 XXX.bag ***Don't forget to source setup.bash file ! Reference: [1]  https://github.com/gaowenliang/imu_utils [2]  https://zhuanlan.zhihu.com/p/151675712 [3]  https://blog.csdn.net...

[Solved] TypeError: Conversion is only valid for arrays with 1 or 2 dimensions. Argument has 3 dimensions......

In file "/var/kalibr-build/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_common/ ImageDatasetReader.py Modify: img_data = np.array(self.CVB.imgmsg_to_cv(data)) To: img_data = np.squeeze(np.array(self.CVB.imgmsg_to_cv2(data, "mono8"))) Reference: [1]  https://github.com/ethz-asl/kalibr/issues

Solutions for reported errors while building "BagFromImages"

1. $ROS_PACKAGE_PATH command not found Method: build the source code in a catkin workspace as follows. $ cd ~/catkin_ws $ cd src $ git clone https://github.com/raulmur/BagFromImages.git BagFromImages $ cd BagFromImages $ mkdir build $ cd build $ cmake .. $ make 2. undefined reference to symbol '_ZN14console_bridge3logEPKciNS_8LogLevelES1_z' /usr/lib/x86_64-linux-gnu/libconsole_bridge.so: error adding symbols: DSO missing from command line Method:  libconsole_bridge should be linked in CMakeLists.txt. ex: target_link_libraries (${PROJECT_NAME} console_bridge) Reference: [1]  https://github.com/raulmur/BagFromImages [2]  https://www.cnblogs.com/sparkzxw/p/6501730.html [3]  https://github.com/raulmur/BagFromImages/issues/5

Tips for building ICE-BA on Banana Pi M3

圖片
OpenCV installation 0. Build M3 Bsp code for installing cross-compile tool  $ git clone https://github.com/BPI-SINOVOIP/BPI-M3-bsp.git $ cd BPI-M3-bsp $ mkdir -p linux-sunxi/output/lib/firmware $ sudo ./build.sh Then choose building kernel only: mode 3  1. Use cmake-gui to configure and generate makefile. (1) CMAKE_BUILD_TYPE: Release (2) CMAKE_EXE_LINKER_FLAGS: -lpthread( or pthread) -lrt -ldl (Manually modify this part in CMakeCache.txt file) * Also remember to modify file : common.cc [1] (3) CMAKE_INSTALL_PREFIX: /usr/local (4) OPENCV_GENERATE_PKGCONFIG: True (5) OPENCV_EXTRA_MODULE_PATH: ~/opencv4.3.0/opencv_contrib-4.3.0/modules (6) BUILD_ZLIB: True (7) ZLIB_INCLUDE_DIR: ~/opencv4.3.0/3rdparty/zlib (8) CMAKE_C_FLAGS: -O3 -fPIC (9) CMAKE_CXX_FLAGS: -O3 -fPIC * Command line: sudo cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DOPENCV_GENERATE_PKGCONFIG=On -DOPENCV_EXTRA_MODULE_PATH=../opencv_contrib-3.4....

Convert rosbag topic to image

1. Setup $ sudo apt-get install ros-kinetic-image-view $ roscd image_view $ rosmake image_view $ sudo apt-get install mjpegtools 2. Create a roslaunch file (ex: export.launch) with following content and put your bag file in the path: /opt/ros/kinetic/share/image_view <launch>           <node pkg="rosbag" type="play" name="rosbag" required="true" args="$(find image_view)/ test.bag (your bag file name) "/>           <node name="extract" pkg="image_view" type="extract_images" respawn="false" required="true" output="screen" cwd="ROS_HOME"> <remap from="image" to=" /camera/image_raw (your topic name) "/>           </node> </launch> 3. Exporting images $ roslaunch export.launch 4. Copy exported images to the directory you want $ ~cd $ mkdir image_data $ mv ~/.ros/frame*.jpg image_data/

Analytical tool for VIO perfromance: evo

圖片
1. Install evo in the virtual environment [1] 2. Prepare the ground-truth data  Supported trajectory formats: 'TUM' trajectory files 'KITTI' pose files 'EuRoC MAV' (.csv groundtruth and TUM trajectory file) [2] ROS bagfile with: geometry_msgs/PoseStamped, geometry_msgs/TransformStamped, geometry_msgs/PoseWithCovarianceStamped or nav_msgs/Odometry topics 3. Plot ground-truth $ workon evaluation ( start evo ) $ evo_traj euroc data.csv --save_as_tum ( euroc => tum )  * There is no necessary to substract the original offset by yourself, just add "--align" in the command. $ evo_traj tum data.tum -p (tum format) $ deactivate ( stop evo ) 4. Generate trajectory data (ex: maplab) (1) Run VIO mode (2) load map in the maplab_console (3) Export .csv file ex: $ csv_export --csv_export_path '/home/shomin/maplab_ws/bagfiles/save_folder_0' (4) Open vertices.csv , delete first column and row, and save as a new file. (5) Trans...

RICOH THETA S camera - getting start with ROS

1. Install dependencies $sudo apt-get update $sudo apt-get install ros-<distro>-usb-cam 2. Turn on device with live streaming mode [1] 3. Create a ROS workspace with source files and build $ mkdir -p ~/RICOH/src $ cd ~/RICOH/ $ catkin_make $ cd src $ git clone https://github.com/ntrlmt/theta_s_uvc $ cd ../dev $ souece setup.bash   4. Check device port and run $ ls /dev/video* $ roslaunch theta_s_uvc theta_s_uvc_start.launch device:=/dev/video0 enable_image_view:=true 5. Display $ rosrun rqt_image_view rqt_image_view $ rosrun rviz rviz Reference: [1] https://support.theta360.com/ja/manual/s/content/streaming/streaming_01.html [2] http://zhaoxuhui.top/blog/2019/10/20/ros-note-8.html

Auto flight using a Qualcomm Snapdragon Flight platform (3) - WiFi mode switching

There are two WiFi mode available, they could be switched according to the following operations: 1. Access Point Mode Configuration(default): adb shell cd /data/misc/wifi/ vi wpa_supplicant.conf *SSID - QsoftAP *Password 1234567890 (psk) echo softap > wlan_mode Reboot 2. Station Mode Configuration: adb shell cd /data/misc/wifi/ vi wpa_supplicant.conf *Modify the wpa supplicant settings to match the WiFi network you wish to connect. echo station > wlan_mode Reboot *SSH over Wi-Fi: $ ssh root@<IP address of target> password: oelinux123

Auto flight using a Qualcomm Snapdragon Flight platform (2) - docker container

圖片
1. Install Docker on the host development machine [1], and then test the installation. (1) Check version docker version (2) Add user to docker group sudo groupadd docker sudo usermod -a -G docker {username} 2. Download Flight Pro Docker Image [2] 3. Import Flight Pro Docker Image docker load < excelsior-arm-sdk-sfpro_docker.tar docker images 4. Setup a Docker workspace cd $HOME  mkdir -p docker/flight_pro  cp ~/Downloads/run_docker.sh $HOME/docker/flight_pro  export SPRINT="null"  ./run_docker.sh atlflight/excelsior-arm-sdk-sfpro_docker   *This will launch you into a Docker bash shell running the same variant of Linux as the Flight Pro hardware as shown in the following picture. This script also creates a sdk_home directory in your docker workspace on your Host machine. Any changes you make within Docker $HOME will be mirrored to the sdk_home host workspace directory. 5. Build & test (1) download the SDKHelloWorld.zi...

[Solved] ssh connection failed

Problem: C:\Users\shomin>ssh namikidrone2@192.168.8.1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the ECDSA key sent by the remote host is SHA256:MvA6+SzNldrn/8WOyMlPHDjqOWhtlIMTAj2HX0kno9A. Please contact your system administrator. Add correct host key in C:\\Users\\shomin/.ssh/known_hosts to get rid of this message. Offending ECDSA key in C:\\Users\\shomin/.ssh/known_hosts:1 ECDSA host key for 192.168.8.1 has changed and you have requested strict checking. Host key verification failed. Solution: Edit file: known_hosts located at C:\\Users\\shomin/.ssh/ Add: Host *    StrictHostKeyC...

Matlab 2017b installation (linux)

圖片
1. Create a folder with all installation files (1) MATLABR2017b_Linux_Crack (2) install_key.txt (3) R2017b_glnxa64.iso ->  Download 2. mount R2017b_glnxa64.iso and install (refer to install_ket.txt) sudo mount -t auto -o loop R2017b_glnxa64.iso /temp cd temp sudo ./install 3. After installation, copy licences to specific directories... cd MATLABR2017b_Linux_Crack/ sudo cp  license_standalone.lic /usr/local/MATLAB/R2017b/licenses/  sudo cp  libmwservices.so /usr/local/MATLAB/R2017b/bin/glnxa64/ 4. Unmount sudo umount temp 5. Run cd /usr/local/MATLAB/R2017b/bin sudo ./matlab Reference: 1. ubuntu16.04安装MATLAB R2017b步骤详解(附完整破解文件包)

Using OpenCL in a nsight developing environment

圖片
1. Installation:  ubuntu14.04安装intel openCL ,  Ubuntu16.04 安装OpenCV&OpenCL ,  Generic ubuntu packages for OpenCL ,  Install Proprietary Nvidia GPU Drivers On Ubuntu 16.04 / 17.10 / 18.04 Check the installation result by keying in command: nvidia-settings  *Do not need to install the OpenCL library for CPU. *GPU driver choose the newest 410.66. *Type " sudo apt-get remove beignet*" while reporting "X server found. dri2 connection failed!" 2. Copy libOpenCL.so present in your cuda toolkit (lib64) to the above location. ex:  sudo cp /usr/local/cuda-9.0/lib64/libOpenCL.so /usr/lib 3. Setting the path of head file. (/usr/include/CL/...) Reference:  OpenCL: 从零开始学习OpenCL开发 ,  OpenCL 教學(一)

Install ROS on ubuntu 16.04

1. Setup your sources.list and set up your keys  sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'  sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116  2. Installation  sudo apt-get update  sudo apt-get install ros-kinetic-desktop-full  3. Initialize rosdep  sudo rosdep init  rosdep update  4. Environment setup  echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc  source ~/.bashrc  5. Dependencies  sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential -------------------------------------------------------------------------------------------------------------------------- If errors occur like following status: http://archive.ubuntu.com/ubuntu/dists/trusty-security/main...

Keypoints while Installing ubuntu16.04 on msi

1. Turned off Fast Boot in UEFI (Press Delete button) 2. Replace "quiet splash" with nomodeset 3. Install nvidia driver sudo add-apt-repositorty ppa:graphics-drivers/ppa sudo app-get update sudo app-get install nvidia-387 Reference: (1)  https://askubuntu.com/questions/949496/installing-ubuntu-16-04-on-msi-ge72mvr-system-freezes-when-i-restart (2)  https://ubuntuforums.org/showthread.php?t=2389372 (3)  https://www.tecmint.com/install-nvidia-drivers-on-ubuntu/

3ds Max

Resource:  http://www.cg.com.tw/3dsMax/ 快捷鍵:Alt + W 將視圖最大化, Alt +滑鼠中鍵移動可旋轉視圖 1. Attach Reference:  combine objects in 3D Studio Max 2. ProBoolean Reference:  如何在Poly模型上產生方洞和圓洞 3. 建立補面 Reference:  polygon的三種補面的方式 4. modifier Reference:  https://www.youtube.com/results?search_query=3ds+max+modifier 5. Align Reference:  Align(對齊工具) 講解 6. Slice plane Reference:  Slice Plane Tutorial 7. Extrude 可用2D平面圖來長出3D立體物件 8. 改變物件坐標軸位置 Reference:  How to reset Pivot Point to center of object in 3DS Max

3D printer 操作步驟 (Lab)

1. 用3ds Max 畫要印的物件,輸出為.STL檔。 2. 於3D printer旁的電腦開啟待印檔案。(UP!) 3. 3D printer Power ON,並連接電腦(USB Port)。 4. 初始化校正。 5. 更換顏色。(取出&插入,測試到顏色正常輸出為止: プリンター設定) 6. 移動物件列印位置。(盡量不要在螺絲孔上) 7. 預覽列印。(可更改輸出設定,如密度) 8. 開始列印。(可忽略跳出警告視窗) 9. 一旦開始列印後即可拔出連接線。

ROS installation errors and solutions

圖片
Q1. The following packages have unmet dependencies: ros-kinetic-desktop-full : Depends: ros-kinetic-desktop but it is not going to be installed Depends: ros-kinetic-perception but it is not going to be installed Depends: ros-kinetic-simulators but it is not going to be installed Depends: ros-kinetic-urdf-tutorial but it is not going to be installed E: Unable to correct problems, you have held broken packages. Solution: Reset system setting (Software Updater) sudo rm /etc/apt/sources.list sudo software-properties-gtk Pick your options (Choose all options of Download from the internet, Download from Main server , Other software: delete "duplicates" as following picture) Close and reload (upgrade) Reference:  https://askubuntu.com/questions/760896/how-can-i-fix-apt-error-w-target-packages-is-configured-multiple-times ,  https://blog.csdn.net/xiangxianghehe/article/details/78483799 Q2. binary-arm64/Packages 404 Not Found Solution: apt-get remove .*:arm64...