Skip to content

Commit

Permalink
Merge branch 'future' of github.com:petercorke/robotics-toolbox-pytho…
Browse files Browse the repository at this point in the history
…n into future
  • Loading branch information
jhavl committed Jun 19, 2024
2 parents 3c0e463 + b97420d commit 95d7efb
Show file tree
Hide file tree
Showing 8 changed files with 904 additions and 109 deletions.
4 changes: 2 additions & 2 deletions roboticstoolbox/blocks/arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ def __init__(
:type q0: array_like(n), optional
:param useprevious: Use previous IK solution as q0, defaults to True
:type useprevious: bool, optional
:param ik: Specify an IK function, defaults to ``Robot.ikine_LM``
:type ik: callable
:param ik: Specify an IK function, defaults to "LM"
:type ik: str
:param args: Options passed to IK function
:type args: dict
:param seed: random seed for solution
Expand Down
12 changes: 12 additions & 0 deletions roboticstoolbox/mobile/Animations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@Author: Peter Corke, original MATLAB code and Python version
@Author: Kristian Gibson, initial MATLAB port
"""

from abc import ABC
from math import pi, atan2
import numpy as np
Expand Down Expand Up @@ -194,6 +195,7 @@ def __init__(self, shape="car", scale=1, **kwargs):
``shape`` can be:
* ``"car"`` a rectangle with chamfered front corners
* ``"box"`` a rectangle
* ``"triangle"`` an isocles triangle pointing in the forward direction
* an 2xN NumPy array of vertices, does not have to be closed.
Expand All @@ -205,6 +207,7 @@ def __init__(self, shape="car", scale=1, **kwargs):
super().__init__()
if isinstance(shape, str):

# consider vehicle at origin, pointing along +ve x-axis
h = 0.3
t = 0.8 # start of head taper
c = 0.5 # centre x coordinate
Expand All @@ -221,6 +224,15 @@ def __init__(self, shape="car", scale=1, **kwargs):
[-c, -h],
]
).T
elif shape == "box":
self._coords = np.array(
[
[-c, h],
[w - c, h],
[w - c, -h],
[-c, -h],
]
).T
elif shape == "triangle":
self._coords = np.array(
[
Expand Down
Loading

0 comments on commit 95d7efb

Please sign in to comment.