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

Print a collision summary to status of failed contact check #543

Open
wants to merge 5 commits 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
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,18 @@ ContinuousContactCheckTask::runImpl(TaskComposerContext& context, OptionalTaskCo
if (contactCheckProgram(contacts, *manager, *state_solver, ci, cur_composite_profile->config))
{
info->status_code = 0;
info->status_message = "Results are not contact free for process input: " + ci.getDescription();
std::stringstream ss;
ss << "Results are not contact free for process input: " << ci.getDescription() << "\n";
// Iterate over each contact and add collision summary if not empty
for (std::size_t i = 0; i < contacts.size(); ++i)
{
const auto& contact_map = contacts[i];
if (!contact_map.empty())
{
ss << contact_map.getSummary() << "\n";
}
}
Comment on lines +168 to +173
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could see this blowing up. Should we just print the first contact summary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way I have it, it's up to the user how much is printed. If they have contact check set to FIRST then they'll only get one. If it is set to ALL then they'll potentially get a long novel printed out, which is maybe useful for them.

info->status_message = ss.str();
CONSOLE_BRIDGE_logInform("%s", info->status_message.c_str());

// Save space
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,18 @@ std::unique_ptr<TaskComposerNodeInfo> DiscreteContactCheckTask::runImpl(TaskComp
std::vector<tesseract_collision::ContactResultMap> contacts;
if (contactCheckProgram(contacts, *manager, *state_solver, ci, cur_composite_profile->config))
{
info->status_message = "Results are not contact free for process input: " + ci.getDescription();
std::stringstream ss;
ss << "Results are not contact free for process input: " << ci.getDescription() << "\n";
// Iterate over each contact and add collision summary if not empty
for (std::size_t i = 0; i < contacts.size(); ++i)
{
const auto& contact_map = contacts[i];
if (!contact_map.empty())
{
ss << contact_map.getSummary() << "\n";
}
}
info->status_message = ss.str();
CONSOLE_BRIDGE_logInform("%s", info->status_message.c_str());

// Save space
Expand Down
Loading