Functions for tank movement (differential steering)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I'm programming a game, of sorts, where a tank is steered based on the thrust applied to each of its caterpillar-tracks.



I'm in need of two functions:



$R(T_l, T_r, d)$



which will return the angular velocity of the tank, in radians/s, and



$S(T_l, T_r, d)$



which will return the current speed which the tank should be travelling, in units/s, where $T_l$ = the thrust on the left wheel, $T_r$ = the thrust on the right wheel, and $d$ = the distance between the origin (middle) of the tank and any of the wheels.



As a diagram, it would look like this:
Tank
Notice that there are a few parts of the diagram which I haven't already mentioned ($[a,b]$, and $s$), which I will explain soon.



I have thought of a few pieces of a possible solution, however I'm not sure how effectively this will work:



  1. Let the vector $mathbf l mathrm = [-d, T_l]$, and $mathbf r mathrm = [d, T_r]$, so that they are the tips of the visual representations of the thrusts (in the diagram, the tips of the arrows $T_l$ and $T_r$).

  2. The angular velocity is the angle between the perpendicular of $overrightarrowlr$
    and the origin of the tank.

  3. The speed is the distance between the midpoint of $overrightarrowlr$ and the origin of the tank.

Is this correct? If so, how would I calculate the values? If not, what would be the correct way?







share|cite|improve this question























    up vote
    0
    down vote

    favorite












    I'm programming a game, of sorts, where a tank is steered based on the thrust applied to each of its caterpillar-tracks.



    I'm in need of two functions:



    $R(T_l, T_r, d)$



    which will return the angular velocity of the tank, in radians/s, and



    $S(T_l, T_r, d)$



    which will return the current speed which the tank should be travelling, in units/s, where $T_l$ = the thrust on the left wheel, $T_r$ = the thrust on the right wheel, and $d$ = the distance between the origin (middle) of the tank and any of the wheels.



    As a diagram, it would look like this:
    Tank
    Notice that there are a few parts of the diagram which I haven't already mentioned ($[a,b]$, and $s$), which I will explain soon.



    I have thought of a few pieces of a possible solution, however I'm not sure how effectively this will work:



    1. Let the vector $mathbf l mathrm = [-d, T_l]$, and $mathbf r mathrm = [d, T_r]$, so that they are the tips of the visual representations of the thrusts (in the diagram, the tips of the arrows $T_l$ and $T_r$).

    2. The angular velocity is the angle between the perpendicular of $overrightarrowlr$
      and the origin of the tank.

    3. The speed is the distance between the midpoint of $overrightarrowlr$ and the origin of the tank.

    Is this correct? If so, how would I calculate the values? If not, what would be the correct way?







    share|cite|improve this question





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm programming a game, of sorts, where a tank is steered based on the thrust applied to each of its caterpillar-tracks.



      I'm in need of two functions:



      $R(T_l, T_r, d)$



      which will return the angular velocity of the tank, in radians/s, and



      $S(T_l, T_r, d)$



      which will return the current speed which the tank should be travelling, in units/s, where $T_l$ = the thrust on the left wheel, $T_r$ = the thrust on the right wheel, and $d$ = the distance between the origin (middle) of the tank and any of the wheels.



      As a diagram, it would look like this:
      Tank
      Notice that there are a few parts of the diagram which I haven't already mentioned ($[a,b]$, and $s$), which I will explain soon.



      I have thought of a few pieces of a possible solution, however I'm not sure how effectively this will work:



      1. Let the vector $mathbf l mathrm = [-d, T_l]$, and $mathbf r mathrm = [d, T_r]$, so that they are the tips of the visual representations of the thrusts (in the diagram, the tips of the arrows $T_l$ and $T_r$).

      2. The angular velocity is the angle between the perpendicular of $overrightarrowlr$
        and the origin of the tank.

      3. The speed is the distance between the midpoint of $overrightarrowlr$ and the origin of the tank.

      Is this correct? If so, how would I calculate the values? If not, what would be the correct way?







      share|cite|improve this question











      I'm programming a game, of sorts, where a tank is steered based on the thrust applied to each of its caterpillar-tracks.



      I'm in need of two functions:



      $R(T_l, T_r, d)$



      which will return the angular velocity of the tank, in radians/s, and



      $S(T_l, T_r, d)$



      which will return the current speed which the tank should be travelling, in units/s, where $T_l$ = the thrust on the left wheel, $T_r$ = the thrust on the right wheel, and $d$ = the distance between the origin (middle) of the tank and any of the wheels.



      As a diagram, it would look like this:
      Tank
      Notice that there are a few parts of the diagram which I haven't already mentioned ($[a,b]$, and $s$), which I will explain soon.



      I have thought of a few pieces of a possible solution, however I'm not sure how effectively this will work:



      1. Let the vector $mathbf l mathrm = [-d, T_l]$, and $mathbf r mathrm = [d, T_r]$, so that they are the tips of the visual representations of the thrusts (in the diagram, the tips of the arrows $T_l$ and $T_r$).

      2. The angular velocity is the angle between the perpendicular of $overrightarrowlr$
        and the origin of the tank.

      3. The speed is the distance between the midpoint of $overrightarrowlr$ and the origin of the tank.

      Is this correct? If so, how would I calculate the values? If not, what would be the correct way?









      share|cite|improve this question










      share|cite|improve this question




      share|cite|improve this question









      asked Jul 14 at 17:03









      Jacob Garby

      104




      104

























          active

          oldest

          votes











          Your Answer




          StackExchange.ifUsing("editor", function ()
          return StackExchange.using("mathjaxEditing", function ()
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          );
          );
          , "mathjax-editing");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "69"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2851780%2ffunctions-for-tank-movement-differential-steering%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2851780%2ffunctions-for-tank-movement-differential-steering%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What is the equation of a 3D cone with generalised tilt?

          Color the edges and diagonals of a regular polygon

          Relationship between determinant of matrix and determinant of adjoint?