Skip to content

Commit

Permalink
Introduce points_reached to ReachResultSummary & implement at calcula…
Browse files Browse the repository at this point in the history
…teResults
  • Loading branch information
Danilrivero committed Jan 13, 2025
1 parent 880afae commit 479611d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/reach/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ class ReachRecord
class ReachResultSummary
{
public:
/** @brief The number of target poses that were reachable */
float points_reached = 0.0f;

/**
* @brief The total pose score for all reachable points
* @details This score is generally only significant relative to the score of a different reach study using the same
Expand All @@ -96,6 +99,7 @@ class ReachResultSummary
{
std::stringstream ss;
ss << "------------------------------------------------\n";
ss << "Points Reached = " << points_reached << "\n";
ss << "Percent Reached = " << reach_percentage << "\n";
ss << "Total points score = " << total_pose_score << "\n";
ss << "Normalized total points score = " << norm_total_pose_score << "\n";
Expand Down
1 change: 1 addition & 0 deletions src/python/python_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ BOOST_PYTHON_MODULE(MODULE_NAME)
.def("computeHeatMapColors", &ReachDatabase::computeHeatMapColors);

bp::class_<ReachResultSummary>("ReachResultSummary")
.def_readonly("reached_points", &ReachResultSummary::points_reached)
.def_readonly("total_pose_score", &ReachResultSummary::total_pose_score)
.def_readonly("norm_total_pose_score", &ReachResultSummary::norm_total_pose_score)
.def_readonly("reach_percentage", &ReachResultSummary::reach_percentage)
Expand Down
1 change: 1 addition & 0 deletions src/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ ReachResultSummary calculateResults(const ReachResult& db)
const float pct_success = static_cast<float>(success) / static_cast<float>(total);

ReachResultSummary results;
results.points_reached = success;
results.reach_percentage = 100.0f * pct_success;
results.total_pose_score = score;
results.norm_total_pose_score = score / pct_success;
Expand Down

0 comments on commit 479611d

Please sign in to comment.