Functions
industrial_robot_client::utils Namespace Reference

Functions

bool isWithinRange (const std::vector< double > &lhs, const std::vector< double > &rhs, double full_range)
 Checks to see if members are within the same range. Specifically, Each item in abs(lhs[i] - rhs[i]) < abs(range/2.0). Empty vectors always return true. The behavior of this function around large values (near double limits) is uncertain. This function is not optimized, do not use for large vectors or loops.
bool isWithinRange (const std::vector< std::string > &keys, const std::map< std::string, double > &lhs, const std::map< std::string, double > &rhs, double full_range)
 Map version of.
bool isWithinRange (const std::vector< std::string > &lhs_keys, const std::vector< double > &lhs_values, const std::vector< std::string > &rhs_keys, const std::vector< double > &rhs_values, double full_range)
 Key/Values vector version of.
bool mapInsert (const std::string &key, double value, std::map< std::string, double > &mappings)
 Convenience function for inserting a value into an std::map, assuming a string key and a double value.
bool toMap (const std::vector< std::string > &keys, const std::vector< double > &values, std::map< std::string, double > &mappings)
 Convenience function for taking two separate key,value vectors and creating the more convenient map. This is helpful for some ROS message types where maps are defined as two separate vectors (ROS messages do not support maps).

Function Documentation

bool industrial_robot_client::utils::isWithinRange ( const std::vector< double > &  lhs,
const std::vector< double > &  rhs,
double  full_range 
)

Checks to see if members are within the same range. Specifically, Each item in abs(lhs[i] - rhs[i]) < abs(range/2.0). Empty vectors always return true. The behavior of this function around large values (near double limits) is uncertain. This function is not optimized, do not use for large vectors or loops.

Parameters:
lhsfirst vector
rhssecond vector
full_range
Returns:
true set are similar (same members, same order)

Definition at line 45 of file utils.cpp.

bool industrial_robot_client::utils::isWithinRange ( const std::vector< std::string > &  keys,
const std::map< std::string, double > &  lhs,
const std::map< std::string, double > &  rhs,
double  full_range 
)

Map version of.

See also:
isWithinRange
Parameters:
keysvector of key values
lhsfirst map
rhssecond map
full_range
Returns:
true if values are within range

Definition at line 129 of file utils.cpp.

bool industrial_robot_client::utils::isWithinRange ( const std::vector< std::string > &  lhs_keys,
const std::vector< double > &  lhs_values,
const std::vector< std::string > &  rhs_keys,
const std::vector< double > &  rhs_values,
double  full_range 
)

Key/Values vector version of.

See also:
isWithinRange
Parameters:
lhs_keysvector of lhs keys
lhs_valuesvector of lhs_values
rhs_keysvector of rhs keys
rhs_valuesvector of rhs_values
full_range
Returns:
true values within range

Definition at line 162 of file utils.cpp.

bool industrial_robot_client::utils::mapInsert ( const std::string &  key,
double  value,
std::map< std::string, double > &  mappings 
)

Convenience function for inserting a value into an std::map, assuming a string key and a double value.

Parameters:
key
value
map
Returns:
true if insertion successful (or if key already exists)

Definition at line 75 of file utils.cpp.

bool industrial_robot_client::utils::toMap ( const std::vector< std::string > &  keys,
const std::vector< double > &  values,
std::map< std::string, double > &  mappings 
)

Convenience function for taking two separate key,value vectors and creating the more convenient map. This is helpful for some ROS message types where maps are defined as two separate vectors (ROS messages do not support maps).

Parameters:
keysvector of key values
valuesvector of values
mappingsof key values.
Returns:
true if conversion successful

Definition at line 97 of file utils.cpp.



industrial_robot_client
Author(s): Jeremy Zoss
autogenerated on Sat Jun 8 2019 20:43:29