def setUpClass(cls): cls._robot = nextage_client.NextageClient() cls._robot.init() cls._robot.goInitial(_GOINITIAL_TIME_MIDSPEED) # For older DIO version robot. cls._robot_04 = nextage_client.NextageClient() cls._robot_04.set_hand_version(version=cls._robot_04.HAND_VER_0_4_2) cls._robot_04.init() cls._robot_04.goInitial(_GOINITIAL_TIME_MIDSPEED)
def setUpClass(self): modelfile = '/opt/jsk/etc/HIRONX/model/main.wrl' rtm.nshost = 'nxc100' robotname = "RobotHardware0" self._robot = nextage_client.NextageClient() self._robot.init(robotname=robotname, url=modelfile) self._robot.goInitial(_GOINITIAL_TIME_MIDSPEED)
def init(): global robot if os.path.isfile(FILENAME_ROBOTHOST): f = open(FILENAME_ROBOTHOST, 'r') data = f.readline().strip().split(':') f.close() host = data[0] port = data[1] else: host = 'localhost' port = 2809 print 'host:' + host print 'port:' + port rtm.nshost = host rtm.nsport = port robot_name = "RobotHardware0" if host != 'localhost' else "HiroNX(Robot)0" #robot = hironx_client.HIRONX() robot = nxc = nextage_client.NextageClient()
a_data = str(robot.getJointAngles()) self.pub.publish(a_data) if __name__ == '__main__': #-------------------------------------------initial_setting------------------------------------------ parser = argparse.ArgumentParser(description='NEXTAGE Open command line interpreters') parser.add_argument('--host', help='corba name server hostname') parser.add_argument('--port', help='corba name server port number') parser.add_argument('--modelfile', help='robot model file nmae') parser.add_argument('--robot', help='robot modlule name (RobotHardware0 for real robot, Robot()') args, unknown = parser.parse_known_args() if args.host: rtm.nshost = args.host if args.port: rtm.nsport = args.port if not args.robot: args.robot = "RobotHardware0" if args.host else "HiroNX(Robot)0" if not args.modelfile: args.modelfile = "" if len(unknown) >= 2: args.robot = unknown[0] args.modelfile = unknown[1] robot = nxc = nextage_client.NextageClient() robot.init(robotname=args.robot, url=args.modelfile) ros = ROS_Client() #--------------------------------------------end_initial_setting------------------------------------------ # 主処理 Tele()
def setUpClass(self): self._robot = nextage_client.NextageClient() self._robot.init() self._robot.goInitial(_GOINITIAL_TIME_MIDSPEED)