diff --git a/conman/CMakeLists.txt b/conman/CMakeLists.txt index 3ab5281..26377bf 100644 --- a/conman/CMakeLists.txt +++ b/conman/CMakeLists.txt @@ -56,11 +56,7 @@ orocos_generate_package( ############# ## Mark cpp header files for installation -install(DIRECTORY include/${PROJECT_NAME}/ - DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} - FILES_MATCHING PATTERN "*.h" - PATTERN ".svn" EXCLUDE - ) +orocos_install_headers(DIRECTORY include/${PROJECT_NAME}/) ############# ## Testing ## diff --git a/conman/include/conman/scheme.h b/conman/include/conman/scheme.h index 4048b08..abf819a 100644 --- a/conman/include/conman/scheme.h +++ b/conman/include/conman/scheme.h @@ -177,6 +177,10 @@ namespace conman */ //\{ + //! Properties + std::string scheme_name_; + + //! Add/Remove a latch between two blocks (or two groups of blocks) by name bool latchConnections( const std::string &source_name, diff --git a/conman/src/scheme.cpp b/conman/src/scheme.cpp index c9ca3e2..c38a771 100644 --- a/conman/src/scheme.cpp +++ b/conman/src/scheme.cpp @@ -28,7 +28,7 @@ using namespace conman; Scheme::Scheme(std::string name) - : RTT::TaskContext(name) + : RTT::TaskContext(name), scheme_name_("") { // Modifying blocks in the scheme this->addOperation("hasBlock", &Scheme::hasBlock, this, RTT::OwnThread) @@ -66,6 +66,9 @@ Scheme::Scheme(std::string name) this->addOperation("latchOutputs", (bool (Scheme::*)(const std::string&, const bool))&Scheme::latchOutputs, this, RTT::OwnThread) .doc("Latch all the outputs to a given component."); + // Add properties + this->addProperty("scheme_name", scheme_name_).doc("Scheme Name"); + // Execution introspection this->addOperation("executable", &Scheme::executable, this, RTT::OwnThread) .doc("Returns true if the graph can be executed with the current latches."); diff --git a/conman_examples/package.xml b/conman_examples/package.xml index 9d93881..bece8c6 100644 --- a/conman_examples/package.xml +++ b/conman_examples/package.xml @@ -46,6 +46,8 @@ conman_ros conman roscpp + rtt_ros + rtt_roscomm diff --git a/conman_ros/CMakeLists.txt b/conman_ros/CMakeLists.txt index 9c0c259..508207d 100644 --- a/conman_ros/CMakeLists.txt +++ b/conman_ros/CMakeLists.txt @@ -8,7 +8,6 @@ find_package(catkin REQUIRED COMPONENTS find_package(OROCOS-RTT REQUIRED) find_package(Eigen REQUIRED) - include(${OROCOS-RTT_USE_FILE_PATH}/UseOROCOS-RTT.cmake ) # Generate ROS messages @@ -26,6 +25,8 @@ add_definitions(-DRTT_COMPONENT) orocos_use_package(conman) orocos_use_package(rtt_roscomm) +orocos_use_package(ocl-taskbrowser) +orocos_use_package(ocl-deployment) include_directories( ${catkin_INCLUDE_DIRS} diff --git a/conman_ros/src/ros_interface_service.cpp b/conman_ros/src/ros_interface_service.cpp index 43c22e3..5a3f90d 100644 --- a/conman_ros/src/ros_interface_service.cpp +++ b/conman_ros/src/ros_interface_service.cpp @@ -52,33 +52,40 @@ ROSInterfaceService::ROSInterfaceService(RTT::TaskContext* owner) : roscontrol->addOperation("switchController", &ROSInterfaceService::switchControllerCB, this); roscontrol->addOperation("unloadController", &ROSInterfaceService::unloadControllerCB, this); + std::string controller_name_; + if (scheme->scheme_name_.empty()) { + controller_name_ = "controller_manager"; + } else { + controller_name_ = scheme->scheme_name_; + } + // Load the rosservice service RTT::log(RTT::Debug) << "Getting rtt_roscomm service service..." << RTT::endlog(); rosservice = owner->getProvider("rosservice"); RTT::log(RTT::Debug) << "Connecting ros_control service servers..." << RTT::endlog(); rosservice->connect("roscontrol.listControllerTypes", - "controller_manager/list_controller_types", + controller_name_ + "/list_controller_types", "controller_manager_msgs/ListControllerTypes"); rosservice->connect("roscontrol.listControllers", - "controller_manager/list_controllers", + controller_name_ + "/list_controllers", "controller_manager_msgs/ListControllers"); rosservice->connect("roscontrol.loadController", - "controller_manager/load_controller", + controller_name_ + "/load_controller", "controller_manager_msgs/LoadController"); rosservice->connect("roscontrol.reloadControllerLibraries", - "controller_manager/reload_controller_libraries", + controller_name_ + "/reload_controller_libraries", "controller_manager_msgs/ReloadControllerLibraries"); rosservice->connect("roscontrol.switchController", - "controller_manager/switch_controller", + controller_name_ + "/switch_controller", "controller_manager_msgs/SwitchController"); rosservice->connect("roscontrol.unloadController", - "controller_manager/unload_controller", + controller_name_ + "/unload_controller", "controller_manager_msgs/UnloadController"); // Actions diff --git a/rqt_conman/CMakeLists.txt b/rqt_conman/CMakeLists.txt index f2b1709..848a634 100644 --- a/rqt_conman/CMakeLists.txt +++ b/rqt_conman/CMakeLists.txt @@ -149,6 +149,10 @@ include_directories( # DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} # ) +install(PROGRAMS plugin.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) + ############# ## Testing ## #############