Skip to content

Commit 907fc7d

Browse files
Fix error and success reporting in examples
1 parent b22ff73 commit 907fc7d

17 files changed

+66
-6
lines changed

tesseract_examples/src/basic_cartesian_example.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ bool BasicCartesianExample::run()
311311
plotter_->plotTrajectory(trajectory, *state_solver);
312312
}
313313

314-
CONSOLE_BRIDGE_logInform("Final trajectory is collision free");
315314
return future->context->isSuccessful();
316315
}
317316

tesseract_examples/src/basic_cartesian_example_node.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <tesseract_examples/basic_cartesian_example.h>
2828
#include <filesystem>
29+
#include <console_bridge/console.h>
2930
#include <tesseract_environment/environment.h>
3031
#include <tesseract_common/resource_locator.h>
3132

@@ -46,5 +47,10 @@ int main(int /*argc*/, char** /*argv*/)
4647

4748
BasicCartesianExample example(env, nullptr, false, true);
4849
if (!example.run())
50+
{
51+
CONSOLE_BRIDGE_logError("BasicCartesianExample failed");
4952
exit(1);
53+
}
54+
55+
CONSOLE_BRIDGE_logInform("BasicCartesianExample successful");
5056
}

tesseract_examples/src/car_seat_example_node.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <tesseract_examples/car_seat_example.h>
2828
#include <filesystem>
29+
#include <console_bridge/console.h>
2930
#include <tesseract_environment/environment.h>
3031
#include <tesseract_common/resource_locator.h>
3132

@@ -46,5 +47,10 @@ int main(int /*argc*/, char** /*argv*/)
4647

4748
CarSeatExample example(env, nullptr, false);
4849
if (!example.run())
50+
{
51+
CONSOLE_BRIDGE_logError("CarSeatExample failed");
4952
exit(1);
53+
}
54+
55+
CONSOLE_BRIDGE_logInform("CarSeatExample successful");
5056
}

tesseract_examples/src/freespace_hybrid_example.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ bool FreespaceHybridExample::run()
246246
plotter_->plotTrajectory(trajectory, *state_solver);
247247
}
248248

249-
CONSOLE_BRIDGE_logInform("Final trajectory is collision free");
250249
return future->context->isSuccessful();
251250
}
252251
} // namespace tesseract_examples

tesseract_examples/src/freespace_hybrid_example_node.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <tesseract_examples/freespace_hybrid_example.h>
2828
#include <filesystem>
29+
#include <console_bridge/console.h>
2930
#include <tesseract_environment/environment.h>
3031
#include <tesseract_common/resource_locator.h>
3132

@@ -46,5 +47,10 @@ int main(int /*argc*/, char** /*argv*/)
4647

4748
FreespaceHybridExample example(env, nullptr);
4849
if (!example.run())
50+
{
51+
CONSOLE_BRIDGE_logError("FreespaceHybridExample failed");
4952
exit(1);
53+
}
54+
55+
CONSOLE_BRIDGE_logInform("FreespaceHybridExample successful");
5056
}

tesseract_examples/src/freespace_ompl_example.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ bool FreespaceOMPLExample::run()
218218
plotter_->plotTrajectory(trajectory, *state_solver);
219219
}
220220

221-
CONSOLE_BRIDGE_logInform("Final trajectory is collision free");
222221
return future->context->isSuccessful();
223222
}
224223
} // namespace tesseract_examples

tesseract_examples/src/freespace_ompl_example_node.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <tesseract_examples/freespace_ompl_example.h>
2828
#include <filesystem>
29+
#include <console_bridge/console.h>
2930
#include <tesseract_environment/environment.h>
3031
#include <tesseract_common/resource_locator.h>
3132

@@ -46,5 +47,10 @@ int main(int /*argc*/, char** /*argv*/)
4647

4748
FreespaceOMPLExample example(env, nullptr);
4849
if (!example.run())
50+
{
51+
CONSOLE_BRIDGE_logError("FreespaceOMPLExample failed");
4952
exit(1);
53+
}
54+
55+
CONSOLE_BRIDGE_logInform("FreespaceOMPLExample successful");
5056
}

tesseract_examples/src/glass_upright_example.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ bool GlassUprightExample::run()
298298
plotter_->plotTrajectory(trajectory, *state_solver);
299299
}
300300

301-
CONSOLE_BRIDGE_logInform("Final trajectory is collision free");
302301
return future->context->isSuccessful();
303302
}
304303
} // namespace tesseract_examples

tesseract_examples/src/glass_upright_example_node.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <tesseract_examples/glass_upright_example.h>
2828
#include <filesystem>
29+
#include <console_bridge/console.h>
2930
#include <tesseract_environment/environment.h>
3031
#include <tesseract_common/resource_locator.h>
3132

@@ -46,5 +47,10 @@ int main(int /*argc*/, char** /*argv*/)
4647

4748
GlassUprightExample example(env, nullptr);
4849
if (!example.run())
50+
{
51+
CONSOLE_BRIDGE_logError("GlassUprightExample failed");
4952
exit(1);
53+
}
54+
55+
CONSOLE_BRIDGE_logInform("GlassUprightExample successful");
5056
}

tesseract_examples/src/glass_upright_ompl_example_node.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <tesseract_examples/glass_upright_ompl_example.h>
2828
#include <filesystem>
29+
#include <console_bridge/console.h>
2930
#include <tesseract_environment/environment.h>
3031
#include <tesseract_common/resource_locator.h>
3132

@@ -46,5 +47,10 @@ int main(int argc, char** argv)
4647

4748
GlassUprightOMPLExample example(env, nullptr);
4849
if (!example.run())
50+
{
51+
CONSOLE_BRIDGE_logError("GlassUprightOMPLExample failed");
4952
exit(1);
53+
}
54+
55+
CONSOLE_BRIDGE_logInform("GlassUprightOMPLExample successful");
5056
}

0 commit comments

Comments
 (0)