Skip to content
6 changes: 1 addition & 5 deletions conman/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##
Expand Down
4 changes: 4 additions & 0 deletions conman/include/conman/scheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 4 additions & 1 deletion conman/src/scheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.");
Expand Down
2 changes: 2 additions & 0 deletions conman_examples/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
<build_depend>conman_ros</build_depend>
<run_depend>conman</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>rtt_ros</run_depend>
<run_depend>rtt_roscomm</run_depend>


<!-- The export tag contains other, unspecified, tags -->
Expand Down
3 changes: 2 additions & 1 deletion conman_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand Down
19 changes: 13 additions & 6 deletions conman_ros/src/ros_interface_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<rtt_rosservice::ROSService>("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
Expand Down
4 changes: 4 additions & 0 deletions rqt_conman/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ include_directories(
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )

install(PROGRAMS plugin.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

#############
## Testing ##
#############
Expand Down