🛒

Forward Kinematics

Forward Kinematics

如果我们要做动画的骨骼系统就需要用到运动学。这个系统能够表达跟人类似的拓扑结构(什么跟什么相连),我们能够定义各种的关节。
Articulated skeleton
  • Topology (what’s connected to what)
  • Geometric relations from joints
  • Tree structure (in absence of loops)
其中关节分为三种:
Joint types
  • Pin (1D rotation)
    • 钉子钉上的关节,就是只要钉上钉子,就只能在钉住的平面内旋转。
  • Ball (2D rotation)
    • 有一个东西能包住一个球,这个球能任意的旋转,也就是说旋转可以不发生在平面内,比 Pin 多了自由度。
      • notion image
  • Prismatic joint (translation)
    • 可以拉长,可以有些移动
      • notion image
notion image
我们可以定义一些简单的关节模型,形成整个相连的复杂模型,我们还能形成一个整个树形的加速结构。

Example: simple two segment arm in 2D

notion image
假设问第一段旋转 °,第二段旋转 ° ,那第二段的尖端在哪?
 
Animator provides angles, and computer determines position p of end effector
Animator 告诉每个关节怎么运动,然后求出关节最后停的位置。
notion image
💡
正向动力学,只要我们定义好各种连接方式,定义好位置,自然可以找到不同的位置,我们还能画出曲线随着时间 应该如何变化的曲线。
notion image
只要我们知道时间,知道 是多少,就知道尖端会停在哪。

Example Walk Cycle

正向运动学早就得到广泛应用了。
notion image

Kinematics Pros and Cons

Strengths
  • Direct control is convenient
    • 实现很容易,告诉一个位置,就能算出一个部件停在哪。
  • Implementation is straightforward
Weaknesses
  • Animation may be inconsistent with physics
    • 运动学的定义都十分地物理(xx 旋转多少角度),艺术家不喜欢这样,艺术家喜欢的是拽一个东西拽到什么地方去,这样更方便去创造动画。
  • Time consuming for artists
 
📖
为了让艺术家们更好地使用这套系统,调骨骼等,就出来一个概念——逆运动学。

Inverse Kinematics

如下图,我们可以捏着尖端到处移动,它会自动调整关节的位置,使得它的尖端就在我们要的位置上。
notion image
 
Animator provides position of end-effector, and computer must determine joint angles that satisfy constraints
逆运动学就是告诉它 P 点位置,逆运动学要告诉我
notion image
Direct inverse kinematics: for two-segment arm, can solve for parameters analytically
但是解起来非常难,下面的式子只是一个关节连一个关节的情况,要是多连几个更复杂。

逆运动学的问题

逆运动学还有一些独特的问题。
Why is the problem hard?
  • Multiple solutions in configuration space 它的解不唯一
    • 例如我希望机器人的手在下图右上角,但有两个摆放方式。三个连在一块会有更多情况。
notion image
notion image
  • Solutions may not always exist
    • 如下图,尖端所有可能的位置只在外层的圈和内层的圈之间。如果要把尖端放在大圆外或小圆内,这是无解的。
      • notion image

优化方法

人们都会通过优化方法来找到位置。
💡
例如我们可以调整 让端点停留在某个地方,现在要让目标到达某个地方,那我们应该如何反过来优化 ,这是个典型的优化问题。 优化问题可以用机器学习中的梯度下降的方法来解,我们知道离目标有多远,如果我们调整 ,我们可以让新的点往哪个地方去。 会影响最后的位置,这就是一个梯度。 正常情况下用牛顿法或者一些优化方法来做。
Numerical solution to general N-link IK problem
  • Choose an initial configuration
  • Define an error metric (e.g. square of distance between goal and current position)
  • Compute gradient of error as function of configuration
  • Apply gradient descent (or Newton’s method, or other optimization procedure)

Style-Based IK

逆运动学得到过广泛的应用。如下图,我们可以拖不同的位置让小人形成不同的形状。
Grochow et al., Style Based Inverse Kinematics
Grochow et al., Style Based Inverse Kinematics