/* RoboterControl.cs * authors: Lydia Ebbinghaus, Yannic Seidler * modified: Jingyi */ using System.Collections; using UnityEngine; using RosSharp.RosBridgeClient; // Class to ontrol the Robot in Unity and getting control signals to the controller. // Attached to robot prefabs (in folders Telemax, Asterix) that get instantiated in simulation scene. public class RoboterControl : MonoBehaviour { private RobotInformation info; float moveforward,movebackward,rotateL,rotateR; // Subscriber of position and inputreader of VR-controller. private PoseStampedSubscriber robot_pose_sub; public VRInput input { get; set; } Vector2 controlSignal; // Calibration variables. private int changed; public int calibrationtime; public float speed; // Start is called before the first frame update. // Starting coroutine and declerating variables. void Start() { changed=0; robot_pose_sub = GameObject.Find("RosBridge").GetComponent(); input = GameObject.Find("Input").GetComponent(); info = this.GetComponent(); StartCoroutine("timer"); Debug.Log("Roboter Control: Starting to update position of robot"); } // Update is called once per frame. // Calibrates robot in the first "calibrationtime" cycles. void Update() { if(changed