class documentation

class Duration(TVal):

Constructor: Duration(secs, nsecs)

View In Hierarchy

Duration represents the ROS 'duration' primitive.

It consists of two integers: seconds and nanoseconds. The Duration class allows you to add and subtract Duration instances, including adding and subtracting from Time instances.

Method __abs__ Absolute value of this duration.
Method __add__ Add duration to this duration, or this duration to a time, creating a new time value as a result.
Method __cmp__ Undocumented
Method __div__ Divide this duration by an integer or float.
Method __divmod__ Implement the builtin divmod for a pair of Durations.
Method __eq__ Undocumented
Method __floordiv__ Floor divide this duration by an integer or float.
Method __getstate__ Support for Python pickling.
Method __hash__ Time values are hashable.
Method __init__ Create new Duration instance. secs and nsecs are integers and correspond to the ROS 'duration' primitive.
Method __mod__ Find the remainder when dividing this Duration by another Duration.
Method __mul__ Multiply this duration by an integer or float.
Method __neg__ No summary
Method __repr__ Undocumented
Method __setstate__ Support for Python pickling.
Method __sub__ Subtract duration from this duration, returning a new duration.
Method __truediv__ Divide this duration by an integer or float.
Class Variable __slots__ Undocumented
Instance Variable nsecs Undocumented
Instance Variable secs Undocumented

Inherited from TVal:

Class Method from_sec Create new TVal instance using time.time() value (float seconds).
Method __ge__ >= test for time values.
Method __gt__ > test for time values.
Method __le__ <= test for time values.
Method __lt__ < test for time values.
Method __ne__ Undocumented
Method __nonzero__ Return if time value is not zero.
Method __str__ Undocumented
Method canon Canonicalize the field representation in this instance.
Method is_zero No summary
Method set Set time using separate secs and nsecs values.
Method to_nsec No summary
Method to_sec No summary
Class Variable _slot_types Undocumented
def __abs__(self):

Absolute value of this duration.

Returns
positive Duration
def __add__(self, other):

Add duration to this duration, or this duration to a time, creating a new time value as a result.

Parameters
otherduration or time, Duration/Time
Returns
Duration if other is a Duration instance, Time if other is a Time
def __cmp__(self, other):

Undocumented

def __div__(self, val):

Divide this duration by an integer or float.

Parameters
valdivision factor int/float, or Duration to divide by
Returns
Duration divided by val - a Duration if divided by a number, or a number if divided by a duration
def __divmod__(self, val):

Implement the builtin divmod for a pair of Durations.

Returns
Duration The remaining time after the division
def __eq__(self, other):

Undocumented

def __floordiv__(self, val):

Floor divide this duration by an integer or float.

Parameters
valdivision factor int/float, or Duration to divide by
Returns
Duration divided by val - a Duration if divided by a number, or a number if divided by a duration
def __getstate__(self):

Support for Python pickling.

def __hash__(self):

Time values are hashable.

Time values with identical fields have the same hash.

def __init__(self, secs=0, nsecs=0):

Create new Duration instance. secs and nsecs are integers and correspond to the ROS 'duration' primitive.

Parameters
secsseconds, int
nsecsnanoseconds, int
def __mod__(self, val):

Find the remainder when dividing this Duration by another Duration.

Returns
Duration The remaining time after the division
def __mul__(self, val):

Multiply this duration by an integer or float.

Parameters
valmultiplication factor, int/float
Returns
Duration multiplied by val
def __neg__(self):
Returns
Negative value of this Duration
def __repr__(self):

Undocumented

def __setstate__(self, state):

Support for Python pickling.

def __sub__(self, other):

Subtract duration from this duration, returning a new duration.

Parameters
otherduration
Returns
Duration
def __truediv__(self, val):

Divide this duration by an integer or float.

Parameters
valdivision factor int/float, or Duration to divide by
Returns
Duration divided by val - a Duration if divided by a number, or a number if divided by a duration
__slots__: list[str] =

Undocumented

nsecs =

Undocumented

secs =

Undocumented