public string walkCurved(double linearSpeed, double angularSpeed) { var data = new WalkCurvedModel(); data.LinearSpeed = linearSpeed; data.AngularSpeed = angularSpeed; var package = assembleDataPackage <WalkCurvedModel>(data); var url = "api/Navigation/WalkCurved?type=0"; var result = sendPackage <string>(url, package).Result; return(result); }
public string walkCurved(double linearSpeed, double radius, WalkCurvedModel.Orientation orientation) { var data = new WalkCurvedModel(); data.LinearSpeed = linearSpeed; data.Radius = radius; data.Angle = (int)orientation * 90; var package = assembleDataPackage <WalkCurvedModel>(data); var url = "api/Navigation/WalkCurved?type=1"; var result = sendPackage <string>(url, package).Result; return(result); }
public ActionResult WalkCurved([FromBody] ReadyDataPackage package, [FromQuery] WalkCurvedType type) { var response = ""; var walkCurved = new WalkCurvedModel(); switch (type) { case WalkCurvedType.Type1: walkCurved = package.getDataAsObject <WalkCurvedModel>(); response = (currentDaemon as Navigation).walkCurvedType1(walkCurved.LinearSpeed, walkCurved.AngularSpeed); break; case WalkCurvedType.Type2: walkCurved = package.getDataAsObject <WalkCurvedModel>(); response = (currentDaemon as Navigation).walkCurvedType2(walkCurved.LinearSpeed, walkCurved.Radius, walkCurved.Angle); break; case WalkCurvedType.Type3: break; } return(Ok(response)); }