Skip to content

Commit fdecdb8

Browse files
committed
doco
1 parent edaa509 commit fdecdb8

File tree

2 files changed

+36
-14
lines changed

2 files changed

+36
-14
lines changed

roboticstoolbox/mobile/animations.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class VehiclePolygon(VehicleAnimation):
105105

106106
def __init__(self, shape='car', scale=1, **kwargs):
107107
"""
108-
Create graphical animation of vehicle as an icon
108+
Create graphical animation of vehicle as a polygon
109109
110110
:param shape: polygon shape, defaults to 'car'
111111
:type shape: str
@@ -127,9 +127,10 @@ def __init__(self, shape='car', scale=1, **kwargs):
127127
veh.run(animation=a)
128128
129129
``shape`` can be:
130+
130131
* ``"car"`` a rectangle with a pointy front
131132
* ``"triangle"`` a triangle
132-
* an Nx2 array of vertices, does not have to be closed.
133+
* an Nx2 NumPy array of vertices, does not have to be closed.
133134
134135
:seealso: :func:`~Vehicle`
135136
"""
@@ -210,6 +211,15 @@ def __init__(self, filename, origin=None, scale=1, rotation=0):
210211
* ``"redcar"`` a red car (top view)
211212
* path to an image file, including extension
212213
214+
.. image:: ../../roboticstoolbox/data/greycar.png
215+
:width: 200px
216+
:align: center
217+
218+
.. image:: ../../roboticstoolbox/data/redcar.png
219+
:width: 300px
220+
:align: center
221+
222+
213223
The car is scaled to an image with a length of ``scale`` in the units of
214224
the plot.
215225

roboticstoolbox/mobile/vehicle.py

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Vehicle(ABC):
2222
def __init__(self, covar=None, speed_max=np.inf, accel_max=np.inf, x0=None, dt=0.1,
2323
control=None, animation=None, verbose=False, dim=10):
2424
r"""
25-
Superclass for vehicle kino-dynamic models
25+
Superclass for vehicle kinematic models
2626
2727
:param covar: odometry covariance, defaults to zero
2828
:type covar: ndarray(2,2), optional
@@ -260,7 +260,7 @@ def deriv(self, x, u):
260260

261261
def add_driver(self, driver):
262262
"""
263-
Add a driver agent
263+
Add a driver agent (superclass method)
264264
265265
:param driver: a driver agent object
266266
:type driver: VehicleDriver subclass
@@ -277,7 +277,7 @@ def add_driver(self, driver):
277277

278278
def run(self, N=1000, x0=None, control=None, animation=None, plot=True):
279279
"""
280-
Simulate motion of vehicle
280+
Simulate motion of vehicle (superclass method)
281281
282282
:param N: Number of simulation steps, defaults to 1000
283283
:type N: int, optional
@@ -330,7 +330,7 @@ def run(self, N=1000, x0=None, control=None, animation=None, plot=True):
330330

331331
def init(self, x0=None, animation=None, plot=False, control=None):
332332
"""
333-
Initialize for simulation
333+
Initialize for simulation (superclass method)
334334
335335
:param x0: Initial state, defaults to value given to Vehicle constructor
336336
:type x0: array_like(3) or array_like(2)
@@ -390,7 +390,7 @@ def init(self, x0=None, animation=None, plot=False, control=None):
390390

391391
def step(self, u1=None, u2=None):
392392
"""
393-
Step simulator by one time step
393+
Step simulator by one time step (superclass method)
394394
395395
:return: odometry :math:`(\delta_d, \delta_\theta)`
396396
:rtype: ndarray(2)
@@ -453,7 +453,7 @@ def step(self, u1=None, u2=None):
453453

454454
def eval_control(self, control, x):
455455
"""
456-
Evaluate vehicle control input
456+
Evaluate vehicle control input (superclass method)
457457
458458
:param control: vehicle control
459459
:type control: [type]
@@ -500,7 +500,7 @@ def eval_control(self, control, x):
500500

501501
def stopif(self, stop):
502502
"""
503-
Stop the simulation
503+
Stop the simulation (superclass method)
504504
505505
:param stop: stop condition
506506
:type stop: bool
@@ -515,7 +515,7 @@ def stopif(self, stop):
515515

516516
def plot(self, path=None, block=True):
517517
"""
518-
[summary]
518+
[summary] (superclass method)
519519
520520
:param path: [description], defaults to None
521521
:type path: [type], optional
@@ -540,7 +540,7 @@ def plot_xyt_t(self, block=True, **kwargs):
540540

541541
def limits_va(self, v):
542542
"""
543-
Apply velocity and acceleration limits
543+
Apply velocity and acceleration limits (superclass method)
544544
545545
:param v: commanded velocity
546546
:type v: float
@@ -564,7 +564,7 @@ def limits_va(self, v):
564564

565565
def path(self, t=10, u=None, x0=None):
566566
"""
567-
Compute path by integration
567+
Compute path by integration (superclass method)
568568
569569
:param t: [description], defaults to None
570570
:type t: [type], optional
@@ -621,14 +621,16 @@ def __init__(self,
621621
**kwargs
622622
):
623623
r"""
624-
Create new bicycle kino-dynamic model
624+
Create new bicycle kinematic model
625625
626626
:param l: wheel base, defaults to 1
627627
:type l: float, optional
628628
:param steer_max: [description], defaults to :math:`0.45\pi`
629629
:type steer_max: float, optional
630-
:param **kwargs: additional arguments passed to :func:`Vehicle`
630+
:param **kwargs: additional arguments passed to :class:`Vehicle`
631631
constructor
632+
633+
:seealso: :class:`.Vehicle`
632634
"""
633635
super().__init__(**kwargs)
634636

@@ -803,6 +805,16 @@ class Unicycle(Vehicle):
803805
def __init__(self,
804806
w=1,
805807
**kwargs):
808+
r"""
809+
Create new unicycle kinematic model
810+
811+
:param w: vehicle width, defaults to 1
812+
:type w: float, optional
813+
:param **kwargs: additional arguments passed to :class:`Vehicle`
814+
constructor
815+
816+
:seealso: :class:`.Vehicle`
817+
"""
806818
super().__init__(**kwargs)
807819
self._w = w
808820

0 commit comments

Comments
 (0)