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

Background_processing module #55

Merged
merged 3 commits into from
Apr 11, 2019
Merged
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
13 changes: 9 additions & 4 deletions moveit_core/background_processing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ set(MOVEIT_LIB_NAME moveit_background_processing)
add_library(${MOVEIT_LIB_NAME} src/background_processing.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}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)

install(DIRECTORY include/ DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION})
install(DIRECTORY include/ DESTINATION include)
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class BackgroundProcessing : private boost::noncopyable

void processingThread();
};
}
}
} // namespace tools
} // namespace moveit

#endif
14 changes: 8 additions & 6 deletions moveit_core/background_processing/src/background_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@
/* Author: Ioan Sucan */

#include <moveit/background_processing/background_processing.h>
#include <ros/console.h>
#include "rclcpp/rclcpp.hpp"

namespace moveit
{
namespace tools
{
// Logger
rclcpp::Logger LOGGER = rclcpp::get_logger("background_processing");
henningkayser marked this conversation as resolved.
Show resolved Hide resolved

BackgroundProcessing::BackgroundProcessing()
{
// spin a thread that will process user events
Expand Down Expand Up @@ -77,14 +80,13 @@ void BackgroundProcessing::processingThread()
action_lock_.unlock();
try
{
ROS_DEBUG_NAMED("background_processing", "Begin executing '%s'", action_name.c_str());
RCLCPP_DEBUG(LOGGER, "Begin executing '%s'", action_name.c_str());
fn();
ROS_DEBUG_NAMED("background_processing", "Done executing '%s'", action_name.c_str());
RCLCPP_DEBUG(LOGGER, "Done executing '%s'", action_name.c_str());
}
catch (std::exception& ex)
{
ROS_ERROR_NAMED("background_processing", "Exception caught while processing action '%s': %s",
action_name.c_str(), ex.what());
RCLCPP_ERROR(LOGGER, "Exception caught while processing action '%s': %s", action_name.c_str(), ex.what());
}
processing_ = false;
if (queue_change_event_)
Expand Down Expand Up @@ -139,4 +141,4 @@ void BackgroundProcessing::clearJobUpdateEvent()
}

} // end of namespace tools
} // end of namespace moveit
} // end of namespace moveit