Classes | |
class | GenericGridPublisher |
An interface for publishing NavGridOfX/OccupancyGrid msgs and their updates periodically. More... | |
class | GenericNavGridSubscriber |
class | NavGridPublisher |
An interface for publishing NavGridOfChars/OccupancyGrid msgs and their updates periodically. More... | |
class | ScaleGridPublisher |
An interface for publishing NavGridOfDoubles/OccupancyGrid msgs and their updates periodically. More... | |
Typedefs | |
using | NavGridOfDoublesSubscriber = GenericNavGridSubscriber< double, nav_2d_msgs::NavGridOfDoubles, nav_2d_msgs::NavGridOfDoublesUpdate > |
using | NavGridSubscriber = GenericNavGridSubscriber< unsigned char, nav_2d_msgs::NavGridOfChars, nav_2d_msgs::NavGridOfCharsUpdate > |
Functions | |
template<typename IntegralType > | |
void | applyInterpretation (nav_grid::NavGrid< IntegralType > &grid, const std::vector< IntegralType > &cost_interpretation_table) |
Apply a given interpretation to the provided nav grid. More... | |
template<typename ROSMsgType , typename NumericType > | |
void | fromMsg (const ROSMsgType &msg, nav_grid::NavGrid< NumericType > &grid) |
Generic conversion from message of arbitrary type to grid of arbitrary type. More... | |
template<typename NumericType > | |
void | fromOccupancyGrid (const nav_msgs::OccupancyGrid &msg, nav_grid::NavGrid< NumericType > &grid, const std::vector< NumericType > &cost_interpretation_table) |
generic OccupancyGrid to NavGrid conversion using cost_interpretation_table More... | |
template<typename NumericType > | |
nav_core2::UIntBounds | fromOccupancyGridUpdate (const map_msgs::OccupancyGridUpdate &update, nav_grid::NavGrid< NumericType > &grid, const std::vector< NumericType > &cost_interpretation_table) |
generic OccupancyGridUpdate to NavGrid conversion using cost_interpretation_table. More... | |
template<typename ROSMsgType , typename NumericType > | |
nav_core2::UIntBounds | fromUpdate (const ROSMsgType &update, nav_grid::NavGrid< NumericType > &grid) |
Generic conversion from an update message to a portion of a grid of arbitrary type. More... | |
template<typename NumericType > | |
void | getExtremeValues (const nav_grid::NavGrid< NumericType > &grid, const NumericType unknown_value, NumericType &min_val, NumericType &max_val) |
Retrieve the minimum and maximum values from a grid, ignoring the unknown_value. More... | |
std::vector< unsigned char > | getOccupancyInput (bool trinary=false, bool use_unknown_value=false) |
Above 100 is occupied, -1 is sometimes unknown, and otherwise it is either scaled or freespace. More... | |
std::vector< unsigned char > | grayScaleInterpretation (const double free_threshold, const double occupied_threshold) |
Above occupied_threshold is occupied, below free_threshold is free, and the middle is in between. More... | |
template<typename NumericType , typename IntegralType > | |
NumericType | interpretCost (IntegralType original_value, const std::vector< NumericType > &cost_interpretation_table) |
return cost_interpretation_table[original_value] (or original_value if not a valid index) More... | |
template<typename NumericType > | |
unsigned char | interpretValue (const NumericType value, const NumericType min_value, const NumericType denominator, const NumericType unknown_value) |
Scale the given value to fit within [0, 100] (unless its ignore_value, then its -1) More... | |
geometry_msgs::Point32 | makePoint (const nav_grid::NavGridInfo &info, int x, int y) |
std::vector< unsigned char > | pixelColoringInterpretation (const double free_threshold, const double occupied_threshold) |
Above occupied_threshold is occupied, below free_threshold is free, and the middle gray is unknown. More... | |
static std::vector< unsigned char > | RAW (0) |
Every value is untouched. More... | |
template<typename ROSMsgType , typename NumericType > | |
ROSMsgType | toMsg (const nav_grid::NavGrid< NumericType > &grid, const ros::Time &stamp) |
Utilities for converting NavGrid objects to NavGridOfX messages and updates. More... | |
nav_2d_msgs::NavGridOfChars | toMsg (const nav_grid::NavGrid< unsigned char > &grid, const ros::Time &stamp=ros::Time(0)) |
NavGrid<unsigned char> to NavGridOfChars. More... | |
nav_2d_msgs::NavGridOfDoubles | toMsg (const nav_grid::NavGrid< double > &grid, const ros::Time &stamp=ros::Time(0)) |
NavGrid<double> to NavGridOfDoubles. More... | |
nav_2d_msgs::NavGridOfDoubles | toMsg (const nav_grid::NavGrid< float > &grid, const ros::Time &stamp=ros::Time(0)) |
NavGrid<float> to NavGridOfDoubles. More... | |
nav_msgs::OccupancyGrid | toOccupancyGrid (const nav_grid::NavGrid< unsigned char > &grid, const ros::Time &stamp=ros::Time(0), const std::vector< unsigned char > cost_interpretation_table=std::vector< unsigned char >()) |
NavGrid<unsigned char> to OccupancyGrid using cost_interpretation_table. More... | |
template<typename NumericType > | |
nav_msgs::OccupancyGrid | toOccupancyGrid (const nav_grid::NavGrid< NumericType > &grid, const NumericType min_value, const NumericType max_value, const NumericType unknown_value, const ros::Time &stamp=ros::Time(0)) |
generic NavGrid to OccupancyGrid using scaling. Min and max explicitly provided. More... | |
template<typename NumericType > | |
nav_msgs::OccupancyGrid | toOccupancyGrid (const nav_grid::NavGrid< NumericType > &grid, const NumericType unknown_value=std::numeric_limits< NumericType >::max(), const ros::Time &stamp=ros::Time(0)) |
generic NavGrid to OccupancyGrid using scaling. Min and max not provided, so they are determined first. More... | |
map_msgs::OccupancyGridUpdate | toOccupancyGridUpdate (const nav_grid::NavGrid< unsigned char > &grid, const nav_core2::UIntBounds &bounds, const ros::Time &stamp=ros::Time(0), const std::vector< unsigned char > cost_interpretation_table=std::vector< unsigned char >()) |
NavGrid<unsigned char> to OccupancyGridUpdate using cost_interpretation_table. More... | |
template<typename NumericType > | |
map_msgs::OccupancyGridUpdate | toOccupancyGridUpdate (const nav_grid::NavGrid< NumericType > &grid, const nav_core2::UIntBounds &bounds, const NumericType min_value, const NumericType max_value, const NumericType unknown_value, const ros::Time &stamp=ros::Time(0)) |
generic NavGrid to OccupancyGridUpdate using scaling. Min and max explicitly provided. More... | |
template<typename ROSMsgType , typename NumericType > | |
ROSMsgType | toUpdate (const nav_grid::NavGrid< NumericType > &grid, const nav_core2::UIntBounds &bounds, const ros::Time &stamp) |
Generic conversion from a portion of a grid of arbitrary type to an update message of arbitrary type. More... | |
nav_2d_msgs::NavGridOfCharsUpdate | toUpdate (const nav_grid::NavGrid< unsigned char > &grid, const nav_core2::UIntBounds &bounds, const ros::Time &stamp=ros::Time(0)) |
NavGrid<unsigned char> to NavGridOfCharsUpdate. More... | |
nav_2d_msgs::NavGridOfDoublesUpdate | toUpdate (const nav_grid::NavGrid< double > &grid, const nav_core2::UIntBounds &bounds, const ros::Time &stamp=ros::Time(0)) |
NavGrid<double> to NavGridOfDoublesUpdate. More... | |
nav_2d_msgs::NavGridOfDoublesUpdate | toUpdate (const nav_grid::NavGrid< float > &grid, const nav_core2::UIntBounds &bounds, const ros::Time &stamp=ros::Time(0)) |
NavGrid<float> to NavGridOfDoublesUpdate. More... | |
Variables | |
static std::vector< unsigned char > | NEGATE |
Every value is 255 - i value. More... | |
static std::vector< unsigned char > | OCC_GRID_PUBLISHING |
Scale [0, 255] down to [0, 100] (except for a few special values) More... | |
static std::vector< unsigned char > | SCALE_SAVE |
0 becomes 254 (white), 100 becomes 0 (black) and everything in between is gray More... | |
static std::vector< unsigned char > | TRINARY_SAVE |
0 becomes 254 (white), 100 becomes 0 (black) and everything else is 205 (gray) More... | |
using nav_grid_pub_sub::NavGridOfDoublesSubscriber = typedef GenericNavGridSubscriber<double, nav_2d_msgs::NavGridOfDoubles, nav_2d_msgs::NavGridOfDoublesUpdate> |
Definition at line 161 of file nav_grid_subscriber.h.
using nav_grid_pub_sub::NavGridSubscriber = typedef GenericNavGridSubscriber<unsigned char, nav_2d_msgs::NavGridOfChars, nav_2d_msgs::NavGridOfCharsUpdate> |
Definition at line 158 of file nav_grid_subscriber.h.
|
inline |
Apply a given interpretation to the provided nav grid.
Definition at line 68 of file cost_interpretation.h.
void nav_grid_pub_sub::fromMsg | ( | const ROSMsgType & | msg, |
nav_grid::NavGrid< NumericType > & | grid | ||
) |
Generic conversion from message of arbitrary type to grid of arbitrary type.
Definition at line 103 of file nav_grid_message_utils.h.
void nav_grid_pub_sub::fromOccupancyGrid | ( | const nav_msgs::OccupancyGrid & | msg, |
nav_grid::NavGrid< NumericType > & | grid, | ||
const std::vector< NumericType > & | cost_interpretation_table | ||
) |
generic OccupancyGrid to NavGrid conversion using cost_interpretation_table
Definition at line 207 of file occ_grid_message_utils.h.
nav_core2::UIntBounds nav_grid_pub_sub::fromOccupancyGridUpdate | ( | const map_msgs::OccupancyGridUpdate & | update, |
nav_grid::NavGrid< NumericType > & | grid, | ||
const std::vector< NumericType > & | cost_interpretation_table | ||
) |
generic OccupancyGridUpdate to NavGrid conversion using cost_interpretation_table.
Definition at line 233 of file occ_grid_message_utils.h.
nav_core2::UIntBounds nav_grid_pub_sub::fromUpdate | ( | const ROSMsgType & | update, |
nav_grid::NavGrid< NumericType > & | grid | ||
) |
Generic conversion from an update message to a portion of a grid of arbitrary type.
Definition at line 123 of file nav_grid_message_utils.h.
|
inline |
Retrieve the minimum and maximum values from a grid, ignoring the unknown_value.
Definition at line 138 of file occ_grid_message_utils.h.
std::vector< unsigned char > nav_grid_pub_sub::getOccupancyInput | ( | bool | trinary = false , |
bool | use_unknown_value = false |
||
) |
Above 100 is occupied, -1 is sometimes unknown, and otherwise it is either scaled or freespace.
Expects values from [-1, 100] and outputs [0, 255]
Definition at line 86 of file cost_interpretation_tables.cpp.
std::vector< unsigned char > nav_grid_pub_sub::grayScaleInterpretation | ( | const double | free_threshold, |
const double | occupied_threshold | ||
) |
Above occupied_threshold is occupied, below free_threshold is free, and the middle is in between.
Expects values from [0, 255] and flattens them to [0, 100]
Definition at line 63 of file cost_interpretation_tables.cpp.
|
inline |
return cost_interpretation_table[original_value] (or original_value if not a valid index)
Since original_value is used as the index into the table, it must be an integer-like type (i.e. not double)
Definition at line 50 of file cost_interpretation.h.
|
inline |
Scale the given value to fit within [0, 100] (unless its ignore_value, then its -1)
Note denominator is used instead of max_value to avoid recalculating the difference each time this is called.
value | Value to interpret |
min_value | Minimum value that will correspond to 0 |
denominator | The result of max_value - min_value, where max_value corresponds with 100 |
unknown_value | If the value is equal to this value, return -1 |
Definition at line 88 of file cost_interpretation.h.
|
inline |
Definition at line 54 of file nav_grid_publisher.h.
std::vector< unsigned char > nav_grid_pub_sub::pixelColoringInterpretation | ( | const double | free_threshold, |
const double | occupied_threshold | ||
) |
Above occupied_threshold is occupied, below free_threshold is free, and the middle gray is unknown.
Expects values from [0, 255] and flattens them to 0, 100, and -1
Definition at line 41 of file cost_interpretation_tables.cpp.
|
static |
Every value is untouched.
ROSMsgType nav_grid_pub_sub::toMsg | ( | const nav_grid::NavGrid< NumericType > & | grid, |
const ros::Time & | stamp | ||
) |
Utilities for converting NavGrid objects to NavGridOfX messages and updates.
Generic conversion from grid of arbitrary type to message of arbitrary type
Note that the ROSMsgType must be provided since return types are not used in template type deduction.
Definition at line 59 of file nav_grid_message_utils.h.
|
inline |
NavGrid<unsigned char> to NavGridOfChars.
Definition at line 139 of file nav_grid_message_utils.h.
|
inline |
NavGrid<double> to NavGridOfDoubles.
Definition at line 148 of file nav_grid_message_utils.h.
|
inline |
NavGrid<float> to NavGridOfDoubles.
Definition at line 156 of file nav_grid_message_utils.h.
|
inline |
NavGrid<unsigned char> to OccupancyGrid using cost_interpretation_table.
Definition at line 56 of file occ_grid_message_utils.h.
nav_msgs::OccupancyGrid nav_grid_pub_sub::toOccupancyGrid | ( | const nav_grid::NavGrid< NumericType > & | grid, |
const NumericType | min_value, | ||
const NumericType | max_value, | ||
const NumericType | unknown_value, | ||
const ros::Time & | stamp = ros::Time(0) |
||
) |
generic NavGrid to OccupancyGrid using scaling. Min and max explicitly provided.
NumericType can be inferred, so explicitly specifying it is generally not needed.
Definition at line 108 of file occ_grid_message_utils.h.
nav_msgs::OccupancyGrid nav_grid_pub_sub::toOccupancyGrid | ( | const nav_grid::NavGrid< NumericType > & | grid, |
const NumericType | unknown_value = std::numeric_limits<NumericType>::max() , |
||
const ros::Time & | stamp = ros::Time(0) |
||
) |
generic NavGrid to OccupancyGrid using scaling. Min and max not provided, so they are determined first.
NumericType can be inferred, so explicitly specifying it is generally not needed.
Definition at line 159 of file occ_grid_message_utils.h.
|
inline |
NavGrid<unsigned char> to OccupancyGridUpdate using cost_interpretation_table.
Definition at line 78 of file occ_grid_message_utils.h.
map_msgs::OccupancyGridUpdate nav_grid_pub_sub::toOccupancyGridUpdate | ( | const nav_grid::NavGrid< NumericType > & | grid, |
const nav_core2::UIntBounds & | bounds, | ||
const NumericType | min_value, | ||
const NumericType | max_value, | ||
const NumericType | unknown_value, | ||
const ros::Time & | stamp = ros::Time(0) |
||
) |
generic NavGrid to OccupancyGridUpdate using scaling. Min and max explicitly provided.
NumericType can be inferred, so explicitly specifying it is generally not needed.
Definition at line 174 of file occ_grid_message_utils.h.
ROSMsgType nav_grid_pub_sub::toUpdate | ( | const nav_grid::NavGrid< NumericType > & | grid, |
const nav_core2::UIntBounds & | bounds, | ||
const ros::Time & | stamp | ||
) |
Generic conversion from a portion of a grid of arbitrary type to an update message of arbitrary type.
Note that the ROSMsgType must be provided since return types are not used in template type deduction.
Definition at line 82 of file nav_grid_message_utils.h.
|
inline |
NavGrid<unsigned char> to NavGridOfCharsUpdate.
Definition at line 164 of file nav_grid_message_utils.h.
|
inline |
NavGrid<double> to NavGridOfDoublesUpdate.
Definition at line 173 of file nav_grid_message_utils.h.
|
inline |
NavGrid<float> to NavGridOfDoublesUpdate.
Definition at line 182 of file nav_grid_message_utils.h.
|
static |
Every value is 255 - i value.
map from [0, 255] to [255, 0]
Definition at line 52 of file cost_interpretation_tables.h.
|
static |
Scale [0, 255] down to [0, 100] (except for a few special values)
Expects values from [0, 255] and flattens them to [-1, 100] There are a few special values that only have one input value mapping to them. 0, 253, 254 and 255 always map to 0, 99, 100, and 255 (and are the only values that do).
Definition at line 97 of file cost_interpretation_tables.h.
|
static |
0 becomes 254 (white), 100 becomes 0 (black) and everything in between is gray
Translates from a trinary occupancy grid to an image pixel color
Definition at line 198 of file cost_interpretation_tables.h.
|
static |
0 becomes 254 (white), 100 becomes 0 (black) and everything else is 205 (gray)
Translates from a trinary occupancy grid to an image pixel color
Definition at line 156 of file cost_interpretation_tables.h.