for Robot Artificial Inteligence

DLT, PnP, EPnP차이

|

DLT : Sequence Scene에 선형적으로 Feature이 뽑히는 상황이라면 DLT를 사용을 하여서 R T를 구할 수 있따.
PnP : 비선형적인 Sequence Scene(비선형 Feature)에서 3D-2D 방식으로 N포인트(3d points corresponding 2d features, 최소 3개)들을 가지고 Fundamental Matrix와 Essential Matrix를 구하여서 Frame간 R T를 구한다.(O[n^3])

EPnP는 PnP의 Time Complexity에 대해서 Opitmized된 PnP방법이다.[O(n) Solution]

https://zhuanlan.zhihu.com/p/110001027

https://blog.csdn.net/KYJL888/article/details/81187880

Comment  Read more

CI/CD Docker

|

Git CI/CD is baed on Docker image.

  1. Firstly, Create Docker Image(OS, Library, Dependency, etc..)

  2. with that Docker Image, start to CI/CD Process

  3. create gitcicd.yaml and write run-process in shell script

(example)


# You can override the included template(s) by including variable overrides
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#priority-of-environment-variables
stages:
- build
- release

default:
  interruptible: true
  timeout: 10m
".ros_build_and_package_template":
  except:
    refs:
      - tags
  before_script:
    - VERSION=$(cat VERSION)
    - source /ros_entrypoint.sh
    - mkdir -p rosws/src
    - ln -s "$(pwd)" rosws/src/ros_package
    - cd rosws
    - '[ ! -f "devel/.rosinstall" ] && rosws init devel /opt/ros/$ROS_DISTRO'
    - cd -
    - curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
    - apt update && DEBIAN_FRONTEND=noninteractive apt install -y libbsd-dev
    - apt update
    - apt install -y git
    - git clone https://github.com/IntelRealSense/librealsense.git
    - cd librealsense
    - mkdir build && cd build
    - cmake ../ -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=true -DBUILD_WITH_TM2=true
    - make -j4 && make install
    # - apt-get install git git-doc gitweb git-gui gitk git-email git-svn
    # - apt-get -y install git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev
    # - apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
    # - apt-get install software-properties-common -y
    # - apt-get update
    # - add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u
    # - apt-get install librealsense2-dkms -y
    # - apt-get install librealsense2-utils -y
    - apt-get install ros-$ROS_DISTRO-ddynamic-reconfigure -y
    # - apt-get --yes update && apt --yes upgrade
    # - modinfo uvcvideo | grep "version:"
    - cd ../..
  script:
    - cd rosws
    - '[ -d "./install" ] && rm -rf ./install'
    - catkin_make clean
    - catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release
    - catkin_make install
    - cd -
    - mkdir -p output
    - cd rosws/install
    - tar cvfz "../../output/$CI_PROJECT_NAME-$ROS_DISTRO.tar.gz" --exclude=local_setup.sh
      --exclude=local_setup.bash --exclude=local_setup.zsh --exclude=setup.sh --exclude=setup.bash
      --exclude=setup.zsh --exclude=env.sh --exclude=_setup_util.py --exclude=lib/pkgconfig
      --exclude=*/cmake *
    - cd -
    # - cd rootfs/
    # - tar cvfz ../output/$CI_PROJECT_NAME-rootfs.tar.gz *
    # - cd -
    - cd output/
    - tar cvfz "../$CI_PROJECT_NAME-$ROS_DISTRO-$VERSION.tar.gz" *
    - cd -

build_noetic:
  tags:
    - ros-noetic
  stage: build
  extends: ".ros_build_and_package_template"
  artifacts:
    paths:
      - "$CI_PROJECT_NAME-*.tar.gz"

release:
  stage: release
  tags:
    - smbclient
  needs:
    - job: build_noetic
      artifacts: true

  rules:
     # rules의 내용은 Array로 기입되어야 하며, 각각의 조건 중 하나라도 충족시 규칙이 True가 되어 작업(job)이 실행 됨
    # 아래의 조건은 특정 branch("release")에 VERSION 파일이 변경되었을 경우 또는 DO_RELEASE 변수 입력시에 만 'release' job 진행 함
    - if: '$CI_COMMIT_BRANCH == "master"'
      changes:
        - VERSION
      when: always
    - if: $DO_RELEASE
      when: always
    - when: never

  script:
    - VERSION=$(cat VERSION)
    - newline=$'\n'
    - RELEASE_NOTE="# ${VERSION}${newline}### Downloads${newline}"
    - |
      for file in $(ls $CI_PROJECT_NAME-*.tar.gz); do
        #if [ "$LOCATION" == "seoul" ]; then
        #  echo "$LOCATION"
          smbclient -U"pkgfile%ros" //xx.xx.xx.xxx/public/ -c "cd project/seoul/Packages; mkdir ${CI_PROJECT_NAME}; cd ${CI_PROJECT_NAME}; mkdir ${VERSION}; cd ${VERSION}; put ${file}"
          file_url=http://xx.xx.xx.xxx/project/seoul/Packages/${CI_PROJECT_NAME}/${VERSION}/${file}
          [ -n $file_url ] &&  RELEASE_NOTE="${RELEASE_NOTE}- [${file}](${file_url})${newline}"
        #elif [ "$LOCATION" == "busan" ]; then
        #  echo "$LOCATION"
          smbclient -U"pkgfile%rit" //xx.xx.xx.xxx/public/ -c "cd project/busan/Packages; mkdir ${CI_PROJECT_NAME}; cd ${CI_PROJECT_NAME}; mkdir ${VERSION}; cd ${VERSION}; put ${file}"
          file_url=http://xx.xx.xx.xxx/project/seoul/Packages/${CI_PROJECT_NAME}/${VERSION}/${file}
          [ -n $file_url ] &&  RELEASE_NOTE="${RELEASE_NOTE}- [${file}](${file_url})${newline}"
        #elif [ "$LOCATION" == "sokcho" ]; then
        #  echo "$LOCATION"
          smbclient -U"pkgfile%rit" //xx.xx.xx.xxx/public/ -c "cd project/sokcho/Packages; mkdir ${CI_PROJECT_NAME}; cd ${CI_PROJECT_NAME}; mkdir ${VERSION}; cd ${VERSION}; put ${file}"
          file_url=http://xx.xx.xx.xxx/project/sokcho/Packages/${CI_PROJECT_NAME}/${VERSION}/${file}
        [ -n $file_url ] &&  RELEASE_NOTE="${RELEASE_NOTE}- [${file}](${file_url})${newline}"
      done
    - >
      TAG_EXIST=$(curl -s --header "PRIVATE-TOKEN:${GITLAB_ACCESS_TOKEN}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/repository/tags/v${VERSION}" | jq 'has("name")')
    - >
      if [ "$TAG_EXIST" == "true" ]; then
        curl --request DELETE --header "PRIVATE-TOKEN:${GITLAB_ACCESS_TOKEN}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/protected_tags/v*"
        curl -s --request DELETE --header "PRIVATE-TOKEN:${GITLAB_ACCESS_TOKEN}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/repository/tags/v${VERSION}"
        curl --request POST --header "PRIVATE-TOKEN:${GITLAB_ACCESS_TOKEN}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/protected_tags?name=v*&create_access_level=40"
      fi
    - 'curl -s --request POST --header "PRIVATE-TOKEN:${GITLAB_ACCESS_TOKEN}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/repository/tags?tag_name=v${VERSION}&ref=${CI_COMMIT_BRANCH}"'
    - >
      RN_EXIST=$(curl -s --header "PRIVATE-TOKEN:${GITLAB_ACCESS_TOKEN}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/repository/tags/v${VERSION}" | jq -r '.["release"] | has("tag_name")')
    - '[ "$RN_EXIST" == "true" ] && curl -s --request DELETE --header "PRIVATE-TOKEN:${GITLAB_ACCESS_TOKEN}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases/v${VERSION}"'
    - 'curl -s --request POST --header "PRIVATE-TOKEN:${GITLAB_ACCESS_TOKEN}" --data "description=${RELEASE_NOTE}" ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/repository/tags/v${VERSION}/release'

manage opensource as private in CI/CD

  1. need to know where package locate in desire computer that we want to cover our private managing package’s “.so” and “include(header)” file over already existed files in computer.
  2. make a folder refer to the path that we want to cover up.
  3. use tar xf -C to your “.so” “ include(header file) pasted to the path.
  4. with that, we can update our own without using apt update(get flexiibility to our project)

Comment  Read more

How To Alias in Linux

|

Comment  Read more

Useful study reference for slam

|

https://imkaywu.github.io/tutorials/sfm/

https://www.wenyanet.com/opensource/ko/61ff868630779f452b6ca874.html

https://limhyungtae.github.io/2022-04-01-IMU-Preintegration-(Easy)-1.-Introduction/

https://taeyoung96.github.io/research/VINS_mono/

https://alida.tistory.com/category/Mathematics

http://jinyongjeong.github.io/2017/02/26/lec13_Least_square_SLAM/

Comment  Read more

why square root and hessian matrix and error state kalman filter

|

선형 : 닫혀있는 공간, 스판, subspace 해가 있는 시스템

lie group <-> lie algebra : Manifold space <-> vector space easy calculation, created jacobian matrix constrained conditon <-> unconstrained condition 최적화에서 많이 쓰임

역행렬이 존재하지 않는다면, singularity’s 해가 존재하지 않는다(블랙홀), 무수한 해를 가질 수 있다.

직교벡터와 정규직교벡터의 집합은 항상 선형독립이다.

벡터->평면 투영, span(u) 유닛 벡터를 알면 할 수 있다.

자명해(Any solution in which at least one variable has a nonzero value is called a nontrivial solution.)

why call square root https://www.quora.com/Why-do-we-call-square-root-a-square-root

SVD Explain Easly

https://stackoverflow.com/questions/62285218/how-to-find-the-rotation-matrix-from-svd

정방행렬 A 가 Postivie Definite인 경우 A 의 고유값은 항상 모두 양수이다.

일반적으로 기계학습에서는 대칭이고 Positive Definite인 행렬을 다룬다. 예를 들면, 인 행렬이 있고 각 열은 사람을 의미하고 각 행은 Feature를 의미한다고 가정했을 때, 는 각 사람들 간 유사도 를 의미하고 는 각 Feature들의 상관관계를 의미한다. 이 때, 는 주성분분석(Principal Component Analysis)에서 Covariance Matrix를 구할 때 사용된다.

Matrix분해를 해서 선형시스템을 푸는 문제에 분해를(QA, LL)를 사용하는 이유는, 계산을 빠르게 할 수 있고, 고유값을 이용해서 계산하기 때문에 안정적이다. 또한 singularity문제를 해결을 할 수 있다.

Hessian

https://en.wikipedia.org/wiki/Hessian_matrix

이후 중력 벡터가 추정되고 중력에 수평한 평면이 예측되면 모든 상태와 궤적(trajectory)를 중력에 맞게 방향을 재조절할 수 있다 (Lupton and Sukkarieh, 2009). 그리고 일반적으로 사용하는 g = (0,0,-9.81 xx) 와 같이 설정하고 xx 는 독자의 실험의 정확도에 맞게 설정할 수 있다.

Differential equations deal with continuous system, while the difference equations are meant for discrete process. Generally, a difference equation is obtained in an attempt to solve an ordinary differential equation by finite difference method.

error state kalman filter

에러를 dx를 만드는 작업과

https://www.reddit.com/r/ControlTheory/comments/lkan24/errorstate_kalman_filter_vs_extended_kalman_filter/

https://notanymike.github.io/Error-State-Extended-Kalman-Filter/

https://alida.tistory.com/63?category=1061564

error state kalman filter example code https://matthewhampsey.github.io/blog/2020/07/18/mekf

https://taeyoung96.github.io/research/IESKF/

https://www.researchgate.net/publication/269254094_Extended_Kalman_Filter_vs_Error_State_Kalman_Filter_for_Aircraft_Attitude_Estimation

https://blog.csdn.net/weixin_39061796/article/details/120027784

Comment  Read more