(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Debug Modes in the Ecl

Description: Toggling debug/ndebug mode for the ecl.

Keywords: ecl debug

Tutorial Level: BEGINNER

Next Tutorial: Error Handling

Debug Mode

To compile in debug mode, do not define either NDEBUG or ECL_NDEBUG. e.g.

g++ -lecl_devices -o hello hello.cpp

This will enable alot of error handling within ecl components themselves. For example ecl_containers will do alot of range checking, ecl_devices will test for errors on every read/write.

Release Mode

Define either NDEBUG or ECL_NDEBUG. e.g.

g++ -DNDEBUG -lecl_devices -o hello hello.cpp

This will disable alot of the aforementioned error handling - especially those inside fast control blocks. If you want to do error handling in these blocks, check the return values for each function manually.

Inside Ros

In ros, the NDEBUG macro is automatically added by the cmake build system when choosing to build in Release mode.

Wiki: ecl_errors/Tutorials/Debug Modes in the Ecl (last edited 2012-01-17 01:48:26 by DanielStonier)