Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce points_reached to ReachResultSummary #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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