Revision ba6302b1 client/python/hlrc_client/RobotController.py
| client/python/hlrc_client/RobotController.py | ||
|---|---|---|
| 26 | 26 |
""" |
| 27 | 27 |
|
| 28 | 28 |
import logging |
| 29 |
from MiddlewareRSB import * |
|
| 29 |
try: |
|
| 30 |
import rsb |
|
| 31 |
except ImportError: |
|
| 32 |
RSB_SUPPORT = False |
|
| 33 |
else: |
|
| 34 |
from MiddlewareRSB import * |
|
| 35 |
RSB_SUPPORT = True |
|
| 36 |
|
|
| 30 | 37 |
from MiddlewareROS import * |
| 38 |
import sys |
|
| 31 | 39 |
|
| 32 | 40 |
class RobotController: |
| 33 | 41 |
def __init__(self, mw_name, scope, loglevel=logging.WARNING): |
| ... | ... | |
| 50 | 58 |
|
| 51 | 59 |
|
| 52 | 60 |
if (self.mw.upper() == "RSB"): |
| 53 |
self.logger.info("creating new middleware connection via RSB")
|
|
| 54 |
self.middleware = MiddlewareRSB(self.scope, self.loglevel) |
|
| 61 |
if (not RSB_SUPPORT): |
|
| 62 |
self.logger.error("ERROR: no RSB support detected")
|
|
| 63 |
sys.exit(errno.EINVAL) |
|
| 64 |
else: |
|
| 65 |
self.logger.info("creating new middleware connection via RSB")
|
|
| 66 |
self.middleware = MiddlewareRSB(self.scope, self.loglevel) |
|
| 55 | 67 |
elif (self.mw.upper() == "ROS"): |
| 56 | 68 |
self.logger.info("creating new middleware connection via ROS")
|
| 57 | 69 |
self.middleware = MiddlewareROS(self.scope, self.loglevel) |
Also available in: Unified diff