Skip to content

Commit 3cc2be5

Browse files
committed
address review comments
1 parent c874f5d commit 3cc2be5

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

hydra_ros/include/hydra_ros/frontend/traversability_visualizer.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,29 @@ namespace hydra {
4848
class TraversabilityVisualizer : public places::TraversabilityPlaceExtractor::Sink {
4949
public:
5050
struct Config {
51+
//! Namespace to use for the visualizer node.
5152
std::string ns = "~/traversability";
53+
//! Colormap to use for traversability values.
5254
visualizer::RangeColormap::Config traversability_colormap{
5355
createSpectrumColormap({spark_dsg::Color::red(),
5456
spark_dsg::Color::yellow(),
5557
spark_dsg::Color::green()})};
58+
//! Colormap to use for confidence values.
5659
visualizer::RangeColormap::Config confidence_colormap{
5760
createSpectrumColormap({spark_dsg::Color::black(),
5861
spark_dsg::Color::blue(),
5962
spark_dsg::Color::cyan()})};
63+
//! Colors to use for the different traversability states (unknown, traversable,
64+
//! intraversable, traversed).
6065
std::vector<spark_dsg::Color> state_colors{spark_dsg::Color::black(),
6166
spark_dsg::Color::blue(),
6267
spark_dsg::Color::red(),
6368
spark_dsg::Color::green()};
64-
float slice_height = 2.0f; // Height of the slice to visualize in meteres.
65-
bool use_relative_height = false;
69+
//! Height where the slice is visualized [m].
70+
float drawing_offset_z = 0.0f;
71+
//! True: Use height relative to the robot, false: use absolute height.
72+
bool use_relative_offset = true;
73+
//! Alpha value to use for the voxel colors.
6674
double alpha = 0.3;
6775
};
6876

hydra_ros/src/frontend/traversability_visualizer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ void declare_config(TraversabilityVisualizer::Config& config) {
6060
field(config.traversability_colormap, "traversability_colormap");
6161
field(config.confidence_colormap, "confidence_colormap");
6262
field(config.state_colors, "state_colors");
63-
field(config.slice_height, "slice_height", "m");
64-
field(config.use_relative_height, "use_relative_height");
63+
field(config.drawing_offset_z, "drawing_offset_z", "m");
64+
field(config.use_relative_offset, "use_relative_offset");
6565
check(config.state_colors.size(), EQ, 4, "state_colors");
6666
}
6767

@@ -128,8 +128,8 @@ void TraversabilityVisualizer::visualizeLayer(
128128
visualization_msgs::msg::Marker msg4 = msg;
129129
msg4.ns = "debug";
130130

131-
auto height = active_config_.slice_height;
132-
if (active_config_.use_relative_height) {
131+
auto height = active_config_.drawing_offset_z;
132+
if (active_config_.use_relative_offset) {
133133
height += world_t_body.z();
134134
}
135135
geometry_msgs::msg::Point pos;

0 commit comments

Comments
 (0)