Skip to content

Commit

Permalink
Port exceptions submodule of moveit_core (#7)
Browse files Browse the repository at this point in the history
* Port exceptions submodule of moveit_core

* Remove dead code

* Reverting change

As required by https://github.com/ros-planning/moveit2/pull/7/files/eaa7cf2273745737d3c27b011a240d40b78c74ca#r259640729

* Exceptions submodule, fix logging

Follows from #21

* Address error log concerns

Follows from #7 (review)
  • Loading branch information
Víctor Mayoral Vilches authored and henningkayser committed Mar 14, 2019
1 parent 8dddba4 commit 8a08637
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
8 changes: 4 additions & 4 deletions moveit_core/exceptions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ set(MOVEIT_LIB_NAME moveit_exceptions)
add_library(${MOVEIT_LIB_NAME} src/exceptions.cpp)
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")

target_link_libraries(${MOVEIT_LIB_NAME} ${catkin_LIBRARIES} ${urdfdom_LIBRARIES} ${urdfdom_headers_LIBRARIES} ${Boost_LIBRARIES})
target_link_libraries(${MOVEIT_LIB_NAME} ${rclcpp_LIBRARIES} ${rmw_implementation_LIBRARIES} ${urdfdom_LIBRARIES} ${urdfdom_headers_LIBRARIES} ${Boost_LIBRARIES})

install(TARGETS ${MOVEIT_LIB_NAME}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
install(DIRECTORY include/ DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION})
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
install(DIRECTORY include/ DESTINATION include)
10 changes: 7 additions & 3 deletions moveit_core/exceptions/src/exceptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,18 @@
/* Author: Acorn Pooley, Ioan Sucan */

#include <moveit/exceptions/exceptions.h>
#include <ros/console.h>
#include <rcutils/logging_macros.h>
#include "rclcpp/rclcpp.hpp"

// Logger
rclcpp::Logger logger_exceptions = rclcpp::get_logger("exceptions");

moveit::ConstructException::ConstructException(const std::string& what_arg) : std::runtime_error(what_arg)
{
ROS_ERROR_NAMED("exceptions", "Error during construction of object: %s\nException thrown.", what_arg.c_str());
RCLCPP_ERROR(logger_exceptions, "Error during construction of object: %s\nException thrown.", what_arg.c_str());
}

moveit::Exception::Exception(const std::string& what_arg) : std::runtime_error(what_arg)
{
ROS_ERROR_NAMED("exceptions", "%s\nException thrown.", what_arg.c_str());
RCLCPP_ERROR(logger_exceptions, "%s\nException thrown.", what_arg.c_str());
}

0 comments on commit 8a08637

Please sign in to comment.