libfranka 0.15.0
FCI C++ API
Loading...
Searching...
No Matches
Public Member Functions | List of all members
franka::Duration Class Reference

Represents a duration with millisecond resolution. More...

#include <duration.h>

Public Member Functions

 Duration () noexcept
 Creates a new Duration instance with zero milliseconds.
 
 Duration (uint64_t milliseconds) noexcept
 Creates a new Duration instance from the given number of milliseconds.
 
 Duration (std::chrono::duration< uint64_t, std::milli > duration) noexcept
 Creates a new Duration instance from an std::chrono::duration.
 
 Duration (const Duration &)=default
 Creates a copy of a Duration instance.
 
Durationoperator= (const Duration &)=default
 Assigns the contents of one Duration to another.
 
 operator std::chrono::duration< uint64_t, std::milli > () const noexcept
 Returns the stored duration as an std::chrono::duration.
 
double toSec () const noexcept
 Returns the stored duration in \([s]\).
 
uint64_t toMSec () const noexcept
 Returns the stored duration in \([ms]\).
 
Arithmetic operators
Duration operator+ (const Duration &rhs) const noexcept
 Performs addition.
 
Durationoperator+= (const Duration &rhs) noexcept
 Performs addition.
 
Duration operator- (const Duration &rhs) const noexcept
 Performs subtraction.
 
Durationoperator-= (const Duration &rhs) noexcept
 Performs subtraction.
 
Duration operator* (uint64_t rhs) const noexcept
 Performs multiplication.
 
Durationoperator*= (uint64_t rhs) noexcept
 Performs multiplication.
 
uint64_t operator/ (const Duration &rhs) const noexcept
 Performs division.
 
Duration operator/ (uint64_t rhs) const noexcept
 Performs division.
 
Durationoperator/= (uint64_t rhs) noexcept
 Performs division.
 
Duration operator% (const Duration &rhs) const noexcept
 Performs the modulo operation.
 
Duration operator% (uint64_t rhs) const noexcept
 Performs the modulo operation.
 
Durationoperator%= (const Duration &rhs) noexcept
 Performs the modulo operation.
 
Durationoperator%= (uint64_t rhs) noexcept
 Performs the modulo operation.
 
Comparison operators
bool operator== (const Duration &rhs) const noexcept
 Compares two durations for equality.
 
bool operator!= (const Duration &rhs) const noexcept
 Compares two durations for inequality.
 
bool operator< (const Duration &rhs) const noexcept
 Compares two durations.
 
bool operator<= (const Duration &rhs) const noexcept
 Compares two durations.
 
bool operator> (const Duration &rhs) const noexcept
 Compares two durations.
 
bool operator>= (const Duration &rhs) const noexcept
 Compares two durations.
 

Detailed Description

Represents a duration with millisecond resolution.

Examples
cartesian_impedance_control.cpp, communication_test.cpp, force_control.cpp, generate_cartesian_pose_motion.cpp, generate_cartesian_pose_motion_external_control_loop.cpp, generate_cartesian_velocity_motion.cpp, generate_cartesian_velocity_motion_external_control_loop.cpp, generate_consecutive_motions.cpp, generate_elbow_motion.cpp, generate_joint_position_motion.cpp, generate_joint_position_motion_external_control_loop.cpp, generate_joint_velocity_motion.cpp, generate_joint_velocity_motion_external_control_loop.cpp, joint_impedance_control.cpp, motion_with_control.cpp, and motion_with_control_external_control_loop.cpp.

Constructor & Destructor Documentation

◆ Duration() [1/2]

franka::Duration::Duration ( uint64_t  milliseconds)
explicitnoexcept

Creates a new Duration instance from the given number of milliseconds.

Parameters
[in]millisecondsNumber of milliseconds.

◆ Duration() [2/2]

franka::Duration::Duration ( std::chrono::duration< uint64_t, std::milli >  duration)
noexcept

Creates a new Duration instance from an std::chrono::duration.

Parameters
[in]durationDuration.

Member Function Documentation

◆ operator std::chrono::duration< uint64_t, std::milli >()

franka::Duration::operator std::chrono::duration< uint64_t, std::milli > ( ) const
noexcept

Returns the stored duration as an std::chrono::duration.

Returns
Duration as std::chrono::duration.

◆ operator!=()

bool franka::Duration::operator!= ( const Duration rhs) const
noexcept

Compares two durations for inequality.

Parameters
[in]rhsRight-hand side of the comparison.
Returns
True if the duration are not equal, false otherwise.

◆ operator%() [1/2]

Duration franka::Duration::operator% ( const Duration rhs) const
noexcept

Performs the modulo operation.

Parameters
[in]rhsRight-hand side of the operation.
Returns
Result of the operation.

◆ operator%() [2/2]

Duration franka::Duration::operator% ( uint64_t  rhs) const
noexcept

Performs the modulo operation.

Parameters
[in]rhsRight-hand side of the operation.
Returns
Result of the operation.

◆ operator%=() [1/2]

Duration & franka::Duration::operator%= ( const Duration rhs)
noexcept

Performs the modulo operation.

Parameters
[in]rhsRight-hand side of the operation.
Returns
This duration.

◆ operator%=() [2/2]

Duration & franka::Duration::operator%= ( uint64_t  rhs)
noexcept

Performs the modulo operation.

Parameters
[in]rhsRight-hand side of the operation.
Returns
This duration.

◆ operator*()

Duration franka::Duration::operator* ( uint64_t  rhs) const
noexcept

Performs multiplication.

Parameters
[in]rhsRight-hand side of the operation.
Returns
Result of the operation.

◆ operator*=()

Duration & franka::Duration::operator*= ( uint64_t  rhs)
noexcept

Performs multiplication.

Parameters
[in]rhsRight-hand side of the operation.
Returns
This duration.

◆ operator+()

Duration franka::Duration::operator+ ( const Duration rhs) const
noexcept

Performs addition.

Parameters
[in]rhsRight-hand side of the operation.
Returns
Result of the operation.

◆ operator+=()

Duration & franka::Duration::operator+= ( const Duration rhs)
noexcept

Performs addition.

Parameters
[in]rhsRight-hand side of the operation.
Returns
This duration.

◆ operator-()

Duration franka::Duration::operator- ( const Duration rhs) const
noexcept

Performs subtraction.

Parameters
[in]rhsRight-hand side of the operation.
Returns
Result of the operation.

◆ operator-=()

Duration & franka::Duration::operator-= ( const Duration rhs)
noexcept

Performs subtraction.

Parameters
[in]rhsRight-hand side of the operation.
Returns
This duration.

◆ operator/() [1/2]

uint64_t franka::Duration::operator/ ( const Duration rhs) const
noexcept

Performs division.

Parameters
[in]rhsRight-hand side of the operation.
Returns
Result of the operation.

◆ operator/() [2/2]

Duration franka::Duration::operator/ ( uint64_t  rhs) const
noexcept

Performs division.

Parameters
[in]rhsRight-hand side of the operation.
Returns
Result of the operation.

◆ operator/=()

Duration & franka::Duration::operator/= ( uint64_t  rhs)
noexcept

Performs division.

Parameters
[in]rhsRight-hand side of the operation.
Returns
This duration.

◆ operator<()

bool franka::Duration::operator< ( const Duration rhs) const
noexcept

Compares two durations.

Parameters
[in]rhsRight-hand side of the comparison.
Returns
True if this duration is shorter than rhs, false otherwise.

◆ operator<=()

bool franka::Duration::operator<= ( const Duration rhs) const
noexcept

Compares two durations.

Parameters
[in]rhsRight-hand side of the comparison.
Returns
True if this duration is shorter than or equal to rhs, false otherwise.

◆ operator=()

Duration & franka::Duration::operator= ( const Duration )
default

Assigns the contents of one Duration to another.

Returns
Result of the operation.

◆ operator==()

bool franka::Duration::operator== ( const Duration rhs) const
noexcept

Compares two durations for equality.

Parameters
[in]rhsRight-hand side of the comparison.
Returns
True if the duration are equal, false otherwise.

◆ operator>()

bool franka::Duration::operator> ( const Duration rhs) const
noexcept

Compares two durations.

Parameters
[in]rhsRight-hand side of the comparison.
Returns
True if this duration is longer than rhs, false otherwise.

◆ operator>=()

bool franka::Duration::operator>= ( const Duration rhs) const
noexcept

Compares two durations.

Parameters
[in]rhsRight-hand side of the comparison.
Returns
True if this duration is longer than or equal to rhs, false otherwise.

◆ toMSec()

uint64_t franka::Duration::toMSec ( ) const
noexcept

Returns the stored duration in \([ms]\).

Returns
Duration in \([ms]\).
Examples
communication_test.cpp.

◆ toSec()

double franka::Duration::toSec ( ) const
noexcept

The documentation for this class was generated from the following file: