コード例 #1
0
 public void setRobotDriverClient(ref RobotDriverClient robot)
 {
     robot_ = robot;
     robot_.updateJointParams += OnUpdateJointParams;
     robot_.updateJointState  += OnUpdateJointState;
     timer.Start();
 }
コード例 #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            bridgeClient = new ROSBridgeClient();

            robotDriver          = new RobotDriverClient();
            transitionController = new TransitionControllerClient();
            frundController      = new FrundControllerClient();

            bridgeClient.Clients.Add(robotDriver);
            bridgeClient.Clients.Add(transitionController);
            bridgeClient.Clients.Add(frundController);

            WidgetsInit();
            LoadDefaultUri();

            jointsListView.setRobotDriverClient(ref robotDriver);
            powerSourcesView.setRobotDriverClient(ref robotDriver);
            frundControllerView.setFrundControllerClient(ref frundController);

            transitionController.updateTransitionFeedback += OnUpdateTransitionFeedback;
            timer          = new System.Windows.Forms.Timer();
            timer.Interval = 50;
            timer.Tick    += Timer_Tick;
            timer.Start();
        }
コード例 #3
0
        static void Main(string[] args)
        {
            RobotDriverClient robot = new RobotDriverClient();

            //Task task = robot.ConnectAsync(new Uri("ws://192.168.0.100:9090"));
            robot.ConnectAsync(new Uri("ws://192.168.1.140:9090")).Wait();


            Console.WriteLine("Соединение с ROSBRIDGE установленно");

            //while (!robot.isLoaded) ;

            //Console.WriteLine(
            //        String.Format("{0,-30} | {1,-10} | {2,-15} | {3,-15} | {4,-10} | {5,-10}\n",
            //        "Название привода",
            //        "Включен",
            //        "Левый предел",
            //        "Правый предел",
            //        "Смещение",
            //        "Реверс")
            //        );

            //for (int i = 0; i < robot.jointsParams.names.Count; i++)
            //{

            //    Console.WriteLine(
            //        String.Format("{0,-30} | {1,-10} | {2,-15} | {3,-15} | {4,-10} | {5,-10}",
            //        robot.jointsParams.names[i],
            //        robot.jointsParams.enabled[i],
            //        robot.jointsParams.lower_limit[i],
            //        robot.jointsParams.upper_limit[i],
            //        robot.jointsParams.offset[i],
            //        robot.jointsParams.reverse[i])
            //        );
            //}


            Console.ReadLine();
        }
コード例 #4
0
 public void setRobotDriverClient(ref RobotDriverClient robot)
 {
     robot_ = robot;
     robot_.updateSourcesState += OnUpdateSourcesState;
     timer.Start();
 }