Functions
angles Namespace Reference

Functions

def _find_min_max_delta (from_angle, left_limit, right_limit)
 
static bool find_min_max_delta (double from, double left_limit, double right_limit, double &result_min_delta, double &result_max_delta)
 This function is only intended for internal use and not intended for external use. If you do use it, read the documentation very carefully. Returns the min and max amount (in radians) that can be moved from "from" angle to "left_limit" and "right_limit". More...
 
static double from_degrees (double degrees)
 Convert degrees to radians. More...
 
def normalize_angle (angle)
 
static double normalize_angle (double angle)
 normalize More...
 
def normalize_angle_positive (angle)
 
static double normalize_angle_positive (double angle)
 normalize_angle_positive More...
 
def shortest_angular_distance (from_angle, to_angle)
 
static double shortest_angular_distance (double from, double to)
 shortest_angular_distance More...
 
def shortest_angular_distance_with_large_limits (from_angle, to_angle, left_limit, right_limit)
 
static bool shortest_angular_distance_with_large_limits (double from, double to, double left_limit, double right_limit, double &shortest_angle)
 Returns the delta from from_angle to to_angle, making sure it does not violate limits specified by left_limit and right_limit. This function is similar to shortest_angular_distance_with_limits(), with the main difference that it accepts limits outside the [-M_PI, M_PI] range. Even if this is quite uncommon, one could indeed consider revolute joints with large rotation limits, e.g., in the range [-2*M_PI, 2*M_PI]. More...
 
def shortest_angular_distance_with_limits (from_angle, to_angle, left_limit, right_limit)
 
static bool shortest_angular_distance_with_limits (double from, double to, double left_limit, double right_limit, double &shortest_angle)
 Returns the delta from "from_angle" to "to_angle" making sure it does not violate limits specified by left_limit and right_limit. The valid interval of angular positions is [left_limit,right_limit]. E.g., [-0.25,0.25] is a 0.5 radians wide interval that contains 0. But [0.25,-0.25] is a 2*M_PI-0.5 wide interval that contains M_PI (but not 0). The value of shortest_angle is the angular difference between "from" and "to" that lies within the defined valid interval. E.g. shortest_angular_distance_with_limits(-0.5,0.5,0.25,-0.25,ss) evaluates ss to 2*M_PI-1.0 and returns true while shortest_angular_distance_with_limits(-0.5,0.5,-0.25,0.25,ss) returns false since -0.5 and 0.5 do not lie in the interval [-0.25,0.25]. More...
 
static double to_degrees (double radians)
 Convert radians to degrees. More...
 
def two_pi_complement (angle)
 
static double two_pi_complement (double angle)
 returns the angle in [-2*M_PI, 2*M_PI] going the other way along the unit circle. More...
 

Function Documentation

def angles._find_min_max_delta (   from_angle,
  left_limit,
  right_limit 
)
private
This function is only intended for internal use and not intended for external use. 
    If you do use it, read the documentation very carefully. 
    
    Returns the min and max amount (in radians) that can be moved 
    from "from" angle to "left_limit" and "right_limit".
    
    \param from - "from" angle - must lie in [-pi, pi)
    \param left_limit - left limit of valid interval for angular position 
        - must lie in [-pi, pi], left and right limits are specified on 
          the unit circle w.r.t to a reference pointing inwards
    \param right_limit - right limit of valid interval for angular position 
        - must lie in [-pi, pi], left and right limits are specified on 
          the unit circle w.r.t to a reference pointing inwards      
    \return (valid, min, max) - angle in radians that can be moved from "from" position before hitting the joint stop
             valid is False  if "from" angle does not lie in the interval [left_limit,right_limit]

Definition at line 75 of file __init__.py.

static bool angles::find_min_max_delta ( double  from,
double  left_limit,
double  right_limit,
double &  result_min_delta,
double &  result_max_delta 
)
static

This function is only intended for internal use and not intended for external use. If you do use it, read the documentation very carefully. Returns the min and max amount (in radians) that can be moved from "from" angle to "left_limit" and "right_limit".

Returns
returns false if "from" angle does not lie in the interval [left_limit,right_limit]
Parameters
from- "from" angle - must lie in [-M_PI, M_PI)
left_limit- left limit of valid interval for angular position - must lie in [-M_PI, M_PI], left and right limits are specified on the unit circle w.r.t to a reference pointing inwards
right_limit- right limit of valid interval for angular position - must lie in [-M_PI, M_PI], left and right limits are specified on the unit circle w.r.t to a reference pointing inwards
result_min_delta- minimum (delta) angle (in radians) that can be moved from "from" position before hitting the joint stop
result_max_delta- maximum (delta) angle (in radians) that can be movedd from "from" position before hitting the joint stop

Definition at line 141 of file angles.h.

static double angles::from_degrees ( double  degrees)
inlinestatic

Convert degrees to radians.

Definition at line 48 of file angles.h.

def angles.normalize_angle (   angle)
Normalizes the angle to be -pi to +pi
    It takes and returns radians.

Definition at line 42 of file __init__.py.

static double angles::normalize_angle ( double  angle)
inlinestatic

normalize

Normalizes the angle to be -M_PI circle to +M_PI circle It takes and returns radians.

Definition at line 83 of file angles.h.

def angles.normalize_angle_positive (   angle)
Normalizes the angle to be 0 to 2*pi
    It takes and returns radians. 

Definition at line 37 of file __init__.py.

static double angles::normalize_angle_positive ( double  angle)
inlinestatic

normalize_angle_positive

Normalizes the angle to be 0 to 2*M_PI It takes and returns radians.

Definition at line 68 of file angles.h.

def angles.shortest_angular_distance (   from_angle,
  to_angle 
)
Given 2 angles, this returns the shortest angular
    difference.  The inputs and ouputs are of course radians.
 
    The result would always be -pi <= result <= pi. Adding the result
    to "from" will always get you an equivelent angle to "to".

Definition at line 50 of file __init__.py.

static double angles::shortest_angular_distance ( double  from,
double  to 
)
inlinestatic

shortest_angular_distance

Given 2 angles, this returns the shortest angular difference. The inputs and ouputs are of course radians.

The result would always be -pi <= result <= pi. Adding the result to "from" will always get you an equivelent angle to "to".

Definition at line 103 of file angles.h.

def angles.shortest_angular_distance_with_large_limits (   from_angle,
  to_angle,
  left_limit,
  right_limit 
)
Returns the delta from `from_angle` to `to_angle`, making sure it does not violate limits specified by `left_limit` and `right_limit`.
    This function is similar to `shortest_angular_distance_with_limits()`, with the main difference that it accepts limits outside the `[-M_PI, M_PI]` range.
    Even if this is quite uncommon, one could indeed consider revolute joints with large rotation limits, e.g., in the range `[-2*M_PI, 2*M_PI]`.

    In this case, a strict requirement is to have `left_limit` smaller than `right_limit`.
    Note also that `from_angle` must lie inside the valid range, while `to_angle` does not need to.
    In fact, this function will evaluate the shortest (valid) angle `shortest_angle` so that `from_angle+shortest_angle` equals `to_angle` up to an integer multiple of `2*M_PI`.
    As an example, a call to `shortest_angular_distance_with_large_limits(0, 10.5*M_PI, -2*M_PI, 2*M_PI)` will return `true`, with `shortest_angle=0.5*M_PI`.
    This is because `from_angle` and `from_angle+shortest_angle` are both inside the limits, and `fmod(to_angle+shortest_angle, 2*M_PI)` equals `fmod(to_angle, 2*M_PI)`.
    On the other hand, `shortest_angular_distance_with_large_limits(10.5*M_PI, 0, -2*M_PI, 2*M_PI)` will return false, since `from_angle` is not in the valid range.
    Finally, note that the call `shortest_angular_distance_with_large_limits(0, 10.5*M_PI, -2*M_PI, 0.1*M_PI)` will also return `true`.
    However, `shortest_angle` in this case will be `-1.5*M_PI`.

    \return valid_flag, shortest_angle - valid_flag will be true if `left_limit < right_limit` and if "from_angle" and "from_angle+shortest_angle" positions are within the valid interval, false otherwise.
    \param left_limit - left limit of valid interval, must be smaller than right_limit.
    \param right_limit - right limit of valid interval, must be greater than left_limit.

Definition at line 180 of file __init__.py.

static bool angles::shortest_angular_distance_with_large_limits ( double  from,
double  to,
double  left_limit,
double  right_limit,
double &  shortest_angle 
)
inlinestatic

Returns the delta from from_angle to to_angle, making sure it does not violate limits specified by left_limit and right_limit. This function is similar to shortest_angular_distance_with_limits(), with the main difference that it accepts limits outside the [-M_PI, M_PI] range. Even if this is quite uncommon, one could indeed consider revolute joints with large rotation limits, e.g., in the range [-2*M_PI, 2*M_PI].

In this case, a strict requirement is to have left_limit smaller than right_limit. Note also that from must lie inside the valid range, while to does not need to. In fact, this function will evaluate the shortest (valid) angle shortest_angle so that from+shortest_angle equals to up to an integer multiple of 2*M_PI. As an example, a call to shortest_angular_distance_with_large_limits(0, 10.5*M_PI, -2*M_PI, 2*M_PI, shortest_angle) will return true, with shortest_angle=0.5*M_PI. This is because from and from+shortest_angle are both inside the limits, and fmod(to+shortest_angle, 2*M_PI) equals fmod(to, 2*M_PI). On the other hand, shortest_angular_distance_with_large_limits(10.5*M_PI, 0, -2*M_PI, 2*M_PI, shortest_angle) will return false, since from is not in the valid range. Finally, note that the call shortest_angular_distance_with_large_limits(0, 10.5*M_PI, -2*M_PI, 0.1*M_PI, shortest_angle) will also return true. However, shortest_angle in this case will be -1.5*M_PI.

Returns
true if left_limit < right_limit and if "from" and "from+shortest_angle" positions are within the valid interval, false otherwise.
Parameters
from- "from" angle.
to- "to" angle.
left_limit- left limit of valid interval, must be smaller than right_limit.
right_limit- right limit of valid interval, must be greater than left_limit.
shortest_angle- result of the shortest angle calculation.

Definition at line 222 of file angles.h.

def angles.shortest_angular_distance_with_limits (   from_angle,
  to_angle,
  left_limit,
  right_limit 
)
Returns the delta from "from_angle" to "to_angle" making sure it does not violate limits specified by left_limit and right_limit.
    The valid interval of angular positions is [left_limit,right_limit]. E.g., [-0.25,0.25] is a 0.5 radians wide interval that contains 0.
    But [0.25,-0.25] is a 2*pi-0.5 wide interval that contains pi (but not 0).
    The value of shortest_angle is the angular difference between "from" and "to" that lies within the defined valid interval.
    
    E.g. shortest_angular_distance_with_limits(-0.5,0.5,0.25,-0.25) returns 2*pi-1.0
         shortest_angular_distance_with_limits(-0.5,0.5,-0.25,0.25) returns None since -0.5 and 0.5 do not lie in the interval [-0.25,0.25]
         
    \param left_limit - left limit of valid interval for angular position 
        - must lie in [-pi, pi], left and right limits are specified on 
          the unit circle w.r.t to a reference pointing inwards
    \param right_limit - right limit of valid interval for angular position 
        - must lie in [-pi, pi], left and right limits are specified on 
          the unit circle w.r.t to a reference pointing inwards   
    \returns valid_flag, shortest_angle 

Definition at line 124 of file __init__.py.

static bool angles::shortest_angular_distance_with_limits ( double  from,
double  to,
double  left_limit,
double  right_limit,
double &  shortest_angle 
)
inlinestatic

Returns the delta from "from_angle" to "to_angle" making sure it does not violate limits specified by left_limit and right_limit. The valid interval of angular positions is [left_limit,right_limit]. E.g., [-0.25,0.25] is a 0.5 radians wide interval that contains 0. But [0.25,-0.25] is a 2*M_PI-0.5 wide interval that contains M_PI (but not 0). The value of shortest_angle is the angular difference between "from" and "to" that lies within the defined valid interval. E.g. shortest_angular_distance_with_limits(-0.5,0.5,0.25,-0.25,ss) evaluates ss to 2*M_PI-1.0 and returns true while shortest_angular_distance_with_limits(-0.5,0.5,-0.25,0.25,ss) returns false since -0.5 and 0.5 do not lie in the interval [-0.25,0.25].

Returns
true if "from" and "to" positions are within the limit interval, false otherwise
Parameters
from- "from" angle
to- "to" angle
left_limit- left limit of valid interval for angular position, left and right limits are specified on the unit circle w.r.t to a reference pointing inwards
right_limit- right limit of valid interval for angular position, left and right limits are specified on the unit circle w.r.t to a reference pointing inwards
shortest_angle- result of the shortest angle calculation

Definition at line 289 of file angles.h.

static double angles::to_degrees ( double  radians)
inlinestatic

Convert radians to degrees.

Definition at line 56 of file angles.h.

def angles.two_pi_complement (   angle)
returns the angle in [-2*pi, 2*pi]  going the other way along the unit circle.
    \param angle The angle to which you want to turn in the range [-2*pi, 2*pi]
        E.g. two_pi_complement(-pi/4) returns 7_pi/4
             two_pi_complement(pi/4) returns -7*pi/4

Definition at line 59 of file __init__.py.

static double angles::two_pi_complement ( double  angle)
inlinestatic

returns the angle in [-2*M_PI, 2*M_PI] going the other way along the unit circle.

Parameters
angleThe angle to which you want to turn in the range [-2*M_PI, 2*M_PI] E.g. two_pi_complement(-M_PI/4) returns 7_M_PI/4 two_pi_complement(M_PI/4) returns -7*M_PI/4

Definition at line 117 of file angles.h.



angles
Author(s): John Hsu
autogenerated on Fri Mar 13 2020 03:55:59