Revision 708960ff src/server/middleware_ros.cpp
src/server/middleware_ros.cpp | ||
---|---|---|
38 | 38 |
: Middleware(scope, c){ |
39 | 39 |
|
40 | 40 |
printf("> using ROS middleware\n"); |
41 |
|
|
41 | 42 |
//start ros core? |
42 | 43 |
if (ros::isInitialized()){ |
43 | 44 |
//oh another process is doing ros comm, fine, we do not need to call it |
44 | 45 |
tick_necessary = false; |
45 | 46 |
}else{ |
46 | 47 |
//we have to take care of ros |
47 |
printf("> no active ros middleware, calling ros::init() and we will call tick() periodically!"); |
|
48 |
printf("> no active ros middleware, calling ros::init() and we will call tick() periodically!\n");
|
|
48 | 49 |
string node_name = "humotion_server__"+ scope; |
49 |
node_name.erase(std::remove(node_name.begin(), node_name.end(), '/'), node_name.end());
|
|
50 |
node_name.erase(std::remove(node_name.begin(), node_name.end(), '/'), node_name.end());
|
|
50 | 51 |
printf("> registering on ROS as node %s\n",node_name.c_str()); |
51 | 52 |
ros::M_string no_remapping; |
52 | 53 |
ros::init(no_remapping, node_name); |
Also available in: Unified diff