Example #1
0
        public void TestToStringFromEnumAndJointObject()
        {
            var robotJoints = new RobotJoints {
                joint1  = 0,
                joint2  = 100,
                joint3  = 0,
                joint4  = 0,
                joint5  = 0,
                joint6  = 0,
                gripper = 0
            };

            var expectedParameters = "0,100,0,0,0,0,0";
            var expectedCommand    = "12,0,100,0,0,0,0,0";
            var expectedCode       = 12;

            string rawCommand = $"{(int) RobotCommand.CommandType.DriveTo},{robotJoints}";

            Assert.Equal(expectedCommand, rawCommand);
            RobotCommand robotCommand = RobotCommand.FromString(rawCommand);

            Assert.True(robotCommand.Code.Equals(expectedCode), "Correct Command Code parsed");
            Assert.Equal(expectedParameters, robotCommand.Parameters);
            Assert.Equal(expectedCommand, robotCommand.ToString());
        }
        public bool RelativeMove(RobotJoints robotJoints)
        {
            Console.WriteLine($"RelMove: {(int) RobotCommand.CommandType.DriveTo},{robotJoints}");
            var successfulWrite = true;

            try {
                _serialPort.WriteLine($"{(int) RobotCommand.CommandType.DriveTo},{robotJoints}");
            } catch {
                successfulWrite = false;
            }

            return(successfulWrite);
        }
Example #3
0
        public void relMove([FromBody] RobotJoints robotJoints)
        {
            //_logger.LogError("Relative Move");
            Console.WriteLine("Relative Move/DriveDist");

            TryValidateModel(robotJoints);
            if (ModelState.IsValid)
            {
                this._rosService.RelativeMove(robotJoints);
            }
            else
            {
                Console.WriteLine("Invalid Model");
            }
        }
Example #4
0
 public void AbsoluteMove(RobotJoints robotJoints)
 {
     //driveTo - einen Punkt anfahren
     topics["DriveTo"].Publish(new std_msgs.String(robotJoints.ToString()));
 }
Example #5
0
 public void RelativeMove(RobotJoints robotJoints)
 {
     //driveDist  - Achsweise händisch verfahren um z.b. +10
     topics["DriveDist"].Publish(new std_msgs.String(robotJoints.ToString()));
 }
Example #6
0
 public void absMove([FromBody] RobotJoints robotJoints)
 {
     Console.WriteLine("Absolute Move/DriveTo");
     this._rosService.AbsoluteMove(robotJoints);
 }
 public void AbsoluteMove(RobotJoints robotJoints)
 {
     Console.WriteLine($"AbsMove: {(int) RobotCommand.CommandType.DriveDist},{robotJoints}");
     _serialPort.WriteLine($"{(int) RobotCommand.CommandType.DriveDist},{robotJoints}");
 }
 void IRobotInteractionService.RelativeMove(RobotJoints robotJoints)
 {
     throw new NotImplementedException();
 }
Example #9
0
 public void AbsoluteMove(RobotJoints robotJoints)
 {
     Console.Write("-> Test - ", System.Reflection.MethodBase.GetCurrentMethod().Name + " ->");
     Console.WriteLine(robotJoints.ToString() + " <-");
 }