0%

1. QT

signal

  • when signal emit, it would run instantly.

Current Problem

  • image-20211215223503831
  • Line mode could be activated multiple times
  • Point mode only 1 times
  • Rect mode can’t be activated after Line mode

2. How it Works?

  1. Make the Line work as Rect
  2. add custom text for label
Read more »

1. What

  • Header only library
  • Expose C++ function, classes and objects as Python module

2. How to Use

  1. Include the pybind11
  2. define python modules using macros
  3. export to python module

3. Example

my_class.h

1
2
3
4
5
6
7
8
9
10
11
12
13
#pragma once

#include <string>

class MyClass {
public:
MyClass(const std::string& name);
void setName(const std::string& name);
std::string getName() const;

private:
std::string name_;
};

my_class.cpp

1
2
3
4
5
6
7
8
9
10
11
#include "my_class.h"

MyClass::MyClass(const std::string& name) : name_(name) {}

void MyClass::setName(const std::string& name) {
name_ = name;
}

std::string MyClass::getName() const {
return name_;
}

My_module.cpp

Read more »

1. Goal

Understand the difference between dynamic and static libraries in software

  • Static: link at compile time, make the final program larger
  • Dynamic: link at runtime, require the system to have the lib

When to use?

  • Static: lib is small, not change, need to be optimized
  • Dynamic: lib is large, frequently update

2. Compile Process

  • Preprocessing, remove comments, expand macro
  • Compilation, translate into assembly
  • Assembly, translatie into machine code
  • Linking, combine it with other libraries and modules

3. Linking?

  • Static linking is usually used for local
  • Dynamic linking is usually used for external libraries

How it works?

Read more »

1. 问题

  • 为什么头发没有在进化过程中减少
  • 为什么头发会一直生长而其他毛发不会

2. 头发?

头发比较重要

  • 保护,吸收紫外线
  • 维持体温,大脑比较重要,且散热较多
  • 社交信号

3. 生长?

生物结构不一样

  • 头皮的毛囊更大,生长周期较长
  • 其他部位毛发生长数月,就会停止生长
Read more »

1. 背景

硬件:

  • 雷神雷达C16
  • 16线
  • 每线2000点
  • 北斗星通MS-6111 六轴IMU
  • xyz加速度
  • 角速度

软件

  • 校准:lidar_imu_calib
  • 开启雷达和IMU的ros节点
  • rosbag记录,同时移动雷达和IMU
  • 计算IMU和雷达之间的位姿转换矩阵(只计算旋转)
  • SLAM:liorf
  • LIO-SAM的变种,可以接收六轴传感器

2. 问题

SLAM能够正常启动和运行,但是里程计会漂移,有很大的误差

image-20230329185739433

观察到的现象

  • 在平地时,IMU数据的x,y均有值。0.1m/s^2左右
  • 里程计显示速度越来越快
Read more »

1. What

Broyden-Fletcher-Goldfarb-Shanno

  • Quasi-Newton optimization algorithm
  • Gradient based: use first derivative of th objective function to improve the solution
  • differnce of different algorithm: how to update the parameters
  • first derivative
  • hessian matrix – BFGS
  • Maintain an approximation of the Hessian

2. How

Find the minimum, the gradient is known or calculated
$$
B_{k+1} = B_k + \frac{(\Delta \theta_k)(\Delta \theta_k)^T}{(\Delta \theta_k)^T \Delta g_k} - \frac{B_k \Delta g_k (\Delta g_k)^T B_k}{(\Delta g_k)^T B_k \Delta g_k}
$$

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import numpy as np

def bfgs(f, grad_f, x0, epsilon=1e-6, max_iter=1000):
n = len(x0)
Bk = np.eye(n) # initialize Hessian approximation
xk = x0
gk = grad_f(xk)
for k in range(max_iter):
if np.linalg.norm(gk) < epsilon:
break
pk = -np.dot(Bk, gk)
alpha = backtracking_line_search(f, grad_f, xk, pk)
xk_next = xk + alpha*pk
sk = xk_next - xk
yk = grad_f(xk_next) - gk # update the second order derivative
Bk_next = Bk + np.outer(yk, yk)/np.dot(yk, sk) - np.outer(np.dot(Bk, sk), np.dot(Bk, sk))/np.dot(sk, np.dot(Bk, sk))
xk, gk, Bk = xk_next, grad_f(xk_next), Bk_next
return xk

3. Ref

Wiki

ChatGPT

Read more »

1. Goal

In the paper, author compared some common open-source project address the kinematics problem. I want to know

  • Which optimization method is used behind these popular project
  • How these project compared to each other

2. Introduciton

The main purpose if trac_ik is to improve the popular KDL

Issue with KDL

  • convergence failure

  • stuck in local minima

  • loop for maximum time rather than iteration

  • Detect by $q_{next}-q_{prev}\approx 0$

  • Change to a random seed

  • Failure with joint limit

  • solved with SQP sequential quadratic programming

  • no utilization of tolerance

3. Candidate IK Algorithm

  • KDL-RR

  • Random Restart

  • maximum time

  • SQP: SLSQP with BFGS
    $$
    \arg \min {q \in \mathbf{R}^n}\left(q{\text {seed }}-q\right)^T\left(q_{\text {seed }}-q\right),
    $$

  • SQP-DQ: dual quaternion

  • combine the translation and orientation

  • $$
    \phi_{D Q}=4\left((\log \hat{e}) \cdot(\log \hat{e})^T\right)
    $$

  • SQP-SS and SQP-L2, $p$ as simple 6-element vector

  • SS: $\phi_{S S}=p_{e r r} \cdot p_{e r r}^T$

  • L2: $\phi_{L 2}=\sqrt{p_{e r r} \cdot p_{e r r}^T} .$

  • Trac-ik

  • Run two algorithm at once

  • SQP-SS

  • KDL-RR

  • Use the fastest one

Read more »

1. Goal

Given a goal in world coordinates, should calculate the robot joint angle that end-effector would result in the desired goal

  • Position
  • Orientation

2. Method

Ref

2.1. Jacobian Transpose

Idea: Virtual force

How: Taking the transpose of Jacobian, multiplying by error, use the velocity to update the joint angle

Pro: fast, easy to implement

Con: lead to singularities, numerical instablity

Read more »