Skip to content

Commit

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

* profiler submodule, remove commented code

* Remove changes in profiler header

Follows from https://github.com/ros-planning/moveit2/pull/9/files/4409ce2308e7c947c9c09c8468c79ea9b98a4176#r260450153

* Fix logging, adapt to master

* profiler, use RCUTILS_LOG_INFO directly

* profiler, clang format
  • Loading branch information
Víctor Mayoral Vilches authored and henningkayser committed Mar 18, 2019
1 parent a915649 commit daf8aaf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions moveit_core/profiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ set(MOVEIT_LIB_NAME moveit_profiler)
add_library(${MOVEIT_LIB_NAME} src/profiler.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)
9 changes: 5 additions & 4 deletions moveit_core/profiler/include/moveit/profiler/profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#include <boost/thread.hpp>
#include <boost/noncopyable.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <rcutils/logging_macros.h>

namespace moveit
{
Expand Down Expand Up @@ -311,8 +312,8 @@ class Profiler : private boost::noncopyable
bool running_;
bool printOnDestroy_;
};
}
}
} // namespace tools
} // namespace moveit

#else

Expand Down Expand Up @@ -444,8 +445,8 @@ class Profiler
return false;
}
};
}
}
} // namespace tools
} // namespace moveit

#endif

Expand Down
5 changes: 2 additions & 3 deletions moveit_core/profiler/src/profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include "moveit/profiler/profiler.h"
#if MOVEIT_ENABLE_PROFILING

#include <ros/console.h>
#include <vector>
#include <algorithm>
#include <sstream>
Expand Down Expand Up @@ -121,7 +120,7 @@ inline double to_seconds(const boost::posix_time::time_duration& d)
{
return (double)d.total_microseconds() / 1000000.0;
}
}
} // namespace

void Profiler::status(std::ostream& out, bool merge)
{
Expand Down Expand Up @@ -175,7 +174,7 @@ void Profiler::console()
std::stringstream ss;
ss << std::endl;
status(ss, true);
ROS_INFO_STREAM_NAMED("profiler", ss.str());
RCUTILS_LOG_INFO("profiler", ss.str().c_str());
}

/// @cond IGNORE
Expand Down

0 comments on commit daf8aaf

Please sign in to comment.