janus_host = required_param('/lg_mirror/janus_stream_host', str) janus_port = required_param('~janus_port', int) device = rospy.get_param('~device', '/dev/capture_cam') width = int(rospy.get_param('~width')) height = int(rospy.get_param('~height')) framerate = int(rospy.get_param('~framerate')) max_quantizer = int(rospy.get_param('~max_quantizer', 60)) target_bitrate = int(rospy.get_param('~target_bitrate', 768000)) flip = rospy.get_param('~flip', False) in ['true', 'True', 't', 'yes', 'flipped', True] capture = CaptureWebcam( janus_host, janus_port, device, width, height, framerate, max_quantizer, target_bitrate, flip, ) capture.start_capture() rospy.spin() if __name__ == '__main__': run_with_influx_exception_handler(main, NODE_NAME)
CLEAR_BUTTON = 2 NODE_NAME = 'rfreceiver_kill_browser' class RfreceiverAction: def __init__(self): rospy.init_node(NODE_NAME) self.clear_button_message = rospy.get_param('~clear_button_message', 2) self.fallback_mode = rospy.get_param('~fallback_mode', 'tactile') self.reset_command = rospy.get_param('~reset_command', 'pkill chrome') def handle_button_msg(self, msg): if msg.data == self.clear_button_message: subprocess.call( ['/home/lg/bin/lg-run-bg', self.reset_command], stdout=DEVNULL, stderr=DEVNULL ) def main(self): buttondown_pub = rospy.Subscriber( '/rfreceiver/buttondown', Byte, self.handle_button_msg ) rospy.spin() if __name__ == '__main__': run_with_influx_exception_handler(RfreceiverAction().main, NODE_NAME)
self.set_header('Access-Control-Allow-Origin', '*') def compute_etag(self): return None def main(): rospy.init_node(NODE_NAME) port = rospy.get_param('~port', 8008) rospack = rospkg.RosPack() pkg_path = rospack.get_path('lg_common') share_path = os.path.abspath(os.path.join(pkg_path, os.pardir)) rospy.loginfo('Serving files from {} on port {}'.format(share_path, port)) handler = DevStaticHandler dev_webserver = tornado.web.Application([ (r'/(.*)', handler, {'path': share_path}), ]) dev_webserver.listen(port) ioloop = tornado.ioloop.IOLoop.instance() rospy.on_shutdown(ioloop.stop) ioloop.start() if __name__ == '__main__': run_with_influx_exception_handler(main, NODE_NAME)
password = rospy.get_param('~password', None) suppress_spacenav = rospy.get_param('~suppress_spacenav', True) locked = rospy.get_param('~locked', False) statePublisher = rospy.Publisher('/lg_lock/locked', State, queue_size=1, latch=True) if not password: rospy.logerr('No or blank password provided, exiting...') print "No or blank password provided, exiting..." return suppressProxy = rospy.ServiceProxy('/spacenav_wrapper/suppress', SetBool) def onChange(state): if suppress_spacenav: rospy.loginfo("Suppress spacenav: {}".format(state)) suppressProxy(state) service = LockerService(statePublisher, password, locked, onChange) rospy.Service('/lg_lock/is_locked', IsLocked, service.get_state) rospy.Service('/lg_lock/lock', Lock, service.lock) rospy.Service('/lg_lock/unlock', UnLock, service.unlock) rospy.spin() if __name__ == "__main__": run_with_influx_exception_handler(init, NODE_NAME)