0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ロボトレース のショートカット経路

Last updated at Posted at 2020-01-06

untitled1.png
アルゴリズム

  1. 直線は次のRの符号と同じにする
  2. 円弧で、前回の経路と符号が違う時、法線ベクトルの方向にトレッド幅の2倍ずれる
saiteki_keiro.m
        function obj = write_saiteki_keiro(obj,keiro)%keiro[回転角度[rad],R[m]]直線の時:rad=距離
            keiro = optimize_keiro(obj,keiro)
            for gyou = 1:size(keiro,1)
                gyou
                %符号が違う(積がマイナス)時、ずらす
                if (abs(keiro(gyou,2))~=inf)
                    if keiro(gyou-1,2)*keiro(gyou,2)<0
                        if keiro(gyou,2)>0
                            housen_theta = obj.theta + pi/2;
                        else
                            housen_theta = obj.theta - pi/2;
                        end
                        obj.x = obj.x + 2*obj.tred*cos(housen_theta);
                        obj.y = obj.y + 2*obj.tred*sin(housen_theta);
                    end
                end
                obj = write_one_keiro(obj,keiro(gyou,1),keiro(gyou,2));
            end
        end

後は、

  • 経路をずれるところをぼかす
  • タコつぼ、スラローム対策
    次に速度、角速度を決定してみる
    untitled1 2.png
    次に加速度、角加速度を決定してみる
    角加速度のトレードオフ
    $$\boldsymbol{a}(t)=a(t)\boldsymbol{t}+\frac{v^2}{r}\boldsymbol{n}=a(t)\boldsymbol{t}+rω^2\boldsymbol{n}=a(t)\boldsymbol{t}+vω\boldsymbol{n}$$
    なので、速度一定、角加速度一定では、加速度は大きくなるばかりだ
    とりあえず、角加速度だけ設定してみる
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?