Vibes API¶
-
class
vibes.
vibes
¶
Drawing functions¶
-
classmethod
vibes.
drawArrow
(A, B, tip_length, color='r', **kwargs)¶ Draw an arrow between starting at point A and ending at point B
Parameters: - A (double, double) – starting point (ax, ay)
- B (double, double) – ending point (bx, by)
- tip_length (double) – length of the tip
-
classmethod
vibes.
drawAUV
(cx, cy, oritentation, length, color='r', **kwargs)¶ Draw a AUV centered at (cx, cy) with heading <heading> and size length
Parameters: - cx,cy (double) – position of the AUV
- heading (double) – heading of the vehicle in degree
- lenght (double) – length of the vehicle
-
classmethod
vibes.
drawBox
(x_lb, x_ub, y_lb, y_ub, color='r', **kwargs)¶ Draw a box defined by its corners in figure named <figure>
Parameters: - x_lb (double) – x lower bound
- x_ub (double) – x upper bound
- y_lb (double) – y lower bound
- y_ub (double) – y upper bound
- figure (string) – optional, name of the figure where the box will be drawn
-
classmethod
vibes.
drawBoxesUnion
(boxes_bounds, color='r', **kwargs)¶ Computes and draw the union of a list of N-D rectangles, from a list of list of bounds
Parameters: box_bounds (list<list<float>>) – list of list of bounds in the form ((x_lb_1, x_ub_1, y_lb_1, ...), (x_lb_2, x_ub_2, y_lb_2, ...), ...)
-
classmethod
vibes.
drawCircle
(cx, cy, R, color='r', **kwargs)¶ Draw a circle centered at (cx, cy), with radius r
Parameters: - cx,cy (double) – center of the circle
- r (double) – raduis
-
classmethod
vibes.
drawEllipse
(cx, cy, a, b, rot, angles=[0, 360], color='r', **kwargs)¶ Draw an ellipse centered at (cx, cy), with semi-major and minor axes a and b, and rotated by rot (degrees)
Partial ellipse can be drawn using the angles argument.
Parameters: - cx,cy (double) – center of the ellipse
- a,b (double) – semi-major and minor axes
- rot (double) – direction of the semi-major axis !!! need to be in degree !!!
- angles (double, double) – starting and ending angle of the Ellispe
Example
>>> # full ellipse >>> vibes.drawEllipse(0,0, 1,2,45) >>> # half ellipse >>> vibes.drawEllipse(0,0, 1,2,45, angles=[0,180])
-
classmethod
vibes.
drawLine
(points, color='r', **kwargs)¶ Draw a N-D line from the list of coordinates
Parameters: points (list<list<float>>) – [[x_1, y_1, z_1, ...], [x_2, y_2, z_2, ...], ...]
-
classmethod
vibes.
drawPie
(center, rho, theta, color='r', use_radian=False, **kwargs)¶ Draw a Pie centered at <center> with raduis in <rho> and angle in <theta>
Parameters: - center (double, double) – center of the Pie
- rho (double, double) – minimal and maximal radius
- theta (double, double) – minimal and maximal angle (in degree)
- boolean (use_radian) – if True theta is in radian
-
classmethod
vibes.
drawPoint
(cx, cy, radius=3, color='r', **kwargs)¶ Draw a Point at position (cy, cy)
Parameters: cx,cy (double) – location of the point
-
classmethod
vibes.
drawPolygon
(points, color='r', **kwargs)¶ Draw a Polygon defined by <points>
Parameters: points (list of lists) – list of points. ex [ [p1x, p1y] , [p2x, p2y], ..., [pnx, pny]]
-
classmethod
vibes.
drawRing
(cx, cy, r_min, r_max, color='r', **kwargs)¶ Draw a ring at position (cx, cy) with radius between (r_min, r_max)
Parameters: - cx,cy (double) – center if the ring
- r_max (r_min,) – bound of the radius in degree
-
classmethod
vibes.
drawText
(cx, cy, text, scale, color='r', **kwargs)¶ Draw a text <text> at position (cx, cy)
Parameters: - cx,cy (double) – position of the text
- text (string) – text to draw
Note
Experimental feature
-
classmethod
vibes.
drawVehicle
(cx, cy, heading, length, color='r', **kwargs)¶ Draw a vehicle centered at (cx, cy) with heading <heading> and size length
Parameters: - cx,cy (double) – position of the vehicle
- heading (double) – heading of the vehicle in degree
- lenght (double) – length of the vehicle
Figure and view management¶
-
classmethod
vibes.
newFigure
(figure='')¶ Create a new figure named figureName.
Parameters: figure (string) – name of the new figure
-
classmethod
vibes.
selectFigure
(figure='')¶ Select figureName as the current figure. Drawing operations will then apply to figureName.
-
classmethod
vibes.
closeFigure
(**kwargs)¶ Close the figure named figureName, or the current figure if no argument is given.
-
classmethod
vibes.
clearFigure
(**kwargs)¶ Clears the contents of the figure figureName, or the current figure if argument is given.
-
classmethod
vibes.
saveImage
(fileName, **kwargs)¶ Save the figure figureName, or the current figure if no argument is given as an image. :param filName: name of the output image :type filName: string
-
classmethod
vibes.
setFigureProperties
(properties, **kwargs)¶ Set the property key to the provided value for current figure.
-
classmethod
vibes.
setFigureSize
(width, height, figure='')¶ Set the size of the window
-
classmethod
vibes.
setFigurePos
(x, y, figure='')¶ Set the position of the window
-
classmethod
vibes.
axisAuto
(**kwargs)¶ Set axes limits to the bounding box of the drawing.
-
classmethod
vibes.
axisEqual
(**kwargs)¶ Same as axisAuto but with the same ratio
-
classmethod
vibes.
axisLimits
(x_lb, x_ub, y_lb, y_ub, **kwargs)¶ Specify the rectangle to be displayed
Parameters: - x_lb,y_lb (float) – lower-left corner
- x_ub,y_ub (float) – upper-right corner
- Example :
>>> axisLimits(x_lb, x_ub, y_lb, y_ub, figure='')
-
classmethod
vibes.
axisLabels
(x_label, y_label, **kwargs)¶ Set axis Labels .. rubric:: example
>>> axisLabels( x_label, y_label, figur='')
-
classmethod
vibes.
newGroup
(groupName, **kwargs)¶ Create a new group with the specified name.
-
classmethod
vibes.
newGroup
(groupName, **kwargs) Create a new group with the specified name.
-
classmethod
vibes.
clearGroup
(groupName, **kwargs)¶ Clear the contents of the group groupName in figure figureName.