simulation.utils.geometry.vector module

Vector.

Summary

Classes:

Vector

Implementation of the mathematical vector object.

Reference

class Vector(*args, **kwargs)[source]

Bases: shapely.geometry.point.Point

Implementation of the mathematical vector object.

Inheriting from shapely enables to use their powerful operations in combination with other objects, e.g. lines, polygons.

Initialization can be done in one of the following ways.

Parameters
  • [x (np.array) –

  • y (np.array) –

  • z] (np.array) –

  • geometry_msgs/Vector

  • (x (float) –

  • y* (float) –

  • z*) (float) –

Keyword Arguments
  • r (float) – length of vector

  • phi (float) – angle between vector and x-y-plane

A vector is always initialized with 3 coordinates. If there’s no third coordinate provided, z:=0.

classmethod from_geometry_msg(geometry_msg: geometry_msgs.msg._Vector3.Vector3)[source]

Initialize from ROS geometry_msg.

to_geometry_msg() → geometry_msgs.msg._Vector3.Vector3[source]

To ROS geometry_msg.

Returns

This vector as a geometry_msgs/Vector3

to_numpy() → numpy.ndarray[source]

To numpy array.

Returns

Vector as a numpy array.

rotated(*args, **kwargs)
cross(*args, **kwargs)
property argument

Return the argument of the vector in radian.

Type

float